Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ilogic assembly part creation error

1 REPLY 1
Reply
Message 1 of 2
Anonymous
188 Views, 1 Reply

Ilogic assembly part creation error

 

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

 

Labels (1)
1 REPLY 1
Message 2 of 2
j.haggenjos
in reply to: Anonymous

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.

Post to forums  

Autodesk Design & Make Report