Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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 Color and Material - New FeatureScript

sebastian_glanznersebastian_glanzner Member, Developers Posts: 437 PRO
Hello everyone,

I would like to share a featureScript of mine which I think could be useful for you.
https://cad.onshape.com/documents/a1c694da929cd0c00da57f1d/w/affc3a805df9b0c08ec7af3c/e/641eb1448fe7d5609b74ae7e



You can make a copy of this document and customize the table with the materials you use for your parts.
The advantage in using this feature instead of the Onshape material list is, that all parts will have the same color in your documents.
Also you can extend the feature to set custom properties!

Here is a list of custom properties I use:
- German material name
- English material name
- German surface name
- English surface name

This helps me to fill my BOMs and part properties.

PS.: Make sure to place the feature at the end of the feature list. That the way the mass is calculated correctly.

Comments

  • H_WangH_Wang Member Posts: 20 ✭✭
    Hello everyone,

    I would like to share a featureScript of mine which I think could be useful for you.
    https://cad.onshape.com/documents/a1c694da929cd0c00da57f1d/w/affc3a805df9b0c08ec7af3c/e/641eb1448fe7d5609b74ae7e



    You can make a copy of this document and customize the table with the materials you use for your parts.
    The advantage in using this feature instead of the Onshape material list is, that all parts will have the same color in your documents.
    Also you can extend the feature to set custom properties!

    Here is a list of custom properties I use:
    - German material name
    - English material name
    - German surface name
    - English surface name

    This helps me to fill my BOMs and part properties.

    PS.: Make sure to place the feature at the end of the feature list. That the way the mass is calculated correctly.
    Hi Sebastian,
           This is a great feature, I use it to assign density to my COTS parts. However, there is a small bug. Here is what happens: If you assigned any type of materials to the part from Onshape materials Library, the feature will not work even when you change the material back to "None" from Onshape materials assignment. I believe this is due to the fact that Onshape materials lib assign "0" to the part if you select "None", and the feature is not able to overwrite that "0". Is there any fix can be applied? Thanks!
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,792
    @Haibing_Wang - setting part properties manually will override anything set using FeatureScript, even if you run the custom feature again. You can reset properties to enable the script to work again, details here: https://www.onshape.com/cad-blog/tech-tip-how-to-reset-part-properties-in-onshape

    Senior Director, Technical Services, EMEA
  • CAD_user12345CAD_user12345 Member Posts: 25 PRO

    @NeilCooke are there any plans to integrate something like a material/property-based automatic part coloring, that can be toggled? We like the automatic part coloring for designing multiple parts within one PS but it would be really helpful to switch to a view where all parts get a specific color based on the material and maybe a property (that describes the Surface finish).

  • MichaelPascoeMichaelPascoe Member Posts: 2,110 PRO
    edited January 23

    @severin_schranz895 I can't speak for Onshape's plans on that. But I do know render studio already does this based on the parts selected material.

    Also it would not be difficult to make a custom feature that does this. Simply one click at the end of your feature tree, then it would update all the part colors based on material. Due to featurescript limitations, there would need to be a refresh button on the feature to manually refresh if any parts changed material or new parts became available. This could also be done via app, but that is more dev time.

    Feel free to reach out if you need any custom features to speed up your Onshape workflows. 😎


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
Sign In or Register to comment.