Components colors/materials retrieval
-
Hi all,
I can't figure out to do this:-
Suppose you have component instances in your model, each of them made of several various sub-components. These sub-components have also been painted by the user with various colors.
-
I can easily iterate through the top-level instances list, but once there I cannot retrieve the individual color or material of each sub_component, because there is no method "ComponentInstance.entities", these entities can only be accessed through the parent definition.
Pleeeaaase help !

-
-
@didier bur said:
Hi all,
I can't figure out to do this:-
Suppose you have component instances in your model, each of them made of several various sub-components. These sub-components have also been painted by the user with various colors.
-
I can easily iterate through the top-level instances list, but once there I cannot retrieve the individual color or material of each sub_component, because there is no method "ComponentInstance.entities", these entities can only be accessed through the parent definition.
Pleeeaaase help !

If you can get the component_instance [of a nested component_definition] that is itself inside another component_definition (get that parent's component_instance.definition.entities and mine down into it for any component_instances... to use) - then you can then get any nested component_instance.material... = nil if it's <default> or 'a_material' if it's been painted. Within any component_definition.entities you can check any face/edge for e.g. face.material (again nil=<default>)...
Hope this helps...
-
-
@unknownuser said:
Hope this helps...
Sure, sort of. Thanks TIG.
Guess what ? I must dig into 3 levels deep components to get their colors (for a client). This is more tricky than it first sounded.
-
My ComponentReporter+.rb has some component/group mining techniques in it that might help...
Good luck (bon chance!).
-
Yes, I've studied it extensively... But what I didn't noticed before is that when you have a component within another component and when you paint this sub-component globally (by default) you thus modify its definition. That's to say you can't have this sub-component colored with 2 different colors in to separate "parents". I hope that I'm clear, anyway this makes my job a lot easier
I must extract an Excel sheet with a global list of top-level furniture components (kitchen cabinets, shelves...), and a detailed list of the components of level 1 whith their colors/materials, themselves made of various pieces of level 2 of various colors/materials.
Pfff, furniture manufacturers are complicated people sometimes...P.S. Typo: Bonne chance (thanks)
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