Jump to content

Question about "programming" toolpalettes


MarcoW

Recommended Posts

Hi everybody,

 

I know Toolpalettes are supposed to be created with minimal programming skills. That I agree and I do create them this way :).

 

However; I use some quite a lot of handy routines (when clicking a button on a toolpalette) that are fired up by macro(s). Some of those macros get very long. Some among us would say that this is not the way to do so but okay.

 

To make a toolpalette working there is a lot of work to copy and paste everything in its way, images, commands, macro's, etc.

 

In my situation, I have been using *.mnu files for a long time. Even now I still use them. The most of the macro's come from these files. I have made them once and still use them with great use.

 

When modifying *.mnu files I do it by using notepad. I can get around pretty good. It is a fast way to modify one or more macro's in notepad. Think of the options like copy / paste / find text / replace text etc.

 

Now I was wondering if toolpalettes could be made / modified in a same way? SOmeone got experience with that?

 

If I open the *.atc file (palette file) I see some kind of code but I cannot tell what it is, PHP or so...

 

Any tips / brainstorm is appreciated.

Link to comment
Share on other sites

Toolbars can be manipulated through VL, you can add buttons & separators, modify macros/bitmaps etc

 

As a quick example, you can retrieve the macros for a toolbar item using something like this:

 

(defun GetMacros (tNme / lst)
 (vl-load-com)
 (vlax-for Men (vla-get-MenuGroups
                 (vlax-get-acad-object))
   
   (vlax-for tObj (vla-get-Toolbars Men)

     (if (eq tNme (vla-get-Name tObj))        
       (vlax-for bObj tObj
         (setq lst (cons (vla-get-Macro bObj) lst))))))
 
 (vl-remove "" (reverse lst)))

(defun c:test nil
 (princ
   (vl-princ-to-string
     (GetMacros "Object Snap")))
 (princ))

 

Test function included for ObjectSnap toolbar.

Link to comment
Share on other sites

Lee,

 

Thanks for the quick reply!

 

Just a question, you are talking about toolbars, I mean toolpalettes.

 

We are not talking about the same ...?

 

CU.

Link to comment
Share on other sites

Thanks Alan, those are pretty cool :D

 

I wish I had the CAD experience to go along with the LISP exprience - just looked at the 'Leaders' Tool Palette in 2010 - I can't believe how many options there are, and to think, I have made LISP's for many of those options available.

 

Lee

Link to comment
Share on other sites

Thanks Alan, those are pretty cool :D

 

I wish I had the CAD experience to go along with the LISP exprience - just looked at the 'Leaders' Tool Palette in 2010 - I can't believe how many options there are, and to think, I have made LISP's for many of those options available.

 

Lee

 

Autodesk released a few goodies. :)

Link to comment
Share on other sites

and to think, I have made LISP's for many of those options available.

that is the problem if you don't explore the program. We use a lot of sub contract staff here and I've lost count of the number of times I patiently explain "and we use this routine to do.....", only for them to say "oh, a bit like the XXXX command?" :x
Link to comment
Share on other sites

that is the problem if you don't explore the program. We use a lot of sub contract staff here and I've lost count of the number of times I patiently explain "and we use this routine to do.....", only for them to say "oh, a bit like the XXXX command?" :x

 

True, its embarassing when you make a LISP for which a command already exists - kinda undermines your knowledge of the program.

Link to comment
Share on other sites

True, its embarassing when you make a LISP for which a command already exists - kinda undermines your knowledge of the program.

 

I had a little chuckle when you guys were creating routines to display XYZ of a picked point.

Link to comment
Share on other sites

I had a little chuckle when you guys were creating routines to display XYZ of a picked point.

 

I bet you did :D I did too when I saw your post - I thought there had to be some command for it :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...