Inventor General Discussion

Inventor General Discussion

Reply
Active Contributor
CadlineSupport
Posts: 48
Registered: ‎02-23-2012
Message 1 of 3 (670 Views)
Accepted Solution

iLogic to change the view representation in a part file

670 Views, 2 Replies
04-16-2012 09:14 AM

 

Hi,

There is an existing thread on this forum showing how to change the view rep in an assembly (using oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("Red").activate) - Thank you to Curtis Waguespack - however I am trying to achieve the same with iLogic in a part file (multi-solid). Is this possible please?

Many thanks

Following iLogic rule activates "View1" and should work both in a part or in an assembly.

Keep in mind that viewreps capture the part and body appearance in a multi-body part but not the face or feature appearance.

 

Dim odoc As Document
Dim ocompdef As ComponentDefinition
odoc = ThisApplication.ActiveDocument
ocompdef = odoc.ComponentDefinition
Try
ocompdef.RepresentationsManager.DesignViewRepresentations.Item("View1").Activate
Catch
MessageBox.Show("This viewrep does not exist", "Error")
End Try

 Bob

 

Product Support
bobvdd
Posts: 577
Registered: ‎11-23-2005
Message 2 of 3 (662 Views)

Re: iLogic to change the view representation in a part file

04-16-2012 09:58 AM in reply to: CadlineSupport

Following iLogic rule activates "View1" and should work both in a part or in an assembly.

Keep in mind that viewreps capture the part and body appearance in a multi-body part but not the face or feature appearance.

 

Dim odoc As Document
Dim ocompdef As ComponentDefinition
odoc = ThisApplication.ActiveDocument
ocompdef = odoc.ComponentDefinition
Try
ocompdef.RepresentationsManager.DesignViewRepresentations.Item("View1").Activate
Catch
MessageBox.Show("This viewrep does not exist", "Error")
End Try

 Bob

 

Active Contributor
CadlineSupport
Posts: 48
Registered: ‎02-23-2012
Message 3 of 3 (647 Views)

Re: iLogic to change the view representation in a part file

04-16-2012 12:59 PM in reply to: CadlineSupport

Superb! works perfectly thank you very much for the quick response

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.