Inventor General Discussion

Inventor General Discussion

Reply
row
New Member
row
Posts: 2
Registered: ‎01-29-2014
Message 1 of 3 (236 Views)
Accepted Solution

How to read View Representation name from part with iLogic ?

236 Views, 2 Replies
02-07-2014 05:54 AM

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.

 

Robert Wojciechowski
mechanical engineer
Frecon A/S
Autodesk Inventor Professional 2014 64-bit

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.

*Expert Elite*
cwhetten
Posts: 1,088
Registered: ‎09-03-2008
Message 2 of 3 (215 Views)

Re: How to read View Representation name from part with iLogic ?

02-07-2014 08:43 AM in reply to: row

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.

row
New Member
row
Posts: 2
Registered: ‎01-29-2014
Message 3 of 3 (174 Views)

Re: How to read View Representation name from part with iLogic ?

02-11-2014 12:29 AM 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.

 

Robert Wojciechowski
mechanical engineer
Frecon A/S
Autodesk Inventor Professional 2014 64-bit
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!