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

Why do attributes not come through when instantiating?

sam_parsonssam_parsons Member Posts: 43 PRO
When instantiating part studio reference parameters, I'm able to get the attributes to come through if I use the legacy setAttribute(), but with the new setAttribute(), where you can specify a name, it doesn't seem to work?

Thanks in advance!

Answers

  • Options
    kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    edited February 2021
    Hi Sam,

    This issue with named attributes is fixed in the latest standard library version. In the Feature Studio using std's instantiator, you can increase the FeatureScript version and std import version to the latest (1447) to get the fixed behavior with named attributes coming through:

    FeatureScript 1447;
    import(path : "onshape/std/geometry.fs", version : "1447.0");
  • Options
    sam_parsonssam_parsons Member Posts: 43 PRO
    Hi Kevin,

    Thanks for the response. Unfortunately, I've been working on version 1447... ?
  • Options
    kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
  • Options
    sam_parsonssam_parsons Member Posts: 43 PRO
    Thanks Kevin, I've shared it with Support now.

    I can't seem to access the link you sent:
    "Failed to load document for workspace. Resource does not exist, or you do not have permission to access it."
  • Options
    brooke_spreenbrooke_spreen Member, Developers Posts: 115 ✭✭✭
    Thanks for sorting this out! It's a big help :)
    Design Engineer | Anerdgy AG
  • Options
    George_AndersonGeorge_Anderson Member Posts: 71 ✭✭
    In case it helps anyone else, I ran into a similar issue in 1483, but solved it.

    I have a configured part studio that itself calls a featurescript (I use it to cache similar, computed parts). I added code to store a (new-style) attribute with the generated part. When passing through the configured part studio, I would lose the attributes, but if I bypassed the configured part studio and directly called the function without caching, I would get the attributes.

    It was 100% repeatable until I opened the offending part studio tab, and then instantly the problem was fixed. I never open that tab, because it's empty -- just a pass-through for caching. My guess is that changing the feature or code that it calls doesn't register as changed in that tab until opening it.
Sign In or Register to comment.