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.
Difficulty with defining a volume parameter
Matthew_Wilson
Member, csevp Posts: 5 PRO
I'm writing a feature that takes a volume measurement from the user. I'm running into trouble with the isVolume predicate:
FeatureScript 1821; import(path : "onshape/std/geometry.fs", version : "1821.0"); annotation { "Feature Type Name" : "My Feature" } export const myFeature = defineFeature(function(context is Context, id is Id, definition is map) precondition { // Define the parameters of the feature type annotation { "Name" : "My Volume" } isVolume(definition.myVolume, VOLUME_BOUNDS); } { // Define the function's action });
The volume definition throws the warning: "Expected parameter id to be defined as a field on val" I have zero idea what that means. I don't think that I'm using it wrong, it's documented here: https://cad.onshape.com/FsDoc/library.html#isVolume--VolumeBoundSpec This is just the same as a Length definition, what am I missing?
0
Comments
If you want to input a volume, two possible workarounds are:
I was confused because the docs seem to indicate that you can use isVolume in this way. Maybe we can get an improvement request to add a volume parameter to the UI? ;-)