ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to add an image icon for a custom command in the command line?

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
maisoui
1447 Views, 9 Replies

How to add an image icon for a custom command in the command line?

HI,

 

I'd like to know how to define an image icon for a command (like "acedSetFunHelp" which define a help URL) which will be "understood" by the command line. The goal is to have:

 

commandline_icon.png

 

I have a custom CUI (to add my commands in the ribbon) where I defined a small and large icon file, but apparently command line doesn't use that. Last information, I register my commands with:

 

 

acedRegCmds->addCommand

 

Regards,

Jonathan

--
Jonathan
9 REPLIES 9
Message 2 of 10
oliver253m
in reply to: maisoui

I haven't tried it (yet), but acedRegisterCommandBitmapQuery() seems to do the job.

 

There is also a acedGetBitmapForCommand() function, for which the documentation implies that you can associate a bitmap with a command through Command Display Name in the CUI, but that didn't appear to work.

Message 3 of 10
maisoui
in reply to: oliver253m

Hi,

 

Thank you for your reply. I have one remark about the function acedRegisterCommandBitmapQuery:

  • In the OARX documentation, we can read : "It is recommended that the bitmap-to-command association be done through the CUI. If this is not possible, or there is a need for override behavior, please use the callback function mentioned above. Note that the name is all in Localized name". As I said, I defined large and small image in my CUI and everything works fine in the ribbon.

So why do I need to register this function? Maybe there is a trick for the "bitmap-to-command association" in the CUI?

 

Regards,

Jonathan

 

--
Jonathan
Message 4 of 10
Balaji_Ram
in reply to: maisoui

Hi Jonathan,

 

Recently there was a discussion on a similar topic in the AutoCAD .Net forum.

 

Can you please try if the code posted there is of any use ?

http://forums.autodesk.com/t5/NET/Commandpreview-on-commandline/m-p/3803567#M33989

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 5 of 10
maisoui
in reply to: Balaji_Ram

Hi,

 

Thank you for your post. It's very interseting and I think I'm going to implement xaml file to have extended help for all my commands. I wanted to do for a long time Smiley Wink.

 

But, I think it doesn't resolve my problem. In the ribbon, all small and large images associated to the commands are shown but not in the command line (auto-completer list). Have you an idea about that? (Note that I use images in PNG format)

 

Regards,

Jonathan

 

--
Jonathan
Message 6 of 10
Balaji_Ram
in reply to: maisoui

I am glad you found it interesting.

 

In the sample code from that thread, please note this line while the macro is created :

 

<<<

menuMac.macro.CLICommand = "MyTestCommand";

>>>

 

This ensures that the macro and its images are associated with the custom command.

After you run the sample, you will find the image getting displayed for the custom command as shown in the attached image while autocomplete displays it.

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 7 of 10
maisoui
in reply to: Balaji_Ram

Perfect. This was that I had missed. My CLICommand text didn't match the command name.

Thank you very much for your help.

Regards,

Jonathan

 

--
Jonathan
Message 8 of 10
Nick1983
in reply to: maisoui

in my case, it's enough to have just a quix file. 

demo.png

 

so, if the question is about your own command which is added to autocad menu, something is wrong with your quix. 

 

---
#define QUESTION(b) (2*b)||(!(2*b)) © William Shakespeare
Message 9 of 10


@Nick1983 wrote:

in my case, it's enough to have just a quix file.


quix or cuix?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 10 of 10

my mistake :). of course, it's cuix

---
#define QUESTION(b) (2*b)||(!(2*b)) © William Shakespeare

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

Post to forums  

Autodesk Design & Make Report

”Boost