AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Icon menu resource dll

16 REPLIES 16
Reply
Message 1 of 17
btackes
4289 Views, 16 Replies

Icon menu resource dll

Anyone know how to create Icon menu resource dll files?

16 REPLIES 16
Message 2 of 17
acyxou
in reply to: btackes

Hello, btackes!  

Have you found an answer? I'm stuck with the same problem now....

Message 3 of 17
btackes
in reply to: acyxou

Sorry I guess no one knows the answer so it either individual png files or slide libraries.

Message 4 of 17
acyxou
in reply to: btackes

Actually I solved this problem about a half an hour after asking you about that 😉 and It's pretty simple to implement....

 

 

  1. All u have to do is to create a new C++ project in VC choosing "Win32 Project" as template, on the next page of Win32 Application Wizard select "DLL" as Application Type, click Finish.
  2. In Solution Explorer of your newly created project click on "Resource View" tab, right click on root node in "Resource View" -> Properties. On the left side of "Properties" window expand "Linker" section, then select "Advanced", in "Advanced" change "No Entry Point" to "Yes (/NOENTRY)". Click OK
  3.  Add your bitmaps by right clicking on root node in "Resource View" -> Add... -> Resource... In Resource Type choose "Bitmap", then click on "Import" button and navigate to your Icons folder, choose whatever icons u want. After that close all opened tabs with chosen icons in VC.
  4. Go back to "Solution Explorer" tab, expand "Resource Files" folder, find there *.rc file, right click on it -> "View Code". Find there your icons paths, they will look something like this: 
    /////////////////////////////////////////////////////////////////////////////
    //
    // PNG
    //
    
    IDB_PNG1     PNG       "C:\\Path\\To\\Icons\\Folder\\Autocad.png"

    Change "IDB_PNG1" according to the name you specified in your cui file.

    Then save and build your project. Give the same name to the resulting DLL as your cui file has and put it in the cui folder. That's it! Should be working.... I find this method it's much more easier then using "Resource Hacker".  Smiley Happy

     

Message 5 of 17
cvc-it-mb
in reply to: btackes

Actaully it's much easier than that, especially if you don't have C++.

 

Download XN Resource Editor and then open the DLL file attached for the format the icons must follow. Then name the DLL the same as your menu file( test.mnu and test.dll). In your menu file you call the icons by the name you give them in the DLL, so per my example DLL you would call the icon for Layer Isolate by LAYISO16.

 

Hope that helps,

Jim

Message 6 of 17
hsiao369
in reply to: cvc-it-mb

I create PNG menu resource dll file with Resource Editor and VC. But still can not show in AutoCAD 2017.

Message 7 of 17
StevenMar
in reply to: hsiao369

Not using a resource DLL but this method seems to work with PNGs...

 

Within the CUIX file the [Content_Types].XML file exists (CUIX is just a zip file)... Make sure it understands that a PNG file is an image file by adding the line:

 

<Default Extension="png" ContentType="image/png" /> using a text editor.

 

Copy the PNG files so they are inside the CUIX.

 

Rename everything back to the way it was and restart AutoCAD*

 

This seemed to work for me.  The PNG files cannot be seen in the Image Manager, but the ribbon buttons seem to work now...  My CUIX is a partial CUIX being added using the Autoloader.  I like that the images are embedded in the CUIX... very clean.

 

 

 

 

Message 8 of 17
mcicognani
in reply to: StevenMar

Hi Steven,
but this way you're not supporting Light&Dark theme...
Have you any idea why after many years after implementing Light&Dark theme, still there is no user friendly way to make a custom CUIx to support two sets of images?
Apparently, only supporting two resource DLL may work, and this is not something a simple user can afford.
Message 9 of 17
gclark
in reply to: mcicognani

Why not copy a base Icon menu renaming it to you want, go into it, delete what you don't want and add components you do? There is a Icon Menu Modifying tool under the schematic tab on the far right (sorry out of town and VPN tunneling isnt working from the hotel to get a network license and give you screen shots).

Message 10 of 17
mcicognani
in reply to: gclark

Hi gclark,
problem is supporting the on-the-fly COLORTHEME variable changes.
So far, the only way is to support two icons resource DLLs, one named as the CUIx file, the other with the suffix '_light' to the name (i.e. custom.cuix will need custom.dll for dark icons and custom_light.dll for light icons).
I said ICONS because starting from 2017, BMP transparent color (192,192,192) is not supported, so we must use PNG or ICO files.
But resource file do not support PNG files as image resources, so is easier to build resource DLL with icons.
However, before building the final dlls, you must manually edit the .rc file and change the ICONS tag with RCDATA, otherwise it won't work.
This way your custom menu icons will change accordingly to the COLORTHEME value...

So far, so good, but my comment remains: all right for a developer who can afford all this, but what about a 'normal' user that want to personalize a menu using standard CUI editor supplied with AutoCAD based products?
After so many years, still, there is no tools to edit a CUIx that allow to specify icons for dark and light theme.
If I'm not wrong there is still confusion about manually adding, editing or exporting icons from the UIEDITOR... like files must have .bmp extension, but actually they are PNGs... and the internal icon editor still support only bmp...
Message 11 of 17
C.Utzinger
in reply to: acyxou

Hello

 

Why is there no .rc file

Message 12 of 17
rhesusminus
in reply to: C.Utzinger

This file is created within Visual Studio, and does not come with AutoCAD Electrical.

Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 13 of 17
C.Utzinger
in reply to: rhesusminus

Hello

 

I know, but i don't find this *.rc file in the Visual Studio. It's because it is an Express Version?

 

4. Go back to "Solution Explorer" tab, expand "Resource Files" folder, find there *.rc file, right click on it -> "View Code". Find there your icons paths, they will look something like this: 

 

Kind regards

Message 14 of 17
rhesusminus
in reply to: C.Utzinger

Are you showing all files?
2016-11-22_16-13-27.png


Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 15 of 17
C.Utzinger
in reply to: rhesusminus

Yes 😞

Message 16 of 17
C.Utzinger
in reply to: rhesusminus

Neue Bitmap.jpg

Message 17 of 17
C.Utzinger
in reply to: rhesusminus

I have it!

 

Now i have just one more Problem!

 

How i build my Project? Because i have a lot of Errors.

 

Please Help...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost