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.

Configurations update: Edit FeatureScript IDs

kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
In addition to the other new features already mentioned, Onshape 1.78 added a piece of functionality specifically for the purpose of writing FeatureScript that builds configured Part Studios.

As you may already know, the user-facing names of configuration inputs and the user-facing names of configuration table rows can be edited at any time:


The above changes will only modify how the input is displayed. So, if another assembly, drawing, etc. refers a configuration of this part studio, changing these names will not break the reference in the other tab. Rather, the other tab will simply display the same configuration with a different name. The reason the above changes don't break references is that there is another, internal name for the configuration inputs and rows which is used inside of FeatureScript.

However, if you are writing a custom feature which builds a configured Part Studio, you will be directly using that underlying FeatureScript ID. Thus, it can be useful to change these IDs in order to make your custom features more readable, or to make the multiple part studios have matching FeatureScript IDs, or to follow some standard convention.

These changes can be made in a the new "Edit FeatureScript IDs" dialog:


TL;DR:
1) If you are not writing custom features, you should not need to edit these internal FeatureScript IDs
2) If you are writing custom features that build configured Part Studios, this dialog is how you can view and edit these FeatureScript IDs
3) When editing FeatureScript IDs, be aware that doing so will break the configurations of other existing tabs which reference the Part Studio you're changing

Happy FeatureScripting!

Comments

  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    @kevin_o_toole_1

    Could you share the document please?
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Very nice, thanks folks :+1:

    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    @mbartlett21

    Here's a link to the public doc:
    https://cad.onshape.com/documents/d20ccf19a456f7079668526e/w/5e019db2362144468deed711/e/d613ad7a11057ff5816480f8

    It's a very, very simple example which uses the instantiator FS, which is now part of the standard library.

  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Am liking using this a lot, thanks @kevin_o_toole_1 for the video above.

    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Howdy folks. 
    Would somebody be kind enough to play along with today's episode of "Tell Owen how he's managed to screw up a simple looking task again"?

    Is it possible to use a configuration parameter in a precondition when a partstudio has been imported and has been given a namespace?

    I have the following that works fine:-
    export import(path : "1d64c502eaffadda57d5e6b9/7f97fb208aacaad96eaeb9ea/6284bf15a27a033895323636", version : "44be8c03c44b3b0a527762dc");<br>        <br>//Later in precondition<br>      annotation { "Name" : "Part", "UIHint" : "SHOW_LABEL" }<br>      definition.MagnetSelectedPlain is MagnetChoice_conf;<br><br>//Later again <br>...instantiate configured part<br>
    Hey-presto configured parts appear.  Excellent. :+1:

    However if I try something like this:-
    export PlainMagnets::import(path : "1d64c502eaffadda57d5e6b9/7f97fb208aacaad96eaeb9ea/6284bf15a27a033895323636", version : "44be8c03c44b3b0a527762dc");<br><br>//Later in precondition<br>          annotation { "Name" : "Part", "UIHint" : "SHOW_LABEL" }          <br>          definition.MagnetSelectedPlain is PlainMagnets::MagnetChoice_conf;          
    FS tells me I "can't use an enum in a namespace".

    If I don't use  namespaces and import multiple partstudios then that's bad too. (Multiple declarations for build.)

    Have I just screwed up the syntax for referencing a namespace or am I trying to do something that can't be done?
    Cheers,
    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Nope, you're not missing anything. See my response to the same question here:
    https://forum.onshape.com/discussion/comment/50472#Comment_50472
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    @kevin_o_toole_1 thanks for the quick reply and link. I'd missed that post, not sure how. Tomorrow I'll make it work. Cheers Owen.
    Business Systems and Configuration Controller
    HWM-Water Ltd
Sign In or Register to comment.