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.
How to make beam feature drive part numbers?
Eleanor_Coffin
Member Posts: 43 ✭✭
I've been using the beam feature regularly and would really like the ability to have it set the component's part number as well as name. (To the exact same thing -- nothing fancy.) I know I can do it with a mix of variables and a Part Number FS, but I'm regularly working with 8+ beams per part studio, all of whose lengths are driven by a combination of config variables/config lists, and it's a really lengthy process.
I'm really not familiar with feature scripts so am looking for some guidance on how to do this. Thanks!
I'm really not familiar with feature scripts so am looking for some guidance on how to do this. Thanks!
0
Best Answer
-
Alex_Kempen Member Posts: 248 EDUThe easiest solution is probably to make a personal copy of the Beam FeatureScript, figure out wherever it's setting the part name (control + f setProperty, look for PropertyType.NAME), and add a duplicate setProperty call right after, this time with the property type set to PropertyType.PART_NUMBER.
It's actually quite difficult to do it after the beams have been created since reading off part names (and other part properties) with FeatureScript requires some finagling, and most methods to do so don't update automatically, meaning if you change the name, you'll have to manually update the feature. That's why simply making a modified version of the Beam FS is probably the most straightforward solution.CS Student at UT DallasAlex.Kempen@utdallas.eduCheck out my FeatureScripts here:0
Answers
It's actually quite difficult to do it after the beams have been created since reading off part names (and other part properties) with FeatureScript requires some finagling, and most methods to do so don't update automatically, meaning if you change the name, you'll have to manually update the feature. That's why simply making a modified version of the Beam FS is probably the most straightforward solution.