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.
Can a Configuration change the name of a Part based on the selected options
daniel_cook
Member Posts: 48 PRO
Hi, just started working with configurations for some common plant items I use.
Currently I have a machine which has the following options:
Model (ex. Model 3508, 3514, 3518)
Discharge Side (ex. Left, Right or Dual Side)
Drive Side (ex. Left or Right)
Discharge Height (infinitely variable from around 2000mm to 30000mm)
I see there is the properties configuration where I can manually enter the part name for each configuration line, but what I am wondering is can the name be dynamically changed based on the selected variables: i..e.
3508-RightDischarge-LeftDrive-2000Discharge
Or do I need to manually enter this for all the potential configs.
Thanks,
Currently I have a machine which has the following options:
Model (ex. Model 3508, 3514, 3518)
Discharge Side (ex. Left, Right or Dual Side)
Drive Side (ex. Left or Right)
Discharge Height (infinitely variable from around 2000mm to 30000mm)
I see there is the properties configuration where I can manually enter the part name for each configuration line, but what I am wondering is can the name be dynamically changed based on the selected variables: i..e.
3508-RightDischarge-LeftDrive-2000Discharge
Or do I need to manually enter this for all the potential configs.
Thanks,
0
Best Answer
-
NeilCooke Moderator, Onshape Employees Posts: 5,618It was in the what’s new, you might have missed it.
https://cad.onshape.com/documents/cb387c60a50e49e2a50a65da/w/38f957562c3238fb6debd3a3/e/c6024f1ff135baf098509c71
Senior Director, Technical Services, EMEAI7
Answers
Twitter: @onshapetricks & @babart1977
Twitter: @onshapetricks & @babart1977
one was posted a while ago by OS, i personally have another example. it can consume string expressions, but requares strings to be inserted in qotes
https://cad.onshape.com/documents/67e94d9f28bea28acfe4cd2f/w/148839604556a1f380541be8/e/6390c076d48caa89151017d9
Twitter: @onshapetricks & @babart1977
https://cad.onshape.com/documents/cb387c60a50e49e2a50a65da/w/38f957562c3238fb6debd3a3/e/c6024f1ff135baf098509c71
This is a nice starting point. It'd be helpful to have a blog post or other documentation that lays this out a bit more clearly. Especially with the new BOM feature having just launched, the BOM is remarkably useless in the presence of configured parts because there's no obvious way to surface part configurations in the BOM. A BOM with a line item "38 socket cap screws" is not really informative.
FWIW, the use case that brought me here is a project built using off the shelf aluminum extrusion. The vendor can output CAD for any of their shipping configurations, but that's a slow process of downloading and importing. I made a configurable part based on the extrusion profiles I'm using, which greatly sped up the process of building my assembly. Of course, I hit this snag in the BOM. The BOM lists a separate line item for each different part configuration in the assembly, but the part numbers all show up the same. Naively trying to edit a configuration's part number in the BOM changes it for all configurations of that part in the document, which isn't what I had hoped for.
On the Part Number FS:
You should be able to simply right-click "configure" any of the fields that comprise the part number and set them in configurations tables (or, use a configuration variable as part of an expression in those fields e.g. round(#Length / mm) ). Either way, you shouldn't need to edit the FeatureScript. The custom feature is designed to be used as is.
On editing inside the BOM:
The rule here is: If the property you're changing is coming from the Configured Part Properties table, your change gets applied to that table, which changes one configuration. If the property you're changing isn't in that table, the edit gets applied to all configurations. If you want the BOM to control individual configurations, you need to set those properties on individual configurations first.
One shortcoming here is that, if you're using the custom Part Number FS, those numbers unfortunately aren't in the Configured Part Properties tables. This means you should be using the Configured Part Properties table to set any properties which you decide should apply only to individual configurations. This is currently the only way the BOM knows to not edit all configurations.
If you'd like this behavior to be different, please submit an improvement request for us to consider!
-- I can only seem to use numbers for the part numbers segment in the FS - i.e. if I have a "RH Drive" option, if I select the configuration table for that line, and select the "RH Drive" line, the FS gives me an "Error Regenerating" error. However if I change "RH Drive" to "1" then it works fine.
-- I have a custom height of 3000mm - but in the part number is defines it as "3 metres". I think I need to get around that by making a number variable for the discharge height, instead of driving that dimension straight off the sketches. [Solved that one as I wrote]
-- The FS changes the part number property in the properties dialogue (and associated BOM), but not the actual part name like in the example FS. Not sure what I am doing wrong there.
For your first and third questions:
1) Those input boxes for the segments allow anything as input, but giving them a string is somewhat quirky. Rather than putting `RH Drive`, you'll have to put `"RH Drive"` (a.k.a. you'll have to include quotes).
3) Do you have `also set name` checked? The part name and part number are different properties in the system, so the custom feature will only attempt to set the name if you have that boxed checked. If you do have the box checked and it's not working, you probably have set the name of that part already manually. Manual changes to the name currently override programmatic changes. We're aware of this defect and making plans for a solution.
Aside from that I cannot see the difference between the models
Could you share the URL of you document? If not, do you have "also set name" checked? See my answer above for possible issues.
I tried setting value to undefined first to try to clear it, but that also doesn't work:
We know of this defect and the trouble it brings. We are working on a solution.
Website: ovyl.io
(for example lock the manual rename, or choose to overwrite it, or give a messagebox warning, or some other sort of solution)