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.
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
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.
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."
That is a clean and simple Assembly, And I am selecting the viewas well.
Is that working with oyu?? Iam Using INV 2013.
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
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?
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.
Hi,
this is a known issue which has been logged: ActiveDesignViewRepresentation should return the corresponding view name no matter the view associative or not.
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....
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.