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: 

[VBA] use only visible parts in assembly

1 REPLY 1
Reply
Message 1 of 2
j.devetten
725 Views, 1 Reply

[VBA] use only visible parts in assembly

in my assembly part visibility is controlled by a Ilogic rule which selects an Iassembly. This assembly is a parametric model controlled by excel. The visible parts have to be exported to dxf.

 

Everything is working (iterating through parts, export sheet metal to dxf), but how can I check whether a part is visible within the assembly?

1 REPLY 1
Message 2 of 2
j.devetten
in reply to: j.devetten

when working with iassemblies it is not the visible property, but the exclude property where you have to look for:

 

[code]

    Dim invProperty As PropertySet
    Dim invDoc As Inventor.PartDocument
    Dim invAsm As Inventor.AssemblyDocument
    Dim invOcc As ComponentOccurrence
    
    Set invAsm = invapp.ActiveDocument

    
    For Each invOcc In invAsm.ComponentDefinition.Occurrences
        If invOcc.Excluded = False Then
       
            Set invDoc = invOcc.Definition.Document
               

            'check for sheet-metal 
            If (invDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}") Then
                       
                'open sheetmetal document
                Set invDoc = invapp.Documents.Open(odocument.FullFileName)
                      
                'update inventor model
                invapp.ActiveDocument.Update
                invapp.ActiveView.Fit
                           
                'sla op als dxf
                DXF_DataIO
                
                invapp.ActiveDocument.Close (True)
               
            End If
        End If
       
    Next

[/code]

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

Post to forums  

Autodesk Design & Make Report