Document type from drawing view1

Document type from drawing view1

nicolamora
Contributor Contributor
570 Views
1 Reply
Message 1 of 2

Document type from drawing view1

nicolamora
Contributor
Contributor

Hello,

I would like to know what document type from view1 in drawing. This to have a macro in a drawing environment that does different things based on the document type in view1. 

 

If View1 is "{4D29B490-49B2-11D0-93C3-7E0706000000}"

Then 

If View1 is {9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}

Then

.......

Thanks,

Nicola

0 Likes
571 Views
1 Reply
Reply (1)
Message 2 of 2

Sergio.D.Suárez
Mentor
Mentor

Hi, Here you have a VBA code that verifies the type of reference document of the drawing view

 

'VBA Code
Sub Check_Type() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Set oSheet = oDoc.ActiveSheet Dim oView As DrawingView Set oView = oSheet.DrawingViews.Item(1) 'Select View from Item Dim oViewModelDoc As Document Set oViewModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument If oViewModelDoc.SubType = "{4D29B490-49B2-11D0-93C3-7E0706000000}" Then 'standard part : {4D29B490-49B2-11D0-93C3-7E0706000000} MsgBox "standard part" End If If oViewModelDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then 'sheet metal part : {9C464203-9BAE-11D3-8BAD-0060B0CE6BB4} MsgBox "sheet metal part" End If End Sub


I hope it is useful for you. regards


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

0 Likes