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.
Set Property (New Custom Feature!) 🆕

Set Property (New Custom Feature!)

Set Property allows you to:
- Dynamically set the properties of your part or multiple parts.
- Set custom properties.
Tips:
- Custom property ID's are found in your company settings.
- Right click on any value input to convert it to expression. This means you can use variables to drive the values.
- Want more cool custom features? Visit https://www.cadsharp.com/featurescripts/

CADSharp specializes in custom features and API.

Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
6
Comments
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Toll dass ihr das macht! Danke dafür!
Sure thing! 😎
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Hi @MichaelPascoe and thanks for the script ! Maybe I'm doing something wrong but when using the script to change the name of a part whose name had previously been manually changed, it doesn't work.
https://cad.onshape.com/documents/d46d641aba26104e94b70a37/w/5a96188877debc677f6c3507/e/c137d8b212e42c0fb242f04a
I can get the name to change and make that dynamic by linking it to variables and so on, it all works great. Just not if I previously name the file manually which is the case most of the time as I don't necessarily plan in advance to need to configure the name.
@Jon_H You can click on reset all in the properties tab. Then it works see the video below.
Thanks @Pattabi_Kakumanu for the workaround ! At least this restores the script functionality, but it also clears all the other properties which then need to be manually re-entered, not very practical. I hope there is a way for the featurescript to detect that it needs to reset the name property and that it is possible to reset only one field.
@Jon_H Currently this is one of Onshape's limitations. FeatureScript is unable to override manually set properties. Resetting the property like Pattabi showed, is the only way to reset that specific property to allow FS to set it.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
.
Update!
https://cad.onshape.com/documents/861d68af1cee67efb9e4843d/w/53981180c0515118622d7818/e/65b0c9acba56e6a4786405…
Note: Due to how Onshape currently works, get property is not live in the feature tree.
So to update it, you will have to manually open the feature and click the Refresh button.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
I need to check the forums more frequently, I was struggling to get and set materials properties because they exist outside of normal runtime and here you go dropping the solution to my problem 2 weeks ago with a more elegant refresh button to boot.
.
Update!
https://cad.onshape.com/documents/861d68af1cee67efb9e4843d/w/53981180c0515118622d7818/e/65b0c9acba56e6a4786405…
(TIP: If you intend to keep data with your part through export and import outside of Onshape, then use Properties not Attributes.)
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
This feature just keeps getting better! GET is a big deal
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
GET is one thing, but I think you're burying the lede here with that comment about property exports to external software @MichaelPascoe . You mean to tell me that this whole time the parasolid file format supports metadata for materials and tagging faces for custom properties? If so I have some unkind words for the CAMWorks developers and their implementation of parts interrogation and the literal man-years wasted re-clicking on parts for nesting orientation and material schedules.
Hi @MichaelPascoe ,
Thank you for your excellent “Set Property” custom feature—it's been extremely helpful in managing metadata in Onshape.
I’ve run into a specific issue when working with imported parts (e.g. STEP files):
#partname
or simply stays the same.The "Reset all" button is grayed out in the Properties tab — so there is no way to reset the name.
@Fladdie can you share an example document or part file? I'll take a look.
@EvanReese ty 😎
@Derek_Van_Allen_BD Yes, you can keep metadata with parts. Here, I'm getting the face property that I embedded, exported, then imported into Onshape:
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
@Derek_Van_Allen_BD Today I just used it to transfer a measured variable from one studio to another. Pretty useful.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
.
Update!
https://cad.onshape.com/documents/861d68af1cee67efb9e4843d/w/53981180c0515118622d7818/e/65b0c9acba56e6a4786405…
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
.
Update!
https://cad.onshape.com/documents/861d68af1cee67efb9e4843d/w/53981180c0515118622d7818/e/65b0c9acba56e6a4786405…
Tip:
You can set selections for the query finder using the
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Is it possible to get this to override onshape's Configured Properties?
I've set most of my part's properties with Configured Properties (as different part sizes have different part numbers, descriptions etc), but I want only the name to be controlled by this script (I'm using your Convert To String custom feature to achieve this).
In the example below, I'd want the part name to be '125mm' which works perfectly if I clear the Configured Properties, but gets overridden if I don't. Even though I haven't used the Configured Properties to set the part name
@Richard_Inv Once a property has been set manually, you have to clear all properties in order to reset it to allow features to override the properties. It would be nice if we could override, but properties are outside the scope of the feature tree; which is probably the reason we have to manually reset the properties. Having the option to reset only one property would be really helpful.
Are you saying that even if you don't configure the name property, it will not let you override it unless you reset all properties?
I recommend clearing all properties and using the Property / Attribute feature to control all of them. This way you don't have to mess with the property configuration panel. If you need help with logical statements, let me know and I can give some quick tips or take a look at your document.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Hi. Even after Reset All properties, I don't see new ones (not in property table, not in assembly BoM). I've tried to create also very simple file with just 1 property to control, but I don't see a way how to make it work. I've spend whole yesterday try to understand the basics of FeatureScript, but this is definettely not my area and fill-in attached SET dialog took me quite a time, but still no result. How can I make it work? - To have SET PROPERTY in part properties and in assembly BoM.
@ivan_gavenda It looks like you don't have any parts selected in your feature. If that doesn't fix it, please share a link to your document and I'll take a closer look to see what the issue could be.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
@MichaelPascoe You are right, No parts were selected ( I was so focused on new stuff, that I overlooked this basic condition). Now it is working fine. Thank you.
I think I'm misunderstanding something fundamental. I wish use this awesome tool to set part properties where the part belongs to a configuration scheme. I had previously come to a conclusion that this doesn't work. Now I am unsure.
My understanding is that a part property is either (1) set for the entire configuration group (all configs) by right-clicking the part and setting properties there (eg all parts are from Vendor X); or by (2) the "configured properties" table that can individualize the properties on a per-config basis (eg vendor part number for config Y). Furthermore, I understanding that the SET feature here basically automates method 1. But this means that a property set this way will effectively apply an individualized property to all configurations, which of course is not the desired outcome.
I'm pretty sure I'm missing something and would appreciate being corrected.
@paulpat1000 The Property / Attribute feature is for setting properties without having to use the "configured properties" tab. I found that the configured properties tab doesn't work as I would like. Setting the properties with this feature allows the feature to be configured with normal configurations instead of property configurations.
If you want to control a single property input with more than one configuration input (ex: A list as well as a variable as well as a checkbox), then instead of right clicking the input and configuring it, you would need to have the different configurations drive a variable or multiple variables and then use that variable in the Property / Attribute feature.
If you share an example document of what you are trying to do, I will show you how to implement the Property / Attribute feature for your document.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Hi @MichaelPascoe, is there also a possiblity to set the system property "Category"? I activated "multivalue" for Category and created some own categories to organize the visibility of the properties.
I tried it with custom Property and its ID but it did not work.
@lennart_miene143 not that I'm aware of. This could be a special property that can only be set by the system. Depending on your use case, there may be another way to achieve what you want. What is your end goal?
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
@MichaelPascoe I created 4 categories with different properties to show up in the properties of a part. If I always showed all of them at once it would be a mess. Furthermore, I created a custom feature to assign a correct part number to a selected part based on its category and on the input fields that show up in the feature dialog.
Here is one example: Fill out all the inputs and the properties of the part will have the same values as well as a part number that is calculated out of these inputs:
Here is another example with further custom properties:
As we use so many custom properties its quite a mess in the property dialog. So I hid them all and you can only see them when you choose the corresponding category:
In a part studio I usually trust my custom feature so I think the properties are correct. In an assembly, to be able to look up the correct properties I have to open the properties of a part and always try to select the proper category to show the corresponding custom properties.
I thought I could avoid this by automatically selecting the correct category and only showing the necessary custom properties. But I don't make a big deal about it since I'm already very happy about the custom feature and the automatic part number.
There has to be a way to set or get the Catergory property. It has a property Id, but I'm not sure. Are you setting or getting the Category with your custom feature in the pics?
Perhaps open an Onshape ticket and ask if it is possible to set the Category property via featureScript. If you figure it out, I'll add it to the feature. 😎
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴