Community
Im getting the error below everytime I run the assembly program for each part created. Any ideas?
Error in rule: CREATION, in document: testpart.ipt
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
-----------------ASSEMBLY CODE PORTION---------------------------------------
Components.Add("c:1", "testpart1.ipt")
map.Add("Arg1", SB)
map.Add("Arg2", Width)
map.Add("Arg3", SIDERAIL_T)
map.Add("Arg4", mats)
iLogicVb.RunRule("c:1", "CREATION", map)
Components.Delete("c:1")
---------------------------------------------------------------------------
--------------------PART CODE----------------------------------------------
UPSTREAM = RuleArguments("Arg1")
DOWNSTREAM = RuleArguments("Arg2")
WIDTH = RuleArguments("Arg3")
THICKNESS = RuleArguments("Arg4")
M = RuleArguments("Arg5")
RADIUS = RuleArguments("Arg6")
LENGTH = UPSTREAM + DOWNSTREAM
'iProperties.Material=Material
If CUT = False Then
iProperties.Value("Project", "Part Number") = "FLOW BLOCK " & M & " - " & LENGTH & " x " & WIDTH & " x " & THICKNESS
iProperties.Value("Project", "Stock Number") = LENGTH & " x " & WIDTH & " x " & THICKNESS
iProperties.Value ("Summary", "Title") = "FLOW BLOCK " & M & " - " & LENGTH & " x " & WIDTH & " x " & THICKNESS
ElseIf CUT = True Then
iProperties.Value("Project", "Part Number") = "FLOW BLOCK " & M & " - " & LENGTH & " x " & WIDTH & " x " & THICKNESS & " CUT"
iProperties.Value("Project", "Stock Number") = "CUT AS REQUIRED"
iProperties.Value ("Summary", "Title") = "FLOW BLOCK " & M & " - " & LENGTH & " x " & WIDTH & " x " & THICKNESS & " CUT"
iLogicVb.UpdateWhenDone = True
End If
'define the folder where you want to save the files
oFolder = "C:\Users\ronno\Documents\Inventor\Work\"
'grab the filename
oFileName = iProperties.Value("Summary", "Title") 'without extension
'create the folder if it doesn't exist
If Not System.IO.Directory.Exists(oFolder) Then
System.IO.Directory.CreateDirectory(oFolder)
End If
'save as a ipt
ThisDoc.Document.SaveAs(oFolder & oFileName & ".ipt", False)
iLogicVb.UpdateWhenDone = True
Hi,
Did you try commenting lines to identify where the error occurs?
My best guess is that you're using illegal characters in the filename.
Can't find what you're looking for? Ask the community or share your knowledge.