VBA to Break Link to Table

VBA to Break Link to Table

waynehelley
Collaborator Collaborator
781 Views
1 Reply
Message 1 of 2

VBA to Break Link to Table

waynehelley
Collaborator
Collaborator

I have a VBA code which picks out an assembly to use as a template dependant on the users selections in a user form.

 

The problem is that the assemblys were created using iAssemblies, so they are member files and hence are linked to the table and unedittable until the link to the table has been broken,

 

Is there any VBA code to do this autonomously?? 

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
0 Likes
Accepted solutions (1)
782 Views
1 Reply
Reply (1)
Message 2 of 2

YuhanZhang
Autodesk
Autodesk
Accepted solution

You can open the iAssembly member document and then use below VBA code sample to break the link:

 

Sub BreakLinkToFactorySample()
    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    If oDoc.ComponentDefinition.IsiAssemblyMember Then
        oDoc.ComponentDefinition.iAssemblyMember.BreakLinkToFactory
    End If
End Sub

 



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.