Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

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