Difference between assembly drawing and part drawing

Difference between assembly drawing and part drawing

Anonymous
Not applicable
4,366 Views
4 Replies
Message 1 of 5

Difference between assembly drawing and part drawing

Anonymous
Not applicable

Hi

I want to know if there is any api to check if a particular drawing is a assembly drawing or part drawing.Please help.

0 Likes
Accepted solutions (1)
4,367 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
You can check what model the drawing is referenced.

It's better name your drawing asm drawing and prt drawing differently.
0 Likes
Message 3 of 5

Anonymous
Not applicable
Hi thanks for the reply but the drawings are prepared by someone else and i need to write a macro to check if the drawing is assembly or part.Is there any api available for this.
0 Likes
Message 4 of 5

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

Here is the VBA sample to illustrate possible solution:

Private Sub DrawingRefs()
  
  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)

  Dim oRef As DocumentDescriptor
  Set oRef = oView.ReferencedDocumentDescriptor
  
  Select Case oRef.ReferencedDocumentType
    Case DocumentTypeEnum.kAssemblyDocumentObject
      MsgBox "Assembly Document"
    Case DocumentTypeEnum.kPartDocumentObject
      MsgBox "Part Document"
    Case Else
      MsgBox "Document - ???"
  End Select

End Sub

Hope idea is clear.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 5

Anonymous
Not applicable
Thankyou so much got it.Thanks a lot 🙂 🙂 🙂
0 Likes