Can't get my lisp to show on toolbar

Can't get my lisp to show on toolbar

Markeckert
Enthusiast Enthusiast
2,006 Views
31 Replies
Message 1 of 32

Can't get my lisp to show on toolbar

Markeckert
Enthusiast
Enthusiast

I have the tool bar below with a cuix containing a VBA app. 

 

Markeckert_0-1732199200482.png

I'm trying to add the CID.lsp file to that tool bar. I've created a CID.cuix for the CID.lsp file. I can't get the CID.cuix added to the tool bar. Can someone give me some guidance on what I need to do?

Markeckert_1-1732199345697.png

 

 

0 Likes
Accepted solutions (1)
2,007 Views
31 Replies
Replies (31)
Message 2 of 32

pendean
Community Legend
Community Legend
You've done nothing to add that LISP to any toolbar so far, judging by your screenshots alone. It's not that simple. never has been.

To add a toolbar button in CUI command
1) create a new command in the commands section (lower left).
2) add your LISP launch name (CID if that is it)
3) create a custom button (top right of the CUI pop-up) or reused an existing one. Then assign it to the button.
4) Expand the Toolbars section of your CUI pop-up (top-left portion), and select the toolbar you wish to add the button to.
5) Drag your "new command" from the lower-left corner to the position you want in your TOOLBAR
6) APPLY button, then OK button out of the CUI command pop-up.
7) There it is now.

Read all about CUI customization in tutorials all over the web, I'll get you started right here with the guide from your AutoCAD's own HELP file:
https://help.autodesk.com/view/OARX/2025/ENU/?guid=GUID-B6B3F2D9-2A25-444E-BC62-3AEABDE7944B#:~:text...

0 Likes
Message 3 of 32

paullimapa
Mentor
Mentor

if you’re referring to adding a partial cui where you can add your own toolbars then checkout this video tutorial 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 4 of 32

Markeckert
Enthusiast
Enthusiast

That worked to create a new icon on the tool bar! How do I get that icon to start the lisp?

0 Likes
Message 5 of 32

pendean
Community Legend
Community Legend

@Markeckert wrote:

...How do I get that icon to start the lisp?


Did you fill in this MACRO portion of your new button with the letters that launch your LISP?  You know, like every other singly button on every toolbar in CUI 

pendean_0-1732209600257.png

 

pendean_1-1732209630904.png

 

pendean_2-1732209687432.png

 

You do have to know what letters activate your LISP, no one here can guess that for you.

0 Likes
Message 6 of 32

Markeckert
Enthusiast
Enthusiast

I'm a newbie to AutoCAD. I'm still having an issue with getting the button to initiate the lisp. Here is the location of the lisp but I'm not defining the macro correctly.

 

Markeckert_0-1732212296764.png

 

0 Likes
Message 7 of 32

paullimapa
Mentor
Mentor

Assuming the lisp is executed by entering at the command prompt: CID

Then change the Macro to read like this:

^C^C^P(load"c:/r17sup/cid");^PCID;

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 8 of 32

Markeckert
Enthusiast
Enthusiast

That works, Thank You!!

Is there a method to deploy this button and its configuration to other users?  I don't want to manually update every workstation.

0 Likes
Message 9 of 32

paullimapa
Mentor
Mentor

Not sure if there's an automation method.

But if you created a partial menu, you can have each station automatically load that partial menu by placing the following code in acaddoc.lsp:

(command "_.CUILOAD" "yourpartialmenu.cuix")

You can read up more on this here:

 https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Automatically-load...


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 10 of 32

Sea-Haven
Mentor
Mentor

You posted elsewhere as well if you want a tool bar you can use notepad to make it, a mnu file and menuload it. Much easier than CUI. 

 

***MENUGROUP=ALANSTOOLBAR
***TOOLBARS
**ALANSTOOLS2
Alloff       [_Button("All Off","Alloff.BMP","alloff.BMP")]^c^c^c(setq surface "_xxx All Off")(load "vercheck")(load "listselect")(load "changecontours6")
50mm         [_Button("50mm cont","50mm.bmp","50mm.bmp")]^c^c^c(setq surface "_xxx NS 0.05 Contours")(load "vercheck")(load "listselect")(load "changecontours6")
100mm        [_Button("100mm cont","100mm.BMP","100mm.BMP")]^c^c^c(setq surface "_xxx NS 0.1 Contours")(load "vercheck")(load "listselect")(load "changecontours6")
200mm        [_Button("200mm cont","200mm.BMP","200mm.BMP")]^c^c^c(setq surface "_xxx NS 0.2 Contours")(load "vercheck")(load "listselect")(load "changecontours6")
500mm        [_Button("0.50m cont","500mm.BMP","500mm.BMP")]^c^c^c(setq surface "_xxx NS 0.5m Contours")(load "vercheck")(load "listselect")(load "changecontours6")
1m           [_Button("1m cont","1m.BMP","1m.BMP")]^c^c^c(setq surface "_xxx NS 1m Contours" )(load "vercheck")(load "listselect")(load "changecontours6")
Triangles    [_Button("Triangles","TRI.BMP","TRI.BMP")]^c^c^c(setq surface "_xxx NS Triangles" )(load "vercheck")(load "listselect")(load "changecontours6")
Slope        [_Button("Slope","RCDATA_16_SM_EXTEND","RCDATA_32_SM_EXTEND")]^c^c^c(setq surface "_xxx Slope Arrows & Catchments" )(if (not AH:Vercheck)(load "vercheck"))(if (not AT:ListSelect)(load "listselect"))(if (not AH:Changecont)(load "changecontours6"))
ID_Ddim      [_Button("Dim Style",RCDATA_16_DIMSTY,RCDATA_32_DIMSTY)]^c^c_dimstyle
ID_Dimaligned[_Button("Dim align",RCDATA_16_DIMALI,RCDATA_32_DIMALI)]^c^c_dimaligned
ID_Dimlinear [_Button("Dim Lin",RCDATA_16_DIMLIN,RCDATA_32_DIMLIN)]^C^C_dimlinear
ID_Mleader_Style[_button("MLEADERSTYLE",RCDATA_16_ML_STYLE,RCDATA_32_ML_STYLE)]^c^c_mleaderst
M2P          [_Button("M2P","M2P.BMP","M2P.BMP")](command "M2P")

 

In the file above I made custom images you need the images to be like 32x32 pixel size I used Paint.net it allows you set a 32x32 image.

SeaHaven_0-1732321177563.png

 

0 Likes
Message 11 of 32

Markeckert
Enthusiast
Enthusiast

I have the menu file set up. Can you send me a screen shot of how you execute the mnuload. I get this when I type in menuload at the command line. 

Markeckert_0-1732543877711.png

 

0 Likes
Message 12 of 32

paullimapa
Mentor
Mentor

Use your mouse and click on the Browse button. Then look for your menu in the file selection window that appears. Once you select the menu to open you’ll be returned to the initial window. If successful your menu will now show up in the Loaded Customization Group list. Then click on the Close button and see if your new toolbar now shows up in the drawing window. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 13 of 32

Markeckert
Enthusiast
Enthusiast

Looks like there is something I'm not understanding yet.  I added the ID_UserButton_2  line. The first two lines were already there and working. I'm not getting the new ID_UserButton_2  on the tool bar.

 

ID_Toolbar1_0 [_Toolbar("GridTool", _Top, _Show, 1, 0, 1)]
ID_UserButton_0 [_Button("Run the GridTool", "c:/r17Sup/Grid.bmp", "c:/r17Sup/Grid.bmp")]-vbarun c:/r17Sup/newgrid.dvb!ACADPROJECT.MODULE1.STARTUP
[--]
ID_UserButton_1 [_Button("Save Standard", "c:/r17Sup/cSave.bmp", "c:/r17Sup/cSave.bmp")]-vbarun c:/r17Sup/newgrid.dvb!Module1.cSave
ID_UserButton_2 [_Button("Update Issue Date", "c:/r17Sup/IssueDT.bmp", "c:/r17Sup/IssueDT.bmp")] ^C^C^P(load"c:/r17sup/cid");^PCID;

0 Likes
Message 14 of 32

paullimapa
Mentor
Mentor

Odd. What if you replace the first button_0 with just your new command sequence but leave the bmp code alone 

ID_UserButton_0 [_Button("Run the GridTool", "c:/r17Sup/Grid.bmp", "c:/r17Sup/Grid.bmp")]^C^C^P(load"c:/r17sup/cid");^PCID;

Does the command work? 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 15 of 32

Markeckert
Enthusiast
Enthusiast

I tried your suggestion. Oddly the original two buttons are still on the tool bar and the new one isn't. I have these files in my c:/r17sup folder. Is there something else going on? I inherited these files I didn't create them.

Markeckert_0-1732551928937.png

 

0 Likes
Message 16 of 32

Markeckert
Enthusiast
Enthusiast

Looks like maybe the tool bar icons are loaded in the customize user interface. 

Markeckert_0-1732552690863.png

 

0 Likes
Message 17 of 32

paullimapa
Mentor
Mentor

If your grid.cuix partial menu is loaded properly it'll show up here:

paullimapa_0-1732554901824.png

 

For example I have a partial menu named: lyrapps.cuix

When I select lyrapps.cuix on the list the window changes.

Now I see my @THEOFFICE_LYRAPPS partial menu group which contains the custom commands at the bottom under All Commands Only and  I also see my custom Toolbars: LayerApps

paullimapa_2-1732555148533.png

 

 

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 18 of 32

paullimapa
Mentor
Mentor

Did you see grid.cuix loaded as a partial menu like the way I showed in my screenshots?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 19 of 32

Markeckert
Enthusiast
Enthusiast

I added the Change Issue Date but it isn't showing under the GridTool.  I also update the Grid.mnu to include all three buttons. Now I've got two sets of the original buttons.

Markeckert_0-1732557317785.png

 

0 Likes
Message 20 of 32

Markeckert
Enthusiast
Enthusiast

I'm also getting this error when I open the CUI from the command line. It seems to be looking for an older cuix file. 

Markeckert_0-1732557920790.png

 

0 Likes