AcquirePersistentObject
TheAcquirePersistentObjectmethod returns a reference to the part or frame with the specified scripting ID.
ODPersistentObject AcquirePersistentObject ( in ODPersistentObjectID objectID, out ODObjectType objectType);
objectID- The scripting ID of the desired object.
objectType- The type of the object returned, either part (
kODPartObject) or frame (kODFrameObject).- return value
- A reference to the part or frame with the specified scripting ID.
DISCUSSION
You call this method to obtain a reference to a part or frame, given the ID that identifies it for scripting purposes. This method should be used only for scripting.This method increments the reference count of the returned persistent object. When you have finished using that persistent object, you should call its
Releasemethod.EXCEPTIONS
kODErrIllegalNullIDInput- The
objectIDparameter is null.kODErrInvalidPersistentObjectID- This draft has no persistent object with the specified ID, or the object is of a type that cannot be acquired.
SEE ALSO
TheODObjectTypetype (page 903).
TheODPersistentObjectIDtype (page 900).
TheODDraft::GetPersistentObjectIDmethod (page 174).
"Default Object Accessors" on page 421 in OpenDoc Programmer's Guide.