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.

Trying to figure out how to attach custom attributes to the sheet metal master model

shawn_crockershawn_crocker Member, OS Professional Posts: 861 PRO
When you attach attributes to a sheet metal part in featureScript, the attributes are lost anytime the sheet metal part is modified downstream in the feature tree.  This is because the geometry of the part is completely recreated in the studio.  I am struggling to find away to attach attributes without them being wiped.  My first though is that I could attach them directly to the underlying master sheet model.  I cannot seem to figure out how to get that working at this time.  My other thought is that there is some way to have the attribute reapplied to the part.  Anyone ever done this or know how to?

Best Answer

  • caden_armstrong2caden_armstrong2 Member, User Group Leader Posts: 127 ✭✭✭
    Answer ✓
    I'm not sure about attaching to sheet metal models,
    but in a worst case scenario, you can attach attributes to the origin, and pick it up later to reapply.

            var originEntity = { "queryType" : QueryType.TRANSIENT, "transientId" : "IB" } as Query;

            setAttribute(context, {
                        "entities" : originEntity,
                        "name" : "myName",
                        "attribute" : "myValue"
                    });

Answers

  • caden_armstrong2caden_armstrong2 Member, User Group Leader Posts: 127 ✭✭✭
    Answer ✓
    I'm not sure about attaching to sheet metal models,
    but in a worst case scenario, you can attach attributes to the origin, and pick it up later to reapply.

            var originEntity = { "queryType" : QueryType.TRANSIENT, "transientId" : "IB" } as Query;

            setAttribute(context, {
                        "entities" : originEntity,
                        "name" : "myName",
                        "attribute" : "myValue"
                    });
  • shawn_crockershawn_crocker Member, OS Professional Posts: 861 PRO
    @caden_armstrong
    Thanks.  That is a good workaround.  I will give them the same name as the id of the system set sheet metal attributes.  Then I can set many different sheet metal part parameters to the origin and pick out the one to match up with the correct part later on.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,651
    Or qOrigin even. 
    Senior Director, Technical Services, EMEAI
Sign In or Register to comment.