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.

Custom Feature: Part Color

Evan_ReeseEvan_Reese Member Posts: 291 PRO
I made a Part Color feature here. It's useful to change the appearance of a part with configurations. I know you can configure the appearance of parts in the Configured Properties, but you're limited to setting up each possible permutation of the design, which is onerous especially when using a variable configuration that could be changed to anything. I needed something like this for something I was working on, then my wheels got turning on whether I'd be able to figure out how to drive it with a hexadecimal code, and it turned into a project-based learning exercise for me. I hope it's useful to someone else too.
Evan Reese / Agency Owner and Industrial Designer
Website: fractalmade.com
Instagram: @evan.reese.designs

Comments

  • romeograhamromeograham Member Posts: 400 PRO
    edited May 26
    Nice work @Evan_Reese

    This is interesting, since changing color in the Feature List means that you can use color to represent different levels of development in the Feature List ... almost a progress bar of sorts.

    Sometimes I'll use neutral (or just Onshape standard) colors for parts when they are "development", "parent" or "master model" type parts...then, when they get closer to being done (or if they are derived into a more finished part studio), I'll use colors that are closer to the real color of the finished real-world parts. This will make that easier.

    Having a little trouble with an error, though: I set a color on a part using the regular "Edit appearance" method, then tried to use your FS.
    I thought it was working (since I had set the color with the regular method to get a hex code from one of my custom colors), but now I realize that the FS will not change the color. 

    If I use your FS on a part with default Onshape color, it seems to work, unless I try "Use hex code".
    When I try to use a Hex code to set the color, the feature throws an error, and doesn't do the color change:

    When I deselect the Use hex code box, the error goes away.


    Any ideas?

  • Evan_ReeseEvan_Reese Member Posts: 291 PRO
    edited May 26
    ooh that's an interesting use I'd not thought of. could be handy.

    Of course, my first user finds a bug immediately, haha. I've updated it to accept upper and lower case letters, which was the issue.

    I think it's like the other features that change part properties in that the part you're changing can't have been edited manually before. To get it working, right click the part in the parts list and select "properties" then pick, "reset all". after that it will work. be aware that this will REMOVE ALL PROPERTIES from your part (like name, part number, revision, etc), so if this is a part that's late in development, especially one that's been released, you'll want to watch out. It helps to plan for it. if you didn't you can always re-enter the data you need. Once you're really far into a project you may not want to do this. I believe the change can just be rolled back if you don't like it though.

    Evan Reese / Agency Owner and Industrial Designer
    Website: fractalmade.com
    Instagram: @evan.reese.designs
  • AlexPittAlexPitt Member Posts: 22 PRO
    A nice development @Evan_Reese! Great little icon too! I copied, liked it and had a play, setting up a config table as with Neil's.  As you say, just need to remember to not use the OS native colour picker which overrides the FS (as per any feature script affecting properties).  The ability to use hex code is great for quickly pasting colour refs in from the web.
  • cache_river_millworkscache_river_millworks Member Posts: 187 PRO
    Legit!
  • Evan_ReeseEvan_Reese Member Posts: 291 PRO
    The feature accepts face selections now too
    Evan Reese / Agency Owner and Industrial Designer
    Website: fractalmade.com
    Instagram: @evan.reese.designs
Sign In or Register to comment.