Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Why do attributes not come through when instantiating?
sam_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!
Thanks in advance!
Tagged:
0
Answers
-
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");
0 -
Hi Kevin,
Thanks for the response. Unfortunately, I've been working on version 1447... ?
0 -
Can you link to the document? Here's a working example:
https://cad.onshape.com/documents/6bf7d2234651c58fd03819fd/w/94b564b1cc6a93b376e5e72a/e/ddf3cc2d2a6eba01f8191ea0
0 -
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."0 -
Thanks for sorting this out! It's a big help
Design Engineer | Anerdgy AG0 -
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.1



