Definition.instances upset
-
I hope someone can see what is wrong here. I can add all the definition instances to the selection but I can only return half of them as shown in the console. Sorry it's rather messy, made worst by the impossibility to indent.
Thanks and Happy New Year.

-
It's because you have instances of a definitions which exists in multiple instances of another definition.
Example:
Definition "lower_arm"
lower_arm_definition.count_instances == 1(because it only has one instance, placed in the lower_arm_combo definition.)
lower_arm_definition.instanceswill return only that instance. Because you add it to the selection, that instance will be highlighted everywhere it occurs in the model. But you have not iterated over any more instances.What you need to do, is travel back the paths of an instance's parents and if it's contained in another group or component, then you must work out how many copies there is of that - and continue that all the way back.
-
Takk!
Now you have said it I feel somewhat foolish ... oh well ... time to go to the pub. Maybe next year I can do better.
Happy New Year to you and all the other members.
Chris
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement