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.
Welcome to Feature Script - Modify to fSphere
bruce_williams
Member, Developers Posts: 842 EDU
I am playing with Cody's simple intro of 90 second FS to make cylinder. No problem with fCylinder and fCuboid.
When I try fSphere I get error -- Precondition failed (isLength(definition.radius, NONNEGATIVE_LENGTH_BOUNDS))
Here is the code -
When I try fSphere I get error -- Precondition failed (isLength(definition.radius, NONNEGATIVE_LENGTH_BOUNDS))
Here is the code -
FeatureScript 477;
import(path : "onshape/std/geometry.fs", version : "477.0");
annotation { "Feature Type Name" : "My Feature" }
export const myFeature = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "My Length" }
isLength(definition.myLength, LENGTH_BOUNDS);
// Define the parameters of the feature type
}
{
fSphere(context, id, definition.myLength);
});
What is the fSphere needing to work?
What is the fSphere needing to work?
www.accuratepattern.com
0
Best Answer
-
William_Barron Member Posts: 5 ✭Actually, it would be more correct to use NONNEGATIVE_LENGTH_BOUNDS instead of LENGTH_BOUNDS.
5
Answers
annotation { "Feature Type Name" : "My Feature" }
export const myFeature = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "Radius" }
isLength(definition.radius, LENGTH_BOUNDS);
// Define the parameters of the feature type
}
{
fSphere(context, id, definition);
});
I have a LONG ways to go.... Folks like you that help out on the forum make it feel even more possible to learn FS.