What's new

Save & Store Custom Colors?

Jhaddan

Member
Inside the Color Properties window.
Once you create a color pallet, is there a way to store these colors so they show up every time you create a part?
I like to use particular colors, and color pallets to keep the assembly harmonized especially when showing executives via quick presentations.

(Not the best example of a good color palette shown in attachment.)
 

Attachments

  • Alibre Color Palette.png
    Alibre Color Palette.png
    502.2 KB · Views: 22
  • Like
Reactions: MKR

Ralf

Alibre Super User
Hi Jeff,

New 3D Part -> Create your "color set" -> Save this (empty) 3D Part as: Master-Color
Every time start with this Master-Color 3D Part.
3D Assembly -> Color Properties -> Use original part color
Yes, it is a workaround, but works well.
 

idslk

Alibre Super User
is there a way to store these colors so they show up every time you create a part?
Hello Jeff,

Not that easy... but i've started writing a script where a way is shown to define the colors of the color properties window used by the script. due to less resonance i've stopped at v0.3.
Saving and loading different colorpalettes would be possible to implement, as well as optimizing the usability...
If you want to take a look: Colorize_V03

Regarsd
Stefan
 

simonb65

Alibre Super User
Would be nice if colours were associated with materials, then when you assign a material, the part automatically gets coloured!

I wrote an in-house add-on, many moons ago, that's hard coded with common colours I use, then its just a one click solution on the ribbon to assign colours (plus reflectivity and opacity) to a part. If I can find time I may change that so you can define the colours and share it ... but sadly it won't be anytime soon!

1648722453383.png
P.S. No icons made for it either, they 'were' going to be dynamically created to reflect the colour!

... maybe I should put some polish on this and release it!
 

simonb65

Alibre Super User
Simon have you attempted to use controls other than buttons on the ribbon? Here's what I'm using on the toolbar but for the ribbon the standard Microsoft one might work.
Well, for a start off, the menu isn't very flexible in terms of editing/modifying once the add-on has loaded. You can't add any controls other than use the provided button and dropdown menu features! Due to the basic functionality beyond being able to click buttons, my approach is now to use the Add-On menu to add/remove dockable controls ('toolboxes') which you do anything with that you like! So, this is where the last 2 hours has brought me to ...

It does lend itself to more productivity tools with a nice clean look, that you can show/hide as you need them.

Still got to do the editor portion with a nice colour picker. I'll take a look at the link you posted.

1648769304912.png
 

Cator

Senior Member
Simon, it looks really super! When you can I would like to see a tutorial on how to build an add on from scratch. Something simple to understand which steps to take and where to get the information!
 

simonb65

Alibre Super User
Simon, it looks really super! When you can I would like to see a tutorial on how to build an add on from scratch. Something simple to understand which steps to take and where to get the information!
It depends on what programming skills you have. There are examples in the Add-On and API sections of the forum, which are in C++. @bolsover has published his work on his Github pages, so you can see example C# code. My code is an add-on framework that handles all the menu stuff in a separate MenuManager to make menu creation and event handlers the same as you normally get in C# which makes creating and handling commands very easy.

i.e in my C# framework the code for adding a menu button that opens 'Prusa Slicer' is ...

NOTE: This is not how the basic Alibre Add-On framework currently operates. This is an example of how my wrapper simplifies the task.

Menu item addition
C#:
AddOnMenuItem export = new AddOnMenuItem("Export", "Export");
export.Items.Add(new AddOnMenuItem("Prusa Slicer", "Export as an STL and open this part in Prusa Slicer", ExportPrusaSlicer_AddOnMenuItemClicked, @"images\prusa_slicer.ico"));
m_Menu.Items.Add(export);

Click handler
C#:
private void ExportPrusaSlicer_AddOnMenuItemClicked(object sender, AddOnMenuEventArgs e)
{
    Debug.WriteLine("ExportPrusaSlicer_AddOnMenuItemClicked");

    if (e.Session.SessionType == ADObjectSubType.AD_PART)
    {
        IADDesignSession part = e.Session as IADDesignSession;
        string filename = @"d:/sandbox_alibre/" + part.Name + ".stl";    // TODO : remove hard coded filepath

        // export the part to a .stl file
        part.ExportSTL2(filename);   // use ExportSTL(..,..,..,..) for full control over STL output settings

        // open exported file in PrusaSlicer
        Process p = new Process();
        p.StartInfo.FileName = @"C:\Program Files\Prusa3D\PrusaSlicer\prusa-slicer.exe";    // TODO : remove hard coded filepath and dynamically find the .exe
        //p.StartInfo.Arguments = filename;         // TODO : get prusa slicer to accept a file to open, may need to just use the filename and let windows use the default application (PS)
        p.Start();
    }
}
 

HaroldL

Alibre Super User
Well, for a start off, the menu isn't very flexible in terms of editing/modifying once the add-on has loaded. You can't add any controls other than use the provided button and dropdown menu features! Due to the basic functionality beyond being able to click buttons, my approach is now to use the Add-On menu to add/remove dockable controls ('toolboxes') which you do anything with that you like! So, this is where the last 2 hours has brought me to ...

It does lend itself to more productivity tools with a nice clean look, that you can show/hide as you need them.

Still got to do the editor portion with a nice colour picker. I'll take a look at the link you posted.

View attachment 35727
Simon, I know it's been a while, has there been any progress on the color menu with picker?
 
Top