Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to read View Representation name from part with iLogic ?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
882 Views, 2 Replies

How to read View Representation name from part with iLogic ?

Hi

I would like that the color of a surface in part is depend of the View name.

To do this I need to suppress a feature that get surface to appear in different color in other views.

I can see that it is possible to set the View:

 

If Colour = "Red" Then

ocompdef.RepresentationsManager.DesignViewRepresentations.Item("Red").Activate

 

But how to know name of the active view in part?

Many thanks for an input.

 

2 REPLIES 2
Message 2 of 3
cwhetten
in reply to: Anonymous

Hi and welcome to the forum!

 

Using your ocompdef object, you can get the name of the active view rep with the following line:

 

ocompdef.RepresentationsManager.ActiveDesignViewRepresentation.Name

 

Hope this helps!

 

Cameron Whetten
Inventor 2014

Please click "Accept as Solution" if this response answers your question.

Message 3 of 3
Anonymous
in reply to: cwhetten

Hi

Thanks for your reply.

 

I have now;

ViewName = ocompdef.RepresentationsManager.ActiveDesignViewRepresentation.Name

 

If ViewName = "Surface Treatment" Then

    Feature.Color("Extrusion8") = "SFT_Magenta"

 

This works very well if I execute the code in part.

 

I run now into next question.

How tell Inventor to run the illogic code in part, if I change view representation  in the assembly that containing the part with the code?

The part’s view representation is controlled by the assembly view representation.

 

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

Post to forums  

Autodesk Design & Make Report