Inventor General Discussion

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

How to read View Representation name from part with iLogic ?

198 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
*Expert Elite*
cwhetten
Posts: 1,051
Registered: ‎09-03-2008
Message 2 of 3 (177 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 (136 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube