Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
in reply to: felix.cortes5K3Y2

Felix,

 

You can use the ModelDocument code snippet from Advanced Drawing API. This will retrieve the model associated to the drawing. If there's more than one model, it will pick the first one. If there is more than one model, you can use the ModelDocument(View) snippet and this will let you define the view name and it will retrieve the model associated to the view. Once the model is retrieved, which is a document object, you can get different properties such as Displayname, FillFileName, etc.

 

2019-07-11_9-18-35.jpg

So the code will look something like this. Hope that helps.

 

DanV

doc = ThisDrawing.ModelDocument 'from the Model Document snippet
MessageBox.Show(doc.FullDocumentName) 'use FullDocumentName to get path & file name
MessageBox.Show(doc.DisplayName) 'use to get the file name only