Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
PLANE_OFFSET_BOUNDS
papawo
Member, Developers Posts: 206 PRO
Best Answer
-
You can replicate the loop
for (var selection in definition.selFace )within the body of the function. Then selection.myLength will be length value as you need it,
or you can doif (size(<span>definition.selFace) > 0)<br>{<br>... </span>definition.selFace[0].myLength ..<span><br>}</span>If you are only interested in the first element.
6
Answers
-
Whatever you're passing in as 'offset' is not a length between 0 and 500 meters:

It may also be that what you're passing in is not a length, or that you're not passing in an 'offset' at all. Screenshotting more of the call stack, or the line that the error is complaining on may be more useful for debugging.Jake Rosenfeld - Modeling Team0 -
This probably comes from a call to cPlane either without specifying offset, or giving it a value, which is not a length.
You can try using something like "offset" : 0.01 * meter0 -
cPlane(context, id + i + "cPlane1", {"entities" : qUnion([ planeOffset]),"cplaneType" : CPlaneType.OFFSET,"offset" : definition.myLength, //----------sorry my mistake , definition.myLength doesnt exist
"offset" : selection.myLength //<<<<<it should be this. but it doesnt work . selection.myLength is inside an array in the precondition
});
if I use-----> "offset" : 0.01 * meter , it does work, but I need to get the length from the precondition0 -
Could you post the part of your precondition where selection is defined?Jake Rosenfeld - Modeling Team0
-
please try putting
println("myLength" ~ selection.myLength);before this call.
May be it should bedefinition.<arrayParameterName>.[0].selection.myLength
? Not sure what you meant by "selection.myLength is inside an array in the precondition"0 -
it says variable selection not found0
-
if (definition.faceToMove){annotation { "Name" : "Select Face ","Item name" : "Face","Driven query" : "entities","Item label template" : "#entities - ( #myLength )" }definition.selFace is array;for (var selection in definition.selFace ){annotation { "Name" : "Select Face To Offset","Filter" : ModifiableEntityOnly.YES && ((EntityType.FACE && ConstructionObject.NO) || (EntityType.BODY && BodyType.SOLID)),"UIHint" : "ALWAYS_HIDDEN" }selection.entities is Query;annotation { "Name" : "Offset Length" }isLength( selection.myLength, PLANE_OFFSET_BOUNDS); //how to access this?}}0
-
You can replicate the loop
for (var selection in definition.selFace )within the body of the function. Then selection.myLength will be length value as you need it,
or you can doif (size(<span>definition.selFace) > 0)<br>{<br>... </span>definition.selFace[0].myLength ..<span><br>}</span>If you are only interested in the first element.
6


