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.

variable in part properties

Bernhard_HirtBernhard_Hirt Member Posts: 2 PRO

Hi,

is there any way to get the variable in the part configuration without typing it in manually?

I know that I could do a list configuration with fixed lenghts and then I can configure the properties for every item in the list. But I would like to this automaticaly.

In this case I want to have the length of different wiring ducts in the comments.

grafik.png

thanks.

Comments

  • Kevin_CowlesKevin_Cowles Member, Onshape Employees Posts: 43

    With a configuration variable, you'll need to use a Custom Feature to assign the Property with an expression.

    See the Part Name custom feature, call this, chose expression, and insert the variable. May need to do some rounding/scaling to deal with the default unit conversions, but you can easily tag the variable in the Part name or number!

    https://bedfordstatics.onshape.com/documents/cff5249641e260dddc6588dc/w/f11992258668fd8ed8744408/e/0fe4c3e97c01eb56d1722272 - link share to example

  • MichaelPascoeMichaelPascoe Member Posts: 2,536 PRO

    .

    I'll echo what Kevin said.

    Within a feature, you can turn most inputs into an expression by right clicking it → convert to expression. This will let you use variables and equations in that input, it will even let you use inline FeatureScript. For example if you had name variables: #prefix ~ "_" ~ #size ~ "_Config"

    image.png

    Evan's Part Name feature is good. However, if you want to be able to set any property, not just the name,
    you could use the Property Attribute thumbnail.png Property / Attribute feature.

    If you want to quickly turn lengths into a readable format for part names or descriptions, then I recommend the Variable to string thumbnail.png Variable to String feature.

    .


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
Sign In or Register to comment.