Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

(iLogic) Setting 'Design View Representation' for a specific subassembly

Anonymous

(iLogic) Setting 'Design View Representation' for a specific subassembly

Anonymous
Not applicable

 

Very simple problem I'd say, but can't figure out how to do it:

I Want to control the 'Design View Representation' (named CD Draadmodel) of a specific subassembly (named 00001 - Main).

Thought something like the code below should work, but I'm not much of a programmer, and alas it doesn't work.

 

ThisApplication.ActiveDocument.ComponentDefinition("00001 - Main").RepresentationsManager.DesignViewRepresentation("CW Draadmodel").Activate

Does somebody know how to do this?

0 Likes
Reply
3,056 Views
3 Replies
Replies (3)

bobvdd
Alumni
Alumni

Try this. Pay attention to the :1 after your assembly name as it needs to be exactly the occurrence name as it shows up in the browser.

 

Dim ocomp As ComponentOccurrence
For Each ocomp In ThisApplication.ActiveDocument.ComponentDefinition.Occurrences
    If ocomp.Name = "00001 - Main:1" Then
    ocomp.SetDesignViewRepresentation ("CW Draadmodel", True)
	Exit For
    End If
Next ocomp

Cheers

Bob




Bob Van der Donck


Principal UX designer DMG group

Kunal_Bhansali
Contributor
Contributor
Component.InventorComponent("Sub Assembly Name").SetDesignViewRepresentation("View 1",,True)

 Just run this rule in parent assembly where you want to set specific design view representation of sub-assembly

 

Sub Assembly Name = name appearing in browser for your subassembly

View 1 = name of your desired view representation in that sub assembly

 

In attached image, Sub assembly name is "Chamber Insulation Riveted" and desired view representation is "Default". It's set by this one line rule only

ArunS2DHBM
Enthusiast
Enthusiast

What will be the code for changing the Design View Representation of the Assembly itself, say View1 to View2, instead of the subassembly. 

 

And also my other rules will work on the design representation. i,e. if I'm in View 1 and running a logic parametric rule to change the size, which has the suppression of some components, whether the same will reflect in View 2 which is not activated.

if not, what should I do, so that it's updated in both the view Representation 

 

 

0 Likes