- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am looking for a way, to retract ModelAnnotations from a 3D model into a drawing document.
I did found a relatable post about this, but it works for a single drawing view.
https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-3d-model-annotations-on-drawing-...
The latter answer retrieves General dimensions, which are Inventor Feature created dimensions, such as sketches, extrusions, etc.. Correct me if I am wrong, but that's what I got in testing.
So I wanted to use the first approach by executing Inventor command in iLogic, this is my script.
If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
MsgBox("A Drawing Document must be active for this rule (" & iLogicVb.RuleName & ") to work. Exiting.",vbOKOnly+vbCritical, "WRONG DOCUMENT TYPE")
Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDrawing.Document
oDDoc.SelectSet.Clear()
For Each oSheet As Inventor.Sheet In oDDoc.Sheets
Dim previousView = Nothing
For Each oView As DrawingView In oSheet.DrawingViews
If previousView IsNot Nothing
oDDoc.SelectSet.Remove(previousView)
End If
previousView = oView
oDDoc.SelectSet.Select(oView)
Trace.WriteLine("View name: " + oView.Name)
ThisApplication.CommandManager.ControlDefinitions.Item("DrawingRetrieveDimsCmd").Execute
ThisApplication.CommandManager.ControlDefinitions.Item("AppContextual_OKCmd").Execute
Next
Next
To replicate it you can try to run it on a given drawing, it retrieves a dimension only for a single view and that view from time to time changes for some reason..
Maybe I am not using SelectSet method correctly, if you know a better way, please tell me.
Thanks in advance and have a nice day!
Solved! Go to Solution.