Is tag unique for a label in the OCAF tree?

Hi, All,

I want to use the tag of a label to access this label in the OCAF tree. But I am not sure the tag is unique or not. Can anyone help me?

Thanks in advance!


Dennis G.'s picture

Hello Chris,

regarding to the 'ocaf.pdf' documentation chapter 3.2 a tag is...
an integer, which identifies a label in two ways:
• Relative identification
• Absolute identification.
In relative identification, a label’s tag has a meaning relative to the father label only. For a specific
label, you might, for example, have four child labels identified by the tags 2, 7, 18, 100. In using
relative identification, you ensure that you have a safe scope for setting attributes.
In absolute identification, a label’s place in the data framework is specified unambiguously by a
colon-separated list of tags of all the labels from the one in question to the root of the data
framework. This list is called an entry. TDF_Tool::TagList allows you to retrieve the entry for a
specific label.
In both relative and absolute identification, it is important to remember that the value of an integer
has no intrinsic semantics whatsoever. In other words, the natural sequence that integers
suggest, i.e. 0, 1, 2, 3, 4 ... - has no importance here. The integer value of a tag is simply a key.
The tag can be created in two ways:
• Random delivery
• User-defined delivery
As the names suggest, in random delivery, the tag value is generated by the system in a random
manner. In user-defined delivery, you assign it by passing the tag as an argument to a method.



Robert Hill's picture

The tag is not unique, it is simply an integer. If you know the father label you can find the child label with the tag. If you are searching the entire OCAF tree, try using the label entry, which is a series of tags such as 0:5:1:2. This will be unique and allow you to find the specific label.

You can access the entry using TDF_Tool's Entry() method.

Hope this helps.

Regards, R. Hill

Wang Chris's picture

Man thanks for your help, I got it.


yuanxm0220_152233's picture

Hi All,

if the list label downside is a const permanent, that is 0:1:1 always stands for Shapes, 0:1:2 stands for colors ......?

and how can I relate the color attribute to the exact shape, for example, how to get the color of the relative surface in a assembly step CAD file?



Name:Clipping Planes