- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello community,
I'm facing an issue to identify / find the occurrences to the corresponding attribute sets.
I'm looking for the following:
- find all objects (occurrences) inside an assembly containing a certain Attribute "myAttribute"
- get the value of this attribute for each object.
--> output a list of objects containing the values of "myAttribute"
first way I tried, where I'm facing issues is:
to find inside an assembly all objects which contains a certain attribute name by:
Inventor.AttributesEnumerator allAttributes = attributeManager.FindAttributes("*", "myAttribute");
Now by iterating through this enumeration I'm able to get the values of this attributes and to identify the attribute set of each attribute. Now I would like to get also the corresponding occurrence object. but How?
Second way which is working but very slow is to find first all objects containing a certain attribute by:
Inventor.ObjectCollection allObjects = attributeManager. FindObjects("*", "myAttribute");
There I can iterate through all object and inside through all attribute sets to get the value of the attribute "myAttribute".
--> this way is working but it takes lot of time to iterate through a big assembly.
Any suggestion how get a list of object with a certain attribute and its values in a efficient way is highly welcome.
Many thanks,
Solved! Go to Solution.