Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
wayne.brill
in reply to: tom_schmitt

Hi Tom,

 

A colleague in Inventor Engineering confirms that there is not a direct way to replace a component with an SAT and have it be a part.

 

>> >>

If users directly specify a SAT for the ComponentOccurrence.Replace method, Inventor will import the SAT using default settings(which will import the SAT as assembly).

 

If the user wants to open the SAT as a single part with multiple solids, he/she can use below VBA code to import the SAT, and then save the part document and use it to replace the component:

 

Sub ImportSATSample()
    Dim oSat As TranslatorAddIn
    Set oSat = ThisApplication.ApplicationAddIns.ItemById("{89162634-02B6-11D5-8E80-0010B541CD80}")

    Dim oDM As DataMedium
    Set oDM = ThisApplication.TransientObjects.CreateDataMedium
    Dim oContext As TranslationContext
    Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
    oContext.Type = kDataDropIOMechanism
    
    Dim oOptions As NameValueMap
    Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
    
    oDM.MediumType = kFileNameMedium
    oDM.FileName = "C:\Temp\Sat.sat"
    
    ' Import SAT as a single part with multiple solid bodies
    oOptions.Add "ImportAASP", True
    oOptions.Add "ImportAASPIndex", 0

    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.Documents.Add(kPartDocumentObject)
    
    Call oSat.Open(oDM, oContext, oOptions, oDoc)
    oDoc.SaveAs "C:\Temp\Sat.ipt", False
    
End Sub

 

 

<< <<

 

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network