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: 

iLogic to extract title block information

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
J_Dumont
856 Views, 2 Replies

iLogic to extract title block information

Hi everyone,

I'm hoping to get some help with some code I'm struggling with.

 

I need to loop through all the sheets in a drawing and extract title block information and write it to a file.

My title block has Prompted Entries, Drawing and Sheet Properties and Model Properties.

 

I am able to get Prompted Entries and Drawing Properties without issue. However, the area I'm struggling with is capturing the model properties.

 

Any help will be greatly appreciated.

 

 

2 REPLIES 2
Message 2 of 3
JelteDeJong
in reply to: J_Dumont

the title block model properties are taken from the refrenced document from first view you make on a sheet. you can acces the model by its first view. below an example:

Dim doc As DrawingDocument = ThisApplication.ActiveDocument

For Each sheet As Sheet In doc.Sheets
    Dim view As DrawingView = sheet.DrawingViews.Item(1)
    Dim refDoc As Document = view.ReferencedDocumentDescriptor.ReferencedDocument

    Dim sets As PropertySets
    If (refDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject) Then
        Dim aDoc As AssemblyDocument = refDoc
        sets = aDoc.PropertySets
    ElseIf (refDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject) Then
        Dim aDoc As PartDocument = refDoc
        sets = aDoc.PropertySets
    End If

    Dim description As String = sets.Item("Design Tracking Properties").Item("Description").Value
    Dim partNumber As String = sets.Item("Design Tracking Properties").Item("Part Number").Value
    MsgBox(partNumber & " : " & description)
Next

if you need to know more about getting iProperties then check this blogpost:

https://modthemachine.typepad.com/my_weblog/2010/02/accessing-iproperties.html 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3
J_Dumont
in reply to: JelteDeJong

Thank you for the quick response and after testing it looks like this is exactly what I need.

I will incorporate this into my code and hopefully, you don't mind if I reach out if I run into any problems.

 

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

Post to forums  

Autodesk Design & Make Report