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.
Setting / sharing variable studio variables
Hi,
As I understand it, setVariable sets variables in the context which is fine if the variables are only required to be shared between features within the current document, but is it possible to create / update variable studio variables in FS to share across multiple documents?
Thank you.
Best Answer
-
MichaelPascoe Member Posts: 2,012 PRO
Standard part studio variables can't be shared directly across documents. You would need to use the variable studio for this. The problem with the variable studio is that you can't access it from FS or measure values to it.
You can store the variables as an attribute within a part, derive that part to another document, then retrieve the variable from the attribute of the part. Alex made a great feature for this called: Variable Library
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴0
Answers
Standard part studio variables can't be shared directly across documents. You would need to use the variable studio for this. The problem with the variable studio is that you can't access it from FS or measure values to it.
You can store the variables as an attribute within a part, derive that part to another document, then retrieve the variable from the attribute of the part. Alex made a great feature for this called: Variable Library
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Thank you.