Update all views in a sheet to turn on Associative check box - iLogic

Update all views in a sheet to turn on Associative check box - iLogic

Anonymous
Not applicable
602 Views
2 Replies
Message 1 of 3

Update all views in a sheet to turn on Associative check box - iLogic

Anonymous
Not applicable

Is it possible to turn on the Associative check box for all views in a drawing using iLogic?

 

 

Here is what I have so far which does the opposite of what I want:

 

 

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

 

Dim oSheet As Sheet

 

Dim oDrawView As DrawingView

 

For Each oSheet In oDrawDoc.Sheets

For Each oDrawView In oSheet.DrawingViews


Representation = oDrawView.ActiveDesignViewRepresentation

If Representation <> "" Then

oDrawView.SetDesignViewRepresentation(Representation, False)
'End If

 

Next
Next

 

The problem is that the Representation = "" if the associative box is unchecked. And I require the Representation name to SetDesignViewRepresentation and set the Associative value to True.

 

This is a related post:

 

https://forums.autodesk.com/t5/inventor-customization/api-get-the-quot-design-view-representation-qu...

0 Likes
603 Views
2 Replies
Replies (2)
Message 2 of 3

Xun.Zhang
Alumni
Alumni

Hi @Anonymous,

 

As Jon indicated, there is a way to turn on/off the "Associative" box is to use DrawingView.SetActiveDesignViewRepresentation("myDVR", True) 

(i.e., it takes an optional second argument that controls the associativity). 

 

In your case, you have query out all related view name first, but not 100% sure.

 

@JaneFan, any good idea here?

 

Thanks!


Xun
0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi @Xun.Zhang,

 

Thanks for your response.

 

This is exactly my issue, I don't know how to effectively query out all related design view representation names first (if associative tick box is off).

 

Any ideas?

0 Likes