VB.NET opening .SAT file as a Multi-body part instead of and Assembly

VB.NET opening .SAT file as a Multi-body part instead of and Assembly

Anonymous
Not applicable
507 Views
1 Reply
Message 1 of 2

VB.NET opening .SAT file as a Multi-body part instead of and Assembly

Anonymous
Not applicable

I'm trying to open a .SAT file using the code below, and its opening as an Assembly.

 

Dim InvApp As Inventor.Application

InvApp.Documents.Open(C:\test.sat, True)

 

When I manually open the .SAT file I get prompted to create as and "Assembly", "Multi-body part", and "Composite feature part". Is there a way to select the multi-body part option programmatically? 

 

image.png

0 Likes
508 Views
1 Reply
Reply (1)
Message 2 of 2

moveworkforward
Contributor
Contributor

Hi @Anonymous 

Try this:

 

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

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

    Dim oDoc As PartDocument
    oDoc = ThisApplication.Documents.Add(kPartDocumentObject)
    
    Call oSat.Open(oDM, oContext, oOptions, oDoc)
End Sub

 

Below is the list of all available Open Options for SAT translator:

SaveLocationIndex = 0
ComponentDestFolder = ''"
AssemDestFolder = ""
SaveAssemSeperateFolder = False
AddFilenamePrefix = False
FilenamePrefix =
AddFilenameSuffix = False
FilenameSuffix =
EmbedInDocument = True
SaveToDisk = False
ImportSolid = True
ImportSurface = True
ImportWire = True
ImportValidationProperties = False
CreateIFO = False
ImportAASP = False
ImportAASPIndex = 0
CreateSurfIndex = 1
GroupName =
GroupNameIndex = 0
ImportUnit = 0
CheckDuringLoad = False
AutoStitchAndPromote = True
AdvanceHealing = False
EdgeSplitAndMergeDisabled = False
FaceSplitAndMergeDisabled = False
Link Visibility = True
DefaultPartnames = True