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.

API call that includes info on if a part is sheet metal or not

shawn_crockershawn_crocker Member, OS Professional Posts: 865 PRO
I have tried using the body details end point and metadata but I am not seeing anything in those that I can use to definitively gate a yes or no if it is sheet metal.  Anyone know if there is a way to do this without relying on putting information into part properties?
Tagged:

Best Answer

  • Caden_ArmstrongCaden_Armstrong Member Posts: 164 PRO
    Answer ✓
    You can do it with the /parts/d/{did}/{wvm}/wvmid} endpoint with the url param for includeFlatParts=true

    Flat parts will be "isFlattenedBody" set to true.
    They will also have a property "unflattenedPartId" which corresponds to the part id for the folded part.
    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications

Answers

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,210
    You can use
    /partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/featurescript
    and in the FS evaluate qActiveSheetMetalFilter with the parts in question.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • shawn_crockershawn_crocker Member, OS Professional Posts: 865 PRO
    Thanks @ilya_baran.  This look's like the same data that comes from the parts endpoint but for everything in the part studio.  I'm not seeing anything there that indicates is a part is sheet metal or not.  Do you know what property I should be looking for?
  • Caden_ArmstrongCaden_Armstrong Member Posts: 164 PRO
    Answer ✓
    You can do it with the /parts/d/{did}/{wvm}/wvmid} endpoint with the url param for includeFlatParts=true

    Flat parts will be "isFlattenedBody" set to true.
    They will also have a property "unflattenedPartId" which corresponds to the part id for the folded part.
    www.smartbenchsoftware.com --- fs.place --- Renaissance
    Custom FeatureScript and Onshape Integrated Applications
  • shawn_crockershawn_crocker Member, OS Professional Posts: 865 PRO
    @caden_armstrong
    Ah yes. Thanks.  That will give enough info for a solid if statment.
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,210
    Caden's approach is probably simpler, and doesn't require FS knowledge.  The featurescript data is definitely not the same as for the parts endpoint, since it's the result of executing an arbitrary FS (which can determine which parts are sheet metal and which are not).
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
Sign In or Register to comment.