Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape, CAD, maker project and design.

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.

Names of parts with parameters values inside

Otaola_FrancoOtaola_Franco Member Posts: 6
hello,

is it possible to use a parameter from features or a parameter from a configuration to being use in the name of the part in a way that changes automatically?

for E.G i have #D=5cm that i use to define the length of a circle in a sketch that i extrude with a #H=15cm, i would like that the part is called for example "tube of 5cm of diam and 15cm of high" and that if i change the values of #D and #H their values changes in the name of the part. #D=2cm #H=20cm will result in a part with the name "tube of 2cm of diam and 20cm of high"

also as i think is in the same subject, is it possible to use these parameters in notes or tables in drawings? thanks


Comments

  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 768 ✭✭✭✭
    edited November 22
    I have Property explorer FS for setting properties based on external variables - select the part, then select a property and put in string expression for the property: for example: "tube of "~toString(#D)~"of diam "~"and "~toString(#H)~" of hight". If the whole expression is not convinient to handle in one input field you can add multiple consecutive substrings for the same property, they all will be concatenated in one string in the given order and set to property.
    https://cad.onshape.com/documents/67e94d9f28bea28acfe4cd2f/w/148839604556a1f380541be8/e/6390c076d48caa89151017d9

  • owen_sparksowen_sparks Member, Developers Posts: 1,823 PRO
    Nice work Mr Russian-Hacker-Sir :+1:
    Now if only OS would give us a "get property" method...
    OwS.
    Production Engineer
    HWM-Water Ltd
  • Otaola_FrancoOtaola_Franco Member Posts: 6
    edited November 22
    I have Property explorer FS for setting properties based on external variables - select the part, then select a property and put in string expression for the property: for example: "tube of "~toString(#D)~"of diam "~"and "~toString(#H)~" of hight". If the whole expression is not convinient to handle in one input field you can add multiple consecutive substrings for the same property, they all will be concatenated in one string in the given order and set to property.
    https://cad.onshape.com/documents/67e94d9f28bea28acfe4cd2f/w/148839604556a1f380541be8/e/6390c076d48caa89151017d9

    GOD! one of the best FS i have saw! thanks

    but i had a problem, @[email protected]_shiriazdanov it doesnt modify the name of the part
     
    in the secont entry i put it "toString(#DE)" without the ".
    the part still has the same name SUPPORT BLOCKER


  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 768 ✭✭✭✭
    sadly if you once have edited the name of the part manually you can't change it's name via featurescript anymore. this is how onshape properties work
  • mbartlett21mbartlett21 Member Posts: 1,141 EDU
    See here for what ilya_baran said about it:
    https://forum.onshape.com/discussion/comment/46448#Comment_46448
    MB (I make FeatureScripts: view FS)
  • Otaola_FrancoOtaola_Franco Member Posts: 6
    I have Property explorer FS for setting properties based on external variables - select the part, then select a property and put in string expression for the property: for example: "tube of "~toString(#D)~"of diam "~"and "~toString(#H)~" of hight". If the whole expression is not convinient to handle in one input field you can add multiple consecutive substrings for the same property, they all will be concatenated in one string in the given order and set to property.
    https://cad.onshape.com/documents/67e94d9f28bea28acfe4cd2f/w/148839604556a1f380541be8/e/6390c076d48caa89151017d9

    excuse me, i would like to know if it possible to use configurations too, i had succed to use variables from feature script, but i would like to know if it is possible to use the name of a list imput (from a list, like the name)

    thanks :)
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 768 ✭✭✭✭
    I'm not quite understand, but if you need to use this FS in configured part studio, as I remember you can't configure list input parameters itself, but you can configure variable features, which are referenced by the FS.
  • Otaola_FrancoOtaola_Franco Member Posts: 6
    I'm not quite understand, but if you need to use this FS in configured part studio, as I remember you can't configure list input parameters itself, but you can configure variable features, which are referenced by the FS.
    one of my configuration is a list imput where i choose between name 1, name 2, etc...
    i wanted to use that "name" to use it in the FS to configure name. i solved by adding a variable that is a string with the same name as the name of the list of the configuration, and configurated to change with the configuration. but i wanted to know if there was a directly way to used. but thanks anyway :) and, really, it is a great FS!
Sign In or Register to comment.