There is a new feature called Data Exchange that also has an API now available in public beta – see Data Exchange Released! Forge Data Exchange APIs now available in Public Beta
Through the user interface you can import such models in Inventor and you can also automate that process using the Inventor API.
For testing purposes, the easiest thing is to find a previously created Data Exchange model in your Autodesk Construction Cloud account, check its id available under entityId in the URL, and assign that in the below code to the sUrn variable.
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:sTpS6wv0ROS_QQglZOXReQ"
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
-Adam


Leave a Reply