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.

Setting / sharing variable studio variables

graham_lockgraham_lock Member Posts: 160 PRO

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

  • MichaelPascoeMichaelPascoe Member Posts: 2,012 PRO
    Answer ✓

    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 🔴

Answers

  • MichaelPascoeMichaelPascoe Member Posts: 2,012 PRO
    Answer ✓

    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 🔴
  • graham_lockgraham_lock Member Posts: 160 PRO

    Thank you.

Sign In or Register to comment.