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

Windchill Autonumbering new parts

cfc44
7-Bedrock

Windchill Autonumbering new parts

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>

13 REPLIES 13

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.

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.

Ok, so the OIR rule you have set is for WTParts not cad content.

 

That rule is the object type at the header would be objtype="wt.prt.EPMDocument" so what you have been trying is not applied to cad at all.

I couldn't find one for wt.prt.EPMDocument.

This is what I found:

 

<AttributeValues objType="wt.epm.EPMDocument">
<AttrValue
id="number"
algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator"
ignore="false"
force="false"
final="false">
<Arg>temp</Arg>
<Arg>{GEN:wt.enterprise.SequenceGenerator:EPM_seq:10:0}</Arg>

</AttrValue>

 

I edited the type: EPM Document to include the new .xml. Still doesn't work. Is there a step after uploading the new .xml that I'm missing (i.e. register the changes)?

 

Regards

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?

I think so. What is the objType value for the context and site, is it different?

If I apply a rule in 'site' level, shouldn't it also propagate to all the lower levels including all other context?

 

Also, my EPMDocument is currently on 'site' (attached image). When I try to create a new OIR there's no option to change the context from 'site' to a different one. Does this mean I have to create a new EPM Document for new context?

 

Capture.JPG

that is not the place to assign OIR's. I suspect that you should not be messing around with this.

 

Object types are created at site level you need to go to the correct place in utilities to assign your OIR. I do at context level to allow each context to have it's own rules. You can do at site level but that ripples through everything (unless you have other context rules).

BenLoosli
22-Sapphire III
(To:Roy_Crerar)

Create OIRs at the org level or the Product/Library level.

Always create your own OIRs, copy of the site level ones, so PTC does not override your changes if you play with a site level OIR. Same applies to lifecycles, worklflows, etc.

I have created all of mine at the org level for now. I may change and create some context specific OIRs at a later date which would be at the Library level.

 

BenLoosli
22-Sapphire III
(To:cfc44)

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.

 

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.

 

BenLoosli
22-Sapphire III
(To:Roy_Crerar)

"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.

 

The OIR gets applied at Upload.  Checkin includes Upload.

BenLoosli
22-Sapphire III
(To:MikeLockwood)

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?

 

Announcements