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.
Finding FeatureScript documentation resources?
ken_kaiser
Member Posts: 6 ✭
Hi! I'm new here and I found the FeatureScript documentation at https://cad.onshape.com/FsDoc/index.html
I am now looking to apply a Circular Pattern: it is a documented feature but there is no map definition documented for that feature.
https://cad.onshape.com/FsDoc/library.html#module-circularPattern.fs
Looking into the onshape/std/circularPattern.fs doesn't give me many hints.
I was able to find examples of most, if there is any way to search for an example that uses that specific feature, I'll be able to figure it out.
Where are other places to find documentation? Thanks
I am now looking to apply a Circular Pattern: it is a documented feature but there is no map definition documented for that feature.
https://cad.onshape.com/FsDoc/library.html#module-circularPattern.fs
Looking into the onshape/std/circularPattern.fs doesn't give me many hints.
I was able to find examples of most, if there is any way to search for an example that uses that specific feature, I'll be able to figure it out.
Where are other places to find documentation? Thanks
0
Best Answer
-
Jake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646Hi Ken!
Glad you're interested in FeatureScript programming. Usually we provide documentation for the underlying operation (opSweep, opFillet, opDraft) rather than the Onshape feature itself (see the geomOperations section of the documentation). This is because the features themselves take a more complicated set of inputs corresponding to the options in the feature dialog and end up just mapping them to the underlying operation anyway.
In the case of opPattern, we recently realized that forming a custom set of coordinate systems just to pattern something in FeatureScript is a little obtuse to force on the end user, so linear, circular, and curve pattern documentation is coming soon. In the meantime I hope these screenshots of the upcoming circularPattern documentation can help you.p.s. the precondition of any Onshape feature is the best place to look for the required inputs in the definition.
Jake Rosenfeld - Modeling Team6
Answers
Glad you're interested in FeatureScript programming. Usually we provide documentation for the underlying operation (opSweep, opFillet, opDraft) rather than the Onshape feature itself (see the geomOperations section of the documentation). This is because the features themselves take a more complicated set of inputs corresponding to the options in the feature dialog and end up just mapping them to the underlying operation anyway.
In the case of opPattern, we recently realized that forming a custom set of coordinate systems just to pattern something in FeatureScript is a little obtuse to force on the end user, so linear, circular, and curve pattern documentation is coming soon. In the meantime I hope these screenshots of the upcoming circularPattern documentation can help you.
p.s. the precondition of any Onshape feature is the best place to look for the required inputs in the definition.
I don't need to tell you but being able to create a custom UI of tools that you use, that are written in FeatureScript changes everything. A huge undertaking but having examples of every FS function would open it up to people who just copy-paste with slight modification.
Debug is useful when something doesn't work, when you select the function in the Part Studio it highlights the part in red and showing FeatureScript notices the {?} icon, it says what it resolved to. e.g.
debug(context, qCreatedBy(id + "partToPattern", EntityType.BODY));
// I used it to copy equally spaced circles around a cylinder
Thanks for the feedback, I'll look into making the axis documentation a little better. The ALLOW_AXIS query filter is somewhat strange; theoretically we want to end up with a mathematical representation of some axis to pattern around, but because this is a feature (rather than an operation) we want to let a user click on some geometry (a Query) that can be turned into an math-axis internally. To facilitate this, definition.axis will take any linear edge, circular edge, or cylindrical face as an "axis". The is one of the problems I mentioned earlier with calling Onshape features (rather than lower level operations) in FeatureScript. Often the inputs are a little unintuitive because they correspond to what goes into the feature dialog rather than the pure mathematical object that is needed (as another example some features will not accept negative valued inputs, but rather always take a positive value and determine the sign with a definition.oppositeDirection variable).
Sorry this help came after you solved your own issue. Hopefully it can help Onshapers of the future!