07-11-2019
07:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
07-11-2019
07:14 AM
Hi, look at the following code maybe I can help you. With it you can access the model document from the drawing view.
I used a view selection method. You can select the view through the item or otherwise if you need it.
I hope this helps. regards
Dim oView As DrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Seleccione Vista") If oView Is Nothing Then Exit Sub Dim oModelDoc As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument Dim oViewModelName As String = oModelDoc.DisplayName Dim oFullFilePath As String = oModelDoc.FullFileName Dim oFolderPath As String = Left(oFullFilePath, (InStrRev(oFullFilePath, "\", - 1, vbTextCompare) - 1)) MessageBox.Show("DisplayName: " & oViewModelName) MessageBox.Show("FullFilename: " & oFullFilePath) MessageBox.Show("FolderPath: " & oFolderPath )
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn