cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Allow object initialization rules to branch based on "docType" (auto numbering based on docType)

Allow object initialization rules to branch based on "docType" (auto numbering based on docType)

We would like to enable auto numbering for parts and assemblies (but NOT for drawings) and also use separate numbering sequences for parts vs. assemblies.  Currently this does not seem possible due to limitations with object initialization rules. (See CS188317)  Please allow object initialization rules to branch based on "docType", and have this branching actually work directly from the CAD tool (Creo Parametric and Solidworks.)

8 Comments
Peridot

In this case, "Document Category" would have to be used rather than Object Type, since all are EPMDocument | CAD Document Type.

Emerald II

docType is the internal name for "Document Category".  I'm pretty sure we're talking about the same thing...

 

Document Category.PNG

 

docType.PNG

Peridot

Subtle but important difference.

In a report for type=EPMDocument you can filter for Document Category=Drawing for example.

 

Emerald II

Yes, but I believe for OIRs you have to use the internal name.  For reporting it makes sense that you would use the friendly "Name" instead of the "Internal Name".  The key point here is that Type != docType.

Windchill Types.PNG

 

 

Contributor
Branching on docType is working for Creo Elements Direct Modeling e.g. prefix docType=CADCOMPONENT : P docType=CADASSEMBLY : A But for Creo Parametric the OIR gives an error because docType=null
Community Manager
Status changed to: Acknowledged
 
Aquamarine

It works, you can use like this method for folders:

<!-- set folder -->
<AttrValue id="folder.id" algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm">
<Value algorithm="wt.rule.algorithm.CaseBranch">
<Value algorithm="wt.rule.algorithm.EqualsTest"><Attr id="docType"/>
<Arg>CADASSEMBLY</Arg></Value>
<Arg>/Default/Class T/Asm</Arg>
<Value algorithm="wt.rule.algorithm.EqualsTest"><Attr id="docType"/>
<Arg>CADDRAWING</Arg></Value>
<Arg>/Default/Class T/Drw</Arg>
<Value algorithm="wt.rule.algorithm.EqualsTest"><Attr id="docSubType"/>
<Arg>SKEL_MODEL</Arg></Value>
<Arg>/Default/Class T/Skel</Arg>
<!-- set default folder -->
<Arg>/Default/Class T/Prt</Arg>
</Value>
</AttrValue>

<AttrConstraint id="folder.id" algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue"/>
<Value algorithm="com.ptc.core.rule.server.impl.GetRendererConstraint">
<Arg>SelectGeneratedFolderByDefault</Arg>
</Value>
</AttrConstraint>

 

 

Participant

I like to add that it is important that this branching is also respected in during Save As. I tried out a similar use-case described in https://www.ptc.com/en/support/article/CS219911

It branches on authoringApplication instead of docType and it seams to work when creating objects, at least from the wgm:

 

Anteckning 2020-06-11 093850.pngAnteckning 2020-06-11 093851.png

but it does not work during Save As:

Anteckning 2020-06-11 093852.png

The number does not get generated for the Creo file as it should