Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Difference between assembly drawing and part drawing

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
hsheena
4104 Views, 4 Replies

Difference between assembly drawing and part drawing

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.

4 REPLIES 4
Message 2 of 5
johnnr
in reply to: hsheena

You can check what model the drawing is referenced.

It's better name your drawing asm drawing and prt drawing differently.
Message 3 of 5
hsheena
in reply to: johnnr

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.
Message 4 of 5
Vladimir.Ananyev
in reply to: hsheena

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

Message 5 of 5
hsheena
in reply to: Vladimir.Ananyev

Thankyou so much got it.Thanks a lot 🙂 🙂 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report