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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Object ID prefixes

egolindano
7-Bedrock

Object ID prefixes

Hi, have a good day.

I'm doing some practices with windchill and  trying to understand how it works. Now I have a doubt.

What is the difference between  these two prefixes in objects ID

VR:wt.part.WTPart & OR:wt.part.WTPart

Thank You for your time.

ACCEPTED SOLUTION

Accepted Solutions

<class>:<key> : string representation of an ObjectIdentifier.
OR:<class>:<key> : string representation of an ObjectReference.
VR:<class>:<key> : string representation of an VersionReference.

Snippets:

/* ObjectIdentifier string to WTPart */

ObjectIdentifier oid = ObjectIdentifier.newObjectIdentifier("wt.part.WTPart:20154");

WTPart part = (WTPart) PersistenceHelper.manager.refresh(oid);


/* ObjectReference / VersionReference string to WTPart */

ReferenceFactory rf = new ReferenceFactory();

WTReference ref = (WTReference) rf.getReference("OR:wt.part.WTPart:20154");

WTPartpart = (WTPart) ref.getObject();


ReferenceFactory rf = new ReferenceFactory();

WTReference ref = (WTReference) rf.getReference("VR:wt.part.WTPart:20153");

WTPart part = (WTPart) ref.getObject();

View solution in original post

4 REPLIES 4

<class>:<key> : string representation of an ObjectIdentifier.
OR:<class>:<key> : string representation of an ObjectReference.
VR:<class>:<key> : string representation of an VersionReference.

Snippets:

/* ObjectIdentifier string to WTPart */

ObjectIdentifier oid = ObjectIdentifier.newObjectIdentifier("wt.part.WTPart:20154");

WTPart part = (WTPart) PersistenceHelper.manager.refresh(oid);


/* ObjectReference / VersionReference string to WTPart */

ReferenceFactory rf = new ReferenceFactory();

WTReference ref = (WTReference) rf.getReference("OR:wt.part.WTPart:20154");

WTPartpart = (WTPart) ref.getObject();


ReferenceFactory rf = new ReferenceFactory();

WTReference ref = (WTReference) rf.getReference("VR:wt.part.WTPart:20153");

WTPart part = (WTPart) ref.getObject();

Thank You, Ruegg.

Might be more info than you want, but for objects that are versioned (like WTParts), there are two objects created - the "Master" and the first Version.  Certain operations apply to the Master (e.g. Rename).  Attributes are applicable to either the Master or each Version (if each Version, they are "Instance based attributes" or IBAs).

The URL is either for the Master object or a specific Version.

Thank You for the information, Mike.

Announcements


Top Tags