I-Logic to generate SAT files in Sheetmetal Assembly

I-Logic to generate SAT files in Sheetmetal Assembly

didin.suryadi6JREK
Advocate Advocate
185 Views
0 Replies
Message 1 of 1

I-Logic to generate SAT files in Sheetmetal Assembly

didin.suryadi6JREK
Advocate
Advocate

Hi, I have the below codes to create .SAT files in sheet metal assembly.

Dim oAsmDoc As AssemblyDocument
   oAsmDoc = ThisApplication.ActiveDocument
   oAsmName = Left(oAsmDoc.DisplayName, Len(oAsmDoc.DisplayName) -4)
RUsure = MessageBox.Show( _
"This Rule is to create SAT files from sheet metal" _
& vbLf & "Be sure you have made the correct sheetmetal rule and flatterned" _
& vbLf & " " _
& vbLf & "This could take a while.", "iLogic - CONVERT SHEET METAL TO SAT's",MessageBoxButtons.YesNo)
If RUsure = vbNo Then
Return
Else
End If
Dim oFN As String
Logger.Info("Filename :" & oFN)
oPath = ThisDoc.Path
'get SAT target folder path
oFolder = oPath & "\" & oAsmName & " .SAT Files"
'Check for the SAT folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
System.IO.Directory.CreateDirectory(oFolder)
End If

Dim oSMCD As Inventor.SheetMetalComponentDefinition
For Each oDoc In ThisApplication.ActiveDocument.AllReferencedDocuments
	If oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then 
		oSMCD = oDoc.ComponentDefinition
		'If oSMCD.FlatPattern Is Nothing Then
			'oSMCD.Unfold
		'Else
			'oSMCD.FlatPattern.Edit
		'End If
		oFN = Left(oDoc.FullFileName, Len(oDoc.FullFileName) -4) & ".sat"
		'Logger.Info("Filename :" & oFN)
		oDoc.SaveAs(oFN , True)
		'oSMCD.FlatPattern.ExitEdit
		'oDoc.Close
	End If
	Next

Here is the result:

didinsuryadi6JREK_0-1653638839504.png

 

 

What I request:

1. Since the result of SAT's stays outside of the folder, I want the sat files to stay in the folder.

2. Change every dot file name on IPT parts to dash (-) after converting to SAT. 

Example: Test.one.JP.ipt become Test-one-JP.sat

 

Appreciated your help

0 Likes
186 Views
0 Replies
Replies (0)