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.
API: Reset part properties
Is there an API program I can have written up that will reset part properties that have been manually edited, so that I can use featurescripts on a part that has had those props overridden?
It would be nice if I could pick and choose which properties I need, even If I need to paste in the internal ID each time for the custom properties.
Mainly I just need : Material, StockSize(Custom Property), Weight(Custom Property)
This would sure beat deleting the base feature and re-linking all of the broken features after it, just to get a "fresh" part.
-Question 2: I do not have any experience with the API, so someone will have to write this up for me. Would anyone be willing?
Best Answers
-
joe_dunne Onshape Employees, Developers, csevp Posts: 198John,
I believe the answer to your question is yes. I don't want to say so definitely, since sometimes there are subtleties related these topics. However the path forward I can present to you. Is that I can make some introductions to people who could write this for you. They would do so on a contractual basis. So if that is a route you are interested in taking. Let me know
Joe
Joe Dunne / Onshape, Inc.5 -
ilya_baran Onshape Employees, Developers, HDM Posts: 1,215We're actually working on functionality that will let you reset part properties interactively. I'm not aware of currently exposed APIs for this.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc6
-
john_mcclary Member, Developers Posts: 3,936 PROilya_baran said:We're actually working on functionality that will let you reset part properties interactively. I'm not aware of currently exposed APIs for this.
I know I can't ask when but, How high on the priority/upcoming improvements list is this?
It has been a request from me since featurescripts could write to properties
And re-linking/dimensioning an entire model just to use the featurescripts ends up taking about the same time as filling in the properties manually.
So I tend to bite the bullet and make the model parametric, so when I copy it again for a new job it is quick to update.
As far as paying someone to write it, I would say no at this time. Knowing the app will be obsolete eventually. And how often this becomes a major issue. I was hoping there was a 5 lines of code answer. "Ah yes, that's just part.property["Material"] = null;" no such luck I guess
Thanks1 -
billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,068 PRO@john_mcclary
When working with the API, you'll need a server or someone's server.
Onshape's API is a bunch of data. There is nothing that executes with the API. You read this and then you write that. The program is on your server. In my case, I'm using nodejs.
As far as the stability of the API, I have code that's 2 years old and it still works. They do change things eventually, like configurations, but progress is wanted.
I'd write it for you, but I'm swamped. I've been wanting to tie featurescript & the API together for some time and
explore how the 2 could inter-play.
5
Answers
I believe the answer to your question is yes. I don't want to say so definitely, since sometimes there are subtleties related these topics. However the path forward I can present to you. Is that I can make some introductions to people who could write this for you. They would do so on a contractual basis. So if that is a route you are interested in taking. Let me know
Joe
I know I can't ask when but, How high on the priority/upcoming improvements list is this?
It has been a request from me since featurescripts could write to properties
And re-linking/dimensioning an entire model just to use the featurescripts ends up taking about the same time as filling in the properties manually.
So I tend to bite the bullet and make the model parametric, so when I copy it again for a new job it is quick to update.
As far as paying someone to write it, I would say no at this time. Knowing the app will be obsolete eventually. And how often this becomes a major issue. I was hoping there was a 5 lines of code answer. "Ah yes, that's just part.property["Material"] = null;" no such luck I guess
Thanks
When working with the API, you'll need a server or someone's server.
Onshape's API is a bunch of data. There is nothing that executes with the API. You read this and then you write that. The program is on your server. In my case, I'm using nodejs.
As far as the stability of the API, I have code that's 2 years old and it still works. They do change things eventually, like configurations, but progress is wanted.
I'd write it for you, but I'm swamped. I've been wanting to tie featurescript & the API together for some time and
explore how the 2 could inter-play.
I could hold out for a while longer
HWM-Water Ltd
but still need to replace in assemblies, and re-dimension
that's why I choose to go for broke and break the first feature, for when I may a copy of the document, the problem will not still show a band-aid
There's a little bit to the API. It'd be harder to write the authorization than your featurescript adaptor.
After all, you don't want anyone with a server to be able to change your stuff. So when API'ing who have to deal with permissions.
In your case, you want to access your stuff, which I believe the new enhancement will have baked in. A nice new enhancement for users and their data.
Through the API, you'd need an api key, which requires registering, which isn't very hard, but....