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.

Part/Body Type Property

phares_blankphares_blank Member Posts: 14 ✭✭
Forgive my ignorance, this is the first time I have played with featurescript.

Essentially, this is what I am trying to do:

if bodyType = sheetMetal then setProperty description "sheet metal"

From reading the documentation I was able to set the description but I cannot figure out how to filter only sheet metal parts. 
OnShape seems to know if a part is sheet metal or not, I just need to know where that property is stored. Is there something like BodyType but for Sheet Metal, Frames, etc?

Best Answers

  • phares_blankphares_blank Member Posts: 14 ✭✭
    Answer ✓
    Thanks to Alex's FeatureScript Examples I was able to figure this out using ActiveSheetMetal.YES


    I would also like to set the VENDOR property but it doesn't seem to work. Please take a look, I would love some criticism of my code.

  • Caden_ArmstrongCaden_Armstrong Member Posts: 177 PRO
    Answer ✓
    Just note that ActiveSheetMetal will only work for active models. Once the finish sheet metal feature is added to the tree, it will no longer work.

    Another way to check is seeing if there is a flat pattern for the body.

    isQueryEmpty(context, qCorrespondingInFlat(mySheetMetalBody))
    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications

Answers

  • phares_blankphares_blank Member Posts: 14 ✭✭
    Answer ✓
    Thanks to Alex's FeatureScript Examples I was able to figure this out using ActiveSheetMetal.YES


    I would also like to set the VENDOR property but it doesn't seem to work. Please take a look, I would love some criticism of my code.

  • Caden_ArmstrongCaden_Armstrong Member Posts: 177 PRO
    Answer ✓
    Just note that ActiveSheetMetal will only work for active models. Once the finish sheet metal feature is added to the tree, it will no longer work.

    Another way to check is seeing if there is a flat pattern for the body.

    isQueryEmpty(context, qCorrespondingInFlat(mySheetMetalBody))
    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications
Sign In or Register to comment.