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.
Classify Onshape Standard Content in FS?
Max_Schürer
Member Posts: 2 PRO
Hi everyone,
is there a way of creating a query to determine if a part is Onshape standard content in FS? I think there must be some kind of undocumented, internal "standardContentId" or something like qGeneratedByStandard because somehow the standard icon in the feature tree has to be added to these certain parts in the creation process. Or has someone of you already created an isStandardContent() using some other sneaky workaround? Maybe @Caden_Armstrong or @EvanReese (tagging you two because you always seem to find a way to make the impossible work, thanks for the great community work btw!)?
I want to use this in computed part properties, to unify imported standard content from neutral formats (eg. STEP) (acquired that already) and the one created in Onshape to the same category, because i want to use the Onshape categories for mapping in further export.
Regards,
Max
Comments
I'm not sure I understand the ask here. Are you trying to make sure that you use Onshape Standard Content where available, and only use imports if not? Onshape Standard Content only exists in assemblies, where featurescript can't get at them.
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
No i want to use an if statement, to ask if the selected part is Onshape Standard Content, and if so use setProperties() to set the category to the custom category "standard". And i want to use that script as a computed part property function, and as far as i know computed properties are available to assembly content aswell. Or am i wrong with that?
And i am aware that i can't use the Onshape default property "category" and change it to be computed by now, so i created a custom property "auto category" with list inputs of with the available categories in our company. That may seem like something which is not needed if your default modelling process itself is done in Onshape, but we are currently migrating from another CAD-system to Onshape and therefore have many imported parts which need to have the properties selected right, which itself would be a ton of work.
Luckily we had naming conventions in our old CAD which contained some metadata already so i am abled to extract the "display name" property after import → getProperty() → split it up into array by character (-) and assign properties according to the values. (e.g. Old Part Name: (DrawingNumber)-(Name)-(Dimensions) etc.). For imported standard parts I filtered the "display name" for "ISO", "ANSI", "DIN", … but unfortunately these nametags dont appear in the names for parts from Onshape Standard Content. And if i want to auto-assign the "auto category" to imported as well as natively created standard parts in onshape, i need to expand my condition and somehow secure the created parts are matched.
Actually the longer I am writing this response the more I am convinced that this task may be solved better via API than tyring to find another workaround. I may have to have a look into the whole API thing which i tried to avoid as long as possible.