Change Design View in IDW

Change Design View in IDW

Anonymous
Not applicable
946 Views
9 Replies
Message 1 of 10

Change Design View in IDW

Anonymous
Not applicable

Hi,

 

Change Design View in IDW.

 

Followupfrom a thread from Years ago..

 

Lookin got get designViewrep name in Drawing FIle.

 

Sub DesignViewRep()

    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oDrawingView As DrawingView
    Set oDrawingView = ThisApplication.CommandManager.Pick(kDrawingViewFilter, "Select a drawing view")
    
    MsgBox oDrawingView.ActiveDesignViewRepresentation

End Sub

Above macro from Daniel is not working.. please fing avi file attached.

 

hope we will get some soloution for a simple and small issue.

 

 

0 Likes
947 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable

What Inventor version are you using? I tested the code with Inventor 2013. See below for a section from the programming help. I looks like it's in the API since Inventor 11.

 

What is the problem with the code? do you get a runtime error or just an empty msgbox?

 

  

DrawingView.ActiveDesignViewRepresentation Property

Parent Object: DrawingView

Description

Property that returns the name of the active Design View Representation for a drawing view of an assembly. This property returns a null string for drawing views of parts & presentations and in the case where the model (assembly) is unresolved.

Syntax

DrawingView.ActiveDesignViewRepresentation() As String

Version

Introduced in Inventor version 11

0 Likes
Message 3 of 10

Anonymous
Not applicable

Hii..

 

It is just retuning an empty MsgBox. If you have any File Transfer (large file) I can send you debug video.

 

Just an Empty Msgbox. Nothing else.No errors.

0 Likes
Message 4 of 10

Anonymous
Not applicable

Are you selecting an assembly view?

 

This line in the help will explain the empty message box: "This property returns a null string for drawing views of parts & presentations and in the case where the model (assembly) is unresolved."

0 Likes
Message 5 of 10

Anonymous
Not applicable

 

That is a clean and simple Assembly, And I am selecting the viewas well.

 

Is that working with oyu?? Iam Using INV 2013.

0 Likes
Message 6 of 10

Anonymous
Not applicable

Hmm last week it worked, but I now seem to get the same behavior you mention. Just an empty msgbox.

 

I will try to find out what the problem is.

 

Daniël

0 Likes
Message 7 of 10

Anonymous
Not applicable

Ok, here's what I've found out.

 

When I place a view with a design view other than Master selected, the code works. If I select another design view other than master, the code also works. But if I select the master design view, the ActiveDesignViewRepresentation property returns an emptry string. Even more strange, when I now select another design view (which previously worked), the string is still empty!

 

Could you please check if you can reproduce this?

0 Likes
Message 8 of 10

Anonymous
Not applicable

ActiveDesignViewRepresentation  property works if and only Associative box is checked (marked) when placing the view on the drawing sheet.

 

But I am looking to get the name of the view even if assocative is not selected.

 

Even if there is a custom view (or Default View), without associative checked, msgbox result a null value.

 

May be somebody should fix or clarify.

0 Likes
Message 9 of 10

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

this is a known issue which has been logged: ActiveDesignViewRepresentation  should return the corresponding view name no matter the view associative or not.

0 Likes
Message 10 of 10

Crstiano
Collaborator
Collaborator

Hi Xiaodong,

I have similar problem... my ActiveDesignViewRepresentation always returns = ""

 

Exist a correct way for control and change the DesignViewRepresentation of the SubAssembly in the Assembly?

 

I try in IV2014, if I use:

 

Call oOcc.SetDesignViewRepresentation ("OffZones")

 The software crash !!!!

 

If I use:

Dim oRepMan As RepresentationsManager
Set oRepMan = oOcc.Definition.RepresentationsManager
Dim oDVR As DesignViewRepresentation
Set oDVR = oRepMan.DesignViewRepresentations.Item("OffZones")
Call oDVR.Activate

 Don't show effects.... Smiley Frustrated

 

And another set: How define IsAssociativeToDesignViewRepresentation in this change ??

 

Thanks in advance

 

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Cristiano Oliveira
EESignature
ConsultCAD.com

0 Likes