Skip to main content
1-Visitor
September 26, 2019
Question

Windchill Autonumbering new parts

  • September 26, 2019
  • 3 replies
  • 8015 views

Hi,

 

I want to change the default object (part, asm) name on Creo to follow a certain rule. Based on Windchill documents, this is done via OIR admin. I've had a look at a lot of articles and dicussions in PTC community regarding Object Initialization Rule (OIR), and it all points to goto OIR admin, edit the .xml under type 'Part'.

 

Below is an extract from the .xml file. From what I understand, all I need to do is add a new line <Arg></Arg>  under id="number" with my new numbering format. This doesn't seem to be doing anything. When I create a new part, it still does the default PRT0001 and increments 1 for the next new parts. What am I missing here?

 

 

<AttributeValues objType="wt.part.WTPart">

.......

<AttrValue
id="number"
algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator"
ignore="false"
force="false"
final="false">
<Value algorithm="wt.rule.algorithm.BooleanBranch">
<Value algorithm="wt.rule.algorithm.EqualsTest">
<Attr id="genericType"/>
<Arg>variant</Arg>
</Value>
<Arg>V</Arg>
<Arg></Arg>
</Value>
<Arg>temp-</Arg>
<Arg>{GEN:wt.enterprise.SequenceGenerator:WTPARTID_seq:10:0}</Arg>
</AttrValue>
<AttrValue
id="folder.id"
algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm"
ignore="false"
force="false"
final="false">
<Arg>/Default</Arg>
</AttrValue>

3 replies

1-Visitor
September 30, 2019

Hi,

 

Are you wanting WTParts the be named temp-(number)? Or are you trying to get CAD parts to name in that manner?

 

Also you will need to look at where the rule is applied Org level or is it Product or library level and make sure the rule is enabled to override the higher level rule (that should be disabled in the product/library.

 

I should be able to help.

cfc441-VisitorAuthor
1-Visitor
September 30, 2019

Hi,

 

Thanks for the response.

I'm not certain about the difference between WTParts and CAD parts.

Currently, what I'm thinking of is CAD document (.drw, .prt, .asm) created from Creo (New, save as copy, replace with copy). We never use the 'Create New' option from Windchill, in case these two ways of creating objects have to be controlled using different rules.

 

As for the application of the rule, I want to test it by limiting its use within a Context of a Product or the entire Product level. If successful, I want to implement it to a bigger scale.

1-Visitor
October 4, 2019

I've captured a screen of the context I want the OIR to work in. you will see one is site and is disabled and the other is the context (I've obscured name of the context) which is enabled. Your version of the file will go here. 

 

Also note that if you change the OIR rule it needs to be assigned again to that EPM Document OIR. 

 

Are you with me on this or do you need more help? Have you been loading in correct place and ensuring it is the enabled rule?

23-Emerald III
October 4, 2019

If my thinking is correct, it is Friday after all, OIR only comes into play when creating objects (Parts, WTparts, documents, etc.) from within Windchill, not in Creo.

In order for you to get your desired results, you would need to create the CAD documents in Windchill as empty parts and then pull those parts into Creo to build the content. Typically CAD parts are not created this way. The designer opens Creo and does a File-New which has no rules for constructing a part number OOTB.

 

1-Visitor
October 4, 2019

OOTB the rules just do prt0001

 

if you configure Windchill to do it you will get customised autonumbering of CAD content in creo when working in the correct context workspace.

 

So I have products configured with product number as the first 4 characters and a hyphen splits that from the autonumber sequence generator and then I get new custom parts wherever I work.

 

I apply the OIR to each context and make sure that higher order OIR's are not enabled so it takes my context driven OIR.

 

23-Emerald III
October 4, 2019

"I apply the OIR to each context and make sure that higher order OIR's are not enabled so it takes my context driven OIR."

 

If you have to disable a higher OIR rule then Windchill is not working as designed. The documentation clearly states that OIR rules are applied from the Product/Library first, then Organization and finally Site. This builds a composite rule that can be tailored for all levels of your company and only change where you need the change.

 

If you only need to change the folder rule at the product level, that is all you need in that OIR and the rest of the OIR rules come from your organization or site level, The composite rule is what is applied to your document.

 

I have even run across PTC documentation that basically says this only works if you have the site level OIR enabled. BUT, I have seen other CS articles that say you must disable the higher level rules. So confusing when you have to enable this rule for it to work but disable another for that function to work.

 

Maybe PTC should do away with the composite rule building and if it finds a lower level OIR, just use it and ignore upper level ones. My customized OIRs are at the org level and they start as copies of the site level ones, so I have the full information in the OIR.

 

22-Sapphire I
October 4, 2019

The OIR gets applied at Upload.  Checkin includes Upload.

23-Emerald III
October 4, 2019

By the time you do an upload/check-in, you have already assigned a part number to the object, so that part of the OIR gets ignored.

Or does it flag an error as not meeting the OIR rule?