Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ilogic to change model color/appearance

1 REPLY 1
Reply
Message 1 of 2
marcocruz
1376 Views, 1 Reply

ilogic to change model color/appearance

Hi.

 

When I open a drawing, i want to be able to change the appearance of its part model.

 

Can it be done?

 

I can do it in part itself using

 

iProperties.PartColor

But I want to do it from inside the drawing.

 

Can it be done?

 

Thanks in advance.

 

1 REPLY 1
Message 2 of 2
danvang
in reply to: marcocruz

Someone may have a better way but here's one way that I can think of. Create a text parameter in the model and set the value to a color. In the model, create a rule using the iProperties.PartColor and set it to the text parameter. In the drawing, create a multi-value text parameter and list all the colors you want. Create a rule in the drawing to set the text parameter in the model with the multivalue text parameter from the drawing. below is an example. Hope that helps.

 

model code

iProperties.PartColor = ColorinPart

 

drawing code

modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
Parameter(modelName, "ColorinPart") = Colorindwg
iLogicVb.UpdateWhenDone = True

Dan

** If my reply resolves this issue, please choose "Accept as Solution" **
Dan Vang

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report