michaelk Posted July 12, 2021 Share Posted July 12, 2021 I'm getting this error message in unexpected places. Including functions with no operands. For example in a solid subtraction: tempHandle1 := LObject; tempHandle := PrevObj(tempHandle1); result := IntersectSolid(tempHandle, tempHandle1, tempHandle2); ResetOrientation3D; Rotate3D(#0.0000000000000d,#-0.0000000000000d,#0.0000000000000d); Move3D(0",0",0"); I'm getting that error on the line ResetOrientation3D; I've experienced a lot of error messages 🙂 and so I'm aware that the error is often in a nearby line, but I don't see where. All the tempHandles are defined as handle variables. Also here: … tempHandle1 := LObject; tempHandle := PrevObj(tempHandle1); result := SubtractSolid(tempHandle, tempHandle1, tempHandle2); BeginXtrd(0",0.05"); RectangleN(-0.656",0.341641697326893",0.039370078740157",0",1.312",0.054089086164082"); NoShadows(LNewObj); objectHandle := LNewObj; SetObjectVariableBoolean(objectHandle, 1160, FALSE); boolResult := SetEntityMatrix(objectHandle, 0",0",0",0,-0,0); EndXtrd; ResetOrientation3D; Rotate3D(#0.0000000000000d,#-0.0000000000000d,#0.0000000000000d); Move3D(0",0",0.248855109792259"); BeginXtrd(0",0.05"); gets the same error message. As is my wont, I copied all this from a script export 🙂, which makes the error message even more puzzling. Anybody know what's going on here? Quote Link to comment
Pat Stanford Posted July 12, 2021 Share Posted July 12, 2021 Make sure all of your tempHandle objects are defined as handles. In your second example you are storing objects into tempHandles, but you are using a variable names objectHandle. Double check you variable definitions. Quote Link to comment
michaelk Posted July 12, 2021 Author Share Posted July 12, 2021 First thing I checked! All tempHandle, tempHandle1, tempHandle2, objectHandle all defined as : Handle. If they weren't wouldn't I get an { Error: Identifier not identified } ? Quote Link to comment
michaelk Posted July 12, 2021 Author Share Posted July 12, 2021 Here's an interesting thing. I opened a new file, copied and pasted the object creation part of the script into a new script (the previous example was for a plug in object) and got the same errors. But if I import the entire script it runs fine. Script attached. VOS.txt Quote Link to comment
Pat Stanford Posted July 12, 2021 Share Posted July 12, 2021 Are you using the built in editor? If so, is the project type set to Python instead of Vectorscript? Quote Link to comment
michaelk Posted July 12, 2021 Author Share Posted July 12, 2021 Tried both built in editor and include to BBEdit .vs file. Always set to VS🤓 Quote Link to comment
Pat Stanford Posted July 12, 2021 Share Posted July 12, 2021 Send me the object creation portion only and I will try here. Quote Link to comment
michaelk Posted July 13, 2021 Author Share Posted July 13, 2021 Sorry for the delay. Time zone weirdness :-). I added a procedure, run, begin, end and VAR declarations. PROCEDURE TEST; VAR objectHandle,tempHandle, tempHandle1, tempHandle2 : HANDLE; boolResult, result : BOOLEAN; BEGIN NameClass('None'); BeginXtrd(0",0.3"); PenSize(2); PenPatN(2); FillPat(1); PenFore(0,0,0); PenBack(65535,65535,65535); FillFore(0,0,0); FillBack(65535,65535,65535); RRectangleN(-0.656",-1.294",0.039370078740157",0",1.312",2.588",0.2",0.2"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); objectHandle := LNewObj; SetObjectVariableBoolean(objectHandle, 1160, FALSE); boolResult := SetEntityMatrix(objectHandle, 0",0",0",0,-0,0); EndXtrd; ResetOrientation3D; Rotate3D(#0.0000000000000d,#-0.0000000000000d,#0.0000000000000d); Move3D(0",0",0"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); BeginXtrd(-0.656",0.675744405755057"); OvalN(-4.704541031598826",-1.874808580246114",0.039370078740157",0",1'1.579999999999998",2.1725"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); objectHandle := LNewObj; SetObjectVariableBoolean(objectHandle, 1160, FALSE); boolResult := SetEntityMatrix(objectHandle, 0",0",0",0,-0,0); EndXtrd; ResetOrientation3D; Rotate3D(#90.00000000000d,#-0.0000000000000d,#90.00000000000d); Move3D(0",0",0"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); tempHandle1 := LObject; tempHandle := PrevObj(tempHandle1); result := IntersectSolid(tempHandle, tempHandle1, tempHandle2); ResetOrientation3D; Rotate3D(#0.0000000000000d,#-0.0000000000000d,#0.0000000000000d); Move3D(0",0",0"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); BeginXtrd(0",0.05"); RectangleN(-0.504",0.468",0.039370078740157",0",1.008",0.65"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); objectHandle := LNewObj; SetObjectVariableBoolean(objectHandle, 1160, FALSE); boolResult := SetEntityMatrix(objectHandle, 0",0",0",0,-0,0); EndXtrd; ResetOrientation3D; Rotate3D(#0.0000000000000d,#-0.0000000000000d,#0.0000000000000d); Move3D(0",0",0.25"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); tempHandle1 := LObject; tempHandle := PrevObj(tempHandle1); result := SubtractSolid(tempHandle, tempHandle1, tempHandle2); BeginXtrd(0",0.05"); RectangleN(-0.656",0.341641697326893",0.039370078740157",0",1.312",0.054089086164082"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); objectHandle := LNewObj; SetObjectVariableBoolean(objectHandle, 1160, FALSE); boolResult := SetEntityMatrix(objectHandle, 0",0",0",0,-0,0); EndXtrd; ResetOrientation3D; Rotate3D(#0.0000000000000d,#-0.0000000000000d,#0.0000000000000d); Move3D(0",0",0.248855109792259"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); tempHandle1 := LObject; tempHandle := PrevObj(tempHandle1); result := SubtractSolid(tempHandle, tempHandle1, tempHandle2); BeginXtrd(0",0.05"); RectangleN(-0.656",0.341641697326893",0.039370078740157",0",1.312",0.054089086164082"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); objectHandle := LNewObj; SetObjectVariableBoolean(objectHandle, 1160, FALSE); boolResult := SetEntityMatrix(objectHandle, 0",0",0",0,-0,0); EndXtrd; ResetOrientation3D; Rotate3D(#0.0000000000000d,#-0.0000000000000d,#0.0000000000000d); Move3D(0",-0.661641697326893",0.210077178945487"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); tempHandle1 := LObject; tempHandle := PrevObj(tempHandle1); result := SubtractSolid(tempHandle, tempHandle1, tempHandle2); ResetOrientation3D; Rotate3D(#90.00000000000d,#-0.0000000000000d,#180.0000000000d); Move3D(0",0",0"); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.003937,0.001969,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); END; RUN(TEST); Quote Link to comment
Pat Stanford Posted July 13, 2021 Share Posted July 13, 2021 result should have a variable type of Integer instead of Boolean. The IntersectSolids and SubtractSolids return an Integer. Also, there seems to be a lot of extra junk. Why are you applying DropShadows before you extrude? Isn't Drop Shadow a 2D only thing? Also, there are a couple of places where it looks like the LNewObj is being used twice in a row. 1 Quote Link to comment
michaelk Posted July 13, 2021 Author Share Posted July 13, 2021 That would explain it!! I forgot that subtract and intersect solids return integers and not Booleans. This is just the raw export. I clean up the code for my plug in. Thanks Pat! Quote Link to comment
Pat Stanford Posted July 13, 2021 Share Posted July 13, 2021 Maybe an enhancement request to have the Function Reference use bResult, iResult, hResult, etc. for Function return definitions. Using Result for everything can be confusing. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.