toolbar and icon

Discussion in 'AutoCAD' started by vijaya, Dec 8, 2004.

  1. vijaya

    vijaya Guest

    1. How to create a toolbar and add an icon whenever autocad starts? And When I click on the icon I want to run my lisp code. How do I do that?Can Any one help me?
    2. I created a toolbar and add an icons. once I close and open autocad I'm getting smiling faces instead of icons.What should I do to avoid that ?
     
    vijaya, Dec 8, 2004
    #1
  2. vijaya

    StefVdM Guest

    Hi,

    From your second question I understand you already know HOW to create a toolbar and add buttons to it. When a toolbar is visible when you close AutoCAD, it will be visible when you start AutoCAD again, in exactly the same spot where it was.
    As for running your lisp-code, you can do the following:

    1. go to "Tools->Customize->Toolbars..."
    2. make sure the toolbar you want to edit is visible (just select it in the list of toolbars".
    3. now simply click on the button you want to use to run your lisp. The Customize dialogue box will switch to the "Button Properties" tab. In the field that says "Macro associated with this button", fill in "^C^C_yourlisp"; where "yourlisp" is of course the name of your lisp.
    In the field "name" you can give your button a name, in the field "description" you can give a short description of what the associated command (or lisp) will do.

    Now, you have to take care: for the above to work, you will have to make sure that
    1. your lisp is in one of the directories in the "support file search path", otherwise AutoCAD will not find it (you can either put your lisp in an existing directory, or add the directory of your lisp to the "support file search path")
    2. your lisp should load automatically at startup. To do that, add the line
    (load "yourlisp")
    to the acaddoc.lsp or acad.lsp file. If these do not exist, you can create it with e.g. notepad, and save it in the "support"-directory.

    Also the icons or bitmaps you use for your button should be in the "support file search path", or else AutoCAD won't find them and give you a smiley face.

    Hope this helps,

    Stef
     
    StefVdM, Dec 8, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.