Better MaterialColorAssigment handling ? #299
Unanswered
usai-sylvain
asked this question in
Q&A
Replies: 1 comment
-
|
we ll discuss if we can provide a solution for this need |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My goal is to write a
SetMaterialmethod that assign a colorId to an element based on a desired material. The challenge is that Cadwork's API requires different material color assignment methods depending on element type, and I need to search through all 255 possible color_ids to find the right match.I have a working solution but it seems highly convoluted and I hope someone here would have a better way...
Step 1 : retrieve the material color assignment based on element type.
Since I want my
SetMaterialmethod to be generic, I need to retrieve myelement typeto find the relevantMaterialColorAssignment:Step 2 : Compute the relevant MaterialColorAssignment for all 255 color_ids until I find a match for my material_id
Step 3 : Assign color_id to my elements
All together
My issues :
My question : is there a better, faster, simpler way ? How do you assign material by color ?
Beta Was this translation helpful? Give feedback.
All reactions