iLogic detect if adaptive assembly is hose&pipe or harness

iLogic detect if adaptive assembly is hose&pipe or harness

danmachen
Advocate Advocate
566 Views
2 Replies
Message 1 of 3

iLogic detect if adaptive assembly is hose&pipe or harness

danmachen
Advocate
Advocate

Hi guys,

 

I'm writing an iLogic tool to help CAD users identify if there are any adaptive assemblies in their current assembly.

I have the script to cycle through all the active components in the assembly, I just don't know if there is anything in the object model to detect if they are harness or tube&pipe runs. 

 

The idea is to alert the user of an adaptive assembly unless it is a harness or tube&pipe model. In which case, no alert is made.

 

Any help appreicated.

 

Dan

Dan Machen
Autodesk Inventor 2019 Certified Professional
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

Ideas that need support:
Circular / Rectangular Point Matrix
Allow Axis & Plane Selection on Rectangular / Circular pattern
Graphical iLogic Programming
0 Likes
Accepted solutions (1)
567 Views
2 Replies
Replies (2)
Message 2 of 3

bradeneuropeArthur
Mentor
Mentor

 Sub SuppressAdaptivity(oInvApp As Inventor.Application)

        Dim oAsmDoc As AssemblyDocument
        oAsmDoc = oInvApp.ActiveDocument

        Dim occ As ComponentOccurrence
        Dim occs As ComponentOccurrences
        occs = oAsmDoc.ComponentDefinition.Occurrences

        For Each occ In occs
            If occ.Adaptive = True Then
                Dim fi As New System.IO.FileInfo(occ.ReferencedDocumentDescriptor.FullDocumentName)

                If Not fi.IsReadOnly = True Then

 

                    occ.Adaptive = False

                  
                Else
                    MsgBox(occ.ReferencedDocumentDescriptor.FullDocumentName & " Is Read-only")
                End If
            End If

        Next
    End Sub

 

and this:

 

https://forums.autodesk.com/t5/inventor-customization/get-document-subtype-framegenerator-contentcen...

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 3

bradeneuropeArthur
Mentor
Mentor
Accepted solution
 Sub SuppressAdaptivity()

        Dim oAsmDoc As AssemblyDocument
        Set oAsmDoc = ThisApplication.ActiveDocument

        Dim occ As ComponentOccurrence
        Dim occs As ComponentOccurrences
        Set occs = oAsmDoc.ComponentDefinition.Occurrences

        For Each occ In occs
            If occ.Adaptive = True Then
                'Dim fi As New System.IO.FileInfo(occ.ReferencedDocumentDescriptor.FullDocumentName)
Dim a As Document
Set a = occ.ReferencedDocumentDescriptor.ReferencedDocument

If a.DocumentInterests.HasInterest("Piping Runs Environment") = True Or a.DocumentInterests.HasInterest("HarnessPart") = True Then

                    MsgBox (occ.ReferencedDocumentDescriptor.FullDocumentName & " = adaptive")
               
    End If
End If
        Next
    End Sub

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature