Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Dimitar.Atanasov2VL53
349 Views, 2 Replies

Import data exchange model into Inventor

I found a post in Mod the Machine about importing data exchange models into inventor using VBA.

original post: https://modthemachine.typepad.com/my_weblog/2022/04/import-data-exchange-model.html

Sub ImportDataExchangeComponentSample()
    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim sFdx As String
    sFdx = "https://developer.api.autodesk.com/exchange/v1/exchanges"
    
    Dim sUrn As String
    sUrn = "urn:adsk.wipprod:dm.lineage:**********************"
    
    Dim sUrl As String
    sUrl = sFdx + "?filters=attribute.exchangeFileUrn==" + sUrn
    
    Dim oDEDef As ImportedDataExchangeComponentDefinition
    Set oDEDef = oDoc.ComponentDefinition.ImportedComponents.CreateDataExchangeDefinition(sUrl)
    
    Dim oDEComp As ImportedDataExchangeComponent
    Set oDEComp = oDoc.ComponentDefinition.ImportedComponents.Add(oDEDef)
End Sub

I tried it with a few data exchange models that I have on the Autodesk construction cloud and I don't get a model in inventor.

Has any of you tried it?

Labels (3)