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.
Custom Feature Part Name (Ovyl)
Many of you all have already used the Part Name feature that I wrote (based on some code originally by @NeilCooke). I just pushed a pretty big update to it, so I thought I'd go ahead and make a dedicated post about the feature, which can be a good way for people to find it, ask questions about it, and for me to add update notes as needed.
Here are the updates I made for V10:
Here are the updates I made for V10:
- It no longer has a dedicated part number area. You just pick whether it should set the part name, part number, or both. I thought having a single field to fill for PN was a pain, and that having up to 6 to work with was nicer. If you need the number to be different than the name, I recommend just using the feature twice in a row.
- It handles rounding better. If you're using an expression, you have the option to round it to a certain decimal place. If the output of the expression is a length or angle, then you'll also see the option to choose display units", so that when the number is rounded, it shows the right thing. For example if you give it 1*inch you'll be able to choose "inch" as a display unit and the output will be 1, not 0.0254 (which is 1 inch in meters)
- The delimiter character can just be typed so you can use whatever you want.
Evan Reese
Tagged:
6
Comments
thankyou so much for this FS, It is absolutely amazing. I have been using it alot with 'configurations' for part naming and part numbering.
Keeping my documents clean and labeled nicely. Especially when using variable configured parts into Assemblies. The part names and part numbers all now make sense. More so the Part Names.
I was having a lot of issues initially where the Parts Names were not getting updated in existing part studio projects., I was finally able resolved my issue by right click Part, selecting properties and resetting all properties. Then everything started to work as expected.
Hi Evan,
Thank you for this custom feature it has been an absolute lifesaver. I did notice however that the max number of segments you could have is limited to 6. Is there a way I can increase the number of segments?
Wow I never thought anyone would hit that limit haha. I'll take a look when I can. You might be able to work around it for now by getting more than 1 out of a segment using toString() functions and ~ for concatenation. You can also stretch the feature UI wide to have more room to read since it will become long.
You could rework the feature to use an array parameter instead - unlimited segments that way.
Thanks for the suggestion! It's been a while since writing this (and I based most of it off of one by Neil). I do recall starting with an array param and hitting a dead end somewhere with that. Might have just been lack of code skill at the time. Now that we can right click a string field and convert to expression this feature is probably due for a full V2 anyway, so I'll give it a look.