Submitted by jelrae_farsun on Mon, 09/18/2017 - 06:17
Forums:
Hey all,
I have managed to write some code to find the tag of a title block. I want to then use this tag get to the values by label. But the tag object doesnt have that function. How do I use that tag to get to the real object?
Thanks,
Jordan
re: get object from tag
You can use the object manager to get an object from a tag value:
Dim myTObj as TaggedObject
myTObj = Utilities.NXObjectManager.Get(yourTag)
If you know the type of object that will be returned, you can cast then cast it to the specific object type. Alternately, if you know the object type beforehand and you are using "Option Strict Off", you can implicitly cast to the proper object type when you get the object. For instance, if you know the tag represents a face object, you can do the following:
Dim myFaceObj as Face
myFaceObj = Utilities.NXObjectManager.Get(theFaceTag)
This sounds promising
Hey,
Thank you, this sounds like it might work. How did you find this in the API? I have been searching for something like this for two days. I haven't been able to find anything like this though and I would like to find them without having to bother this forum every time.
re: get object from tag
I don't remember the exact source, most likely a GTAC example. GTAC posts a lot of code samples in the solution center.