iLogic Error Message: The parameter is incorrect

iLogic Error Message: The parameter is incorrect

Anonymous
Not applicable
2,539 Views
5 Replies
Message 1 of 6

iLogic Error Message: The parameter is incorrect

Anonymous
Not applicable

Previous employee set up iLogic rules to create orthographic views of a drawing. I'm not very familiar with iLogic rules so any help would be greatly appreciated!

 

iLogic Error.PNG

 

fPath = ThisDoc.Path &"\" & iProperties.Value("Custom", "Activity_ID") & ".ipt"
'MsgBox(fpath)
Dim oPartDoc As Document
Dim oDrawDoc As DrawingDocument
Dim oSheet As Sheet
Dim oTG As TransientGeometry

Dim oBaseView As DrawingView

'oPartDoc = Document(fPath)
'oPartDoc = ThisApplication.Documents.Open(fpath, False)

oPartDoc = ThisApplication.Documents.Open(fpath,False)
'oPartDoc.Close
'MsgBox("spot1")

oDrawDoc = ThisApplication.ActiveDocument 
'MsgBox("spot2")

oSheet = oDrawDoc.Sheets.Item(1)
'MsgBox("spot3")

oTG = ThisApplication.TransientGeometry
'MsgBox("spot4")

oPoint1 = oTG.CreatePoint2d(oSheet.Width*.75,oSheet.Height*.70)
oPoint2 = oTG.CreatePoint2d(oSheet.Width*.75,oSheet.Height*.40)
oPoint3 = oTG.CreatePoint2d(oSheet.Width*.25,oSheet.Height*.40)
oPoint4 = oTG.CreatePoint2d(oSheet.Width*.25,oSheet.Height*.70)
'MsgBox("spot5")

'oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint1, .005, ViewOrientationTypeEnum.kFrontViewOrientation, DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle, "Default")
oIsoView = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint1, 1/iProperties.Value("Custom", "DWGScale"), ViewOrientationTypeEnum.kIsoTopRightViewOrientation,DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle)
oIsoView.ShowLabel = False
oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint4,1/iProperties.Value("Custom", "DWGScale"), ViewOrientationTypeEnum.kTopViewOrientation,DrawingViewStyleEnum.kHiddenLineDrawingViewStyle)
If oBaseView.Height > oBaseView.Width Then
    oBaseView.RotateByAngle(PI/2)
End If

oBaseView.ShowLabel = True
oBaseView.Label.Position = oPoint2
iLogicVb.RunRule("View Label Update")

oProjView = oSheet.DrawingViews.AddProjectedView(oBaseView, oPoint3, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle,1/iProperties.Value("Custom", "DWGScale"))
oProjView.ShowLabel = False


iProperties.Value("Custom", "DWGScale") = InputBox("Enter a new drawing scale for all views: 1/SCALE", "Create View",iProperties.Value("Custom", "DWGScale") )
'MsgBox("spot1")
If iProperties.Value("Custom", "DWGScale") = "" Then 'check for empty string
    'MsgBox("spot2")
    Else If iProperties.Value("Custom", "DWGScale") <> vbOK Then 'check if OK button was clicked
    oIsoView.Scale = 1/iProperties.Value("Custom", "DWGScale")
    oBaseView.Scale = 1/iProperties.Value("Custom", "DWGScale")
    oPoint1 = oTG.CreatePoint2d(oSheet.Width*.75,oSheet.Height*.70)
    oPoint2 = oTG.CreatePoint2d(oSheet.Width*.75,oSheet.Height*.40)
    oPoint3 = oTG.CreatePoint2d(oSheet.Width*.25,oSheet.Height*.40)
    oPoint4 = oTG.CreatePoint2d(oSheet.Width*.25,oSheet.Height*.70)
    oBaseView.Label.Position = oPoint2
    'Return 'exit rule
Else 
End If
'MsgBox("spot3")
iLogicVb.RunRule("Setup")
0 Likes
Accepted solutions (1)
2,540 Views
5 Replies
Replies (5)
Message 2 of 6

JamieVJohnson2
Collaborator
Collaborator

Parameter is incorrect means this, Inventor acknowledges your command, and declares your input to be gibberish.

How to fix:

1. Find the line in question, with iLogic this can be done by using the Msgbox("anything") command between lines and noting where it does pop up before an error, and when the error pops up before the message box.  This is something the previous developer did, as you see msgbox("spot1") commented out several times.

2. Realize the input for the command on the line. 

Most common errors are where the line requests data supplied by user, and the data is incomplete or incorrect. 

Second most common error is attempting to get an item from a list of 0 items (usually responds index out of range)

If you can find for us the command line in error, we may be able to narrow down the reason.

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
Message 3 of 6

Anonymous
Not applicable

The error seems to be on Line 13

 

oPartDoc = ThisApplication.Documents.Open(fpath,False)

 

0 Likes
Message 4 of 6

JamieVJohnson2
Collaborator
Collaborator

do a msgbox(fpath) just before that line, and verify the text being constructed for the file path is correct.

Also you probably can't open a file that is already open, check for that too.

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 5 of 6

Anonymous
Not applicable

I guess the text for the file path was incorrect since I get the following error codes:

iLogic Error 4.PNGiLogic Error.PNG

I did find out that I have to have the .ipt file saved in the path file for the drawing to be created (I'm trying to create orthographic views of a part that I derived from an assembly using another iLogic rule - it was supposed to save the .ipt file in the path file but I guess it didnt...) 

 

0 Likes
Message 6 of 6

JamieVJohnson2
Collaborator
Collaborator
Accepted solution

yea change the code save the part file, keep the reference to the newly saved part file, then just use its fullfilename property.

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes