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

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

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
MikeLockwood
22-Sapphire I

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

TomU
23-Emerald IV

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

 

Document Category.PNG

 

docType.PNG

MikeLockwood
22-Sapphire I

Subtle but important difference.

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

 

TomU
23-Emerald IV

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

 

 

BartLefevere
6-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
PTCModerator
Emeritus
Status changed to: Acknowledged
 
SergeyEfimov
13-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>

 

 

AndersKullenber
6-Contributor

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