Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

Options

Hey FeatureScripters - What would you like to see in an advanced FeatureScript tutorial?

jnewth_onshapejnewth_onshape Member, Onshape Employees Posts: 60
Hey everyone, I'm Josh, one of the Part Studio developers. Recently I decided the community could use a more advanced tutorial to cover some of the trickier topics in FeatureScript: Queries, ids, transient ids, robust queries, tracking queries, etc. We could also cover common problems, gotchas, tips n' tricks, that sort of thing.

I thought I'd ask the community:

What specific obstacles do you need some help with? What specific topics would you like addressed (things like queries and ids)?
What problems have you encountered?
What do you find confusing about FeatureScript? 
(And anything else that's on your mind about FS)

Post your comments below! I can't guarantee I'll be able to answer them in this forum but I'll try to work as many of the issues in to the tutorial as possible.

Answers

  • Options
    Konst_ShKonst_Sh Member Posts: 42 PRO
    edited February 27
    Queries and id's are definitely the top priority, besides it the transforms and patterns were the most interesting for me in the beginning.
    Edit:
    Instantiators - today is the day of forum questions that are solved best with them.
  • Options
    S1monS1mon Member Posts: 2,388 PRO
    edited February 27
    I've dabbled in some FS coding, and built a few useful custom FS, but honestly the mental effort to convert what I would do in CAD to how FS works is a little daunting. For a long time I've thought that it would be useful to build a detailed plastic boss for thread-forming screws custom FS which would follow the some of the design guidelines below. @NeilCooke did a really basic one a long time ago, but it's missing a bunch of things.

    I'd like to start at sketch points and/or mate connectors, and then extrude up to a part, and optionally have the core pin go into the the existing wall along with a "moat" around the boss to reduce sink. It would also have inputs for metric and inch size screws, as well as plastic material type. The ID and OD multipliers should fill in based on these choices, but should also be able to be filled in as custom values.

    There would also be options for adding a pattern of ribs to the boss. There are so many varieties and options here, that it could be a bit of a rabbit hole or at least whatever choices you make would be good for some and not so much for others.

    Every time I start to look at this, it's a bit more than I can easily do. It involves manipulating parametric sketches, or building a lot of booleans out of extruded/drafted cylinders. I don't quite know where to start.

    Building a really basic version of this would probably not be that hard for me, but making it robust enough to be a production level tool is tricky (e.g. how to generically extract the wall thickness of the part you're attaching the boss to in order to create the appropriate sink reduction features? What if the boss is next to a wall? What if the wall the boss is on has a surface break in it and isn't one continuous surface?).




  • Options
    eldon_browneldon_brown Member Posts: 38 ✭✭
    I would like to see more information on how to provide graphical user feedback on mis-generated features, proper use of the "try" function, and how to leverage other/older Feature Scripts functions within a new Feature Script without rewriting the original as local text.

    --Eldonb
  • Options
    tabetha_bulnestabetha_bulnes Member, Developers, HON-TS Posts: 22 PRO
    I would like to go over best practices for reducing regeneration in FS while maintaining stability. On a similar note, going over UI and how that can affect the regeneration as this is an issue with at least one of my current FS. This would also include the images in the UI. i have had the images before for a length field and the UI drags with them. for the images, this was probably a year ago have not tested recently. 

    How to check for FS stability? Such as when dealing with evEdgeTangentLines where in one case the parameters are reading in one direction but in another case it might read in the reverse direction. 

    understanding the different line types and when to use each and which is most similar to a sketches output. Also FitSplineType.Edge what is happening in the background? in some case before I combine the edges my edge has no inflections and then I use fitSpline and generate multiple inflections. 

    Best practices for documents. I have been told before the reason my document is not updated is because i have both FS and part studios in the same document. Can you give some feedback on how we should be storing our FS? how many tabs can we have? how many lines per tab?

    Any best practices or tricks for using Editing Logic and Manipulators

    Best practices for debugging, profiling, monitoring. 

    How does size of the definition affect the regeneration? I use definition for variables that I want to pull across my FS and sometimes that definition can get pretty large. Do you see this causing any regeneration issues as far as increasing the regen?

    Any suggestions for getting over the "black box" affect where a FS may be used to create a process but if at any point that process fails the whole FS is now unusable to the user in their case? Do you have a suggestion on how to create stopping points in the code so that the user continue with their work without having to recreate the useable portion of the code?

    Best practices for FS that work with sketches (either in the FS or as an import) and dealing with the "Initial state" where a sketch can flip tangencies or locations item elements based on the new value vs the initial state. And how we can check to see if the new value result in an error/change in constraints/shape.

    I am sure I could think of more but I will start with that  :)
  • Options
    tabetha_bulnestabetha_bulnes Member, Developers, HON-TS Posts: 22 PRO
    One more that I had been try to get an answer to for a while  :)

    FeatureScript library versions. If I have a part studio with 10 FS and each FS is calling a different library version, how does this affect the part studio? Should we be pushing out new releases every 3 weeks so that our FS are all calling the latest library or does it not matter because FS still calls a library so whether it is the old or new library there is no difference? 
  • Options
    MichaelPascoeMichaelPascoe Member Posts: 1,724 PRO
    edited March 20

    It would be good to have these in the course:
    Can't remember if any of these are covered in the basic FS course. 
    • Manipulators (All types)
    • Editing logic
    • Attributes
    • Tables
    • Profiling
    • Working with other inputs like: derive, image, csv, etc...
    • Descriptions and description images
    • Function descriptions and how to format them
    • Predicates
    • Feature icon and description
    • Instantiations
    • Best practices for all of the above

    Other things we need:
    • Beginner course for basic programming concepts. Perhaps the current
      course does some of this, but we need one that focuses on coding fundamentals.
    • Examples for everything in the standard documentation. If there is a function, it needs an example code block with it.
    • We need to discuss what happens when the feature owner deletes the original document. Does that remove it from everyone's tool bars?


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • Options
    jelte_steur814jelte_steur814 Member Posts: 78 PRO
    agree with the list of Micheal Pascoe above. maybe in the other order: Start with basic programming concepts.

    also: what is allowed/not allowed in the precondition.
    definately id's, Id's, toplevel Id's etc. this is confusing stuff. 
    switch: i see it used in some other featurescripts but cannot find any info on it. (other than googling how it works in java)

  • Options
    jelte_steur814jelte_steur814 Member Posts: 78 PRO
    + LookUpTables
Sign In or Register to comment.