Jump to content

Custom Commands (CUI) batch creation from Excel


samehhosny

Recommended Posts

Hello everyone,

 

I have a case I tried to find a solution online with no avail.

I have an excel sheet with 1000+ commands routine I keep updating from time to time. Then, I copy specific column to a lisp file where I can execute these commands into autoCAD.

I built up these commands with a logic way to be able to memorize most of them. But sometimes, when I don't use a specific command from this file, I forget it and I have to open the excel sheet again to refresh my memory to use it again.

I found another way where I could use autocad menu or ribbon tabs and panels to visualize these commands in autocad instead of memorizing every command. Also, this will ease the process on my teammates as they have to keep reading the excel sheet to know which updates I made to the commands list.

By visualizing the commands into AutoCAD, it will make our life a lot easier.

The main issue I'm facing now that I need to enter these commands in my partial custom CUIx one by one with unique element ID for every command. It's time consuming and lot of efforts.

Is there a way to add contents of a separate excel sheet or notepad where I will pre-define the command name, description, small and large button image, and macro for every command I use?

I know it may sound very hard but I believe it's not impossible. That was the first and hardest part in my issue.

The second part that I need to add the newly created commands into panels then into ribbons. Is there a way to automate this as well?

 

Thank you in advance. Wish if someone could help me with instructions on how this could be achieved.

Attached a sample excel sheet including the command name and macro and element-ids

 

Best regards

Sameh Hosny

Sample.xlsx

Link to comment
Share on other sites

Yes, How to create this partial menu and connects it with commands loaded from my lisp file? If that possible.

Link to comment
Share on other sites

You should read the help about menu's this is the start and shows how to have sub menu's see the -> and <- else just do line by line commands. Also I have all my lisps as separate files and load as required. At end is line by line example just put your command line entry it should run if you have previously loaded your big lisp. Just make in Notepad. Can have sub sub menu's

 

***MENUGROUP=MYMENU

***POP20
[->LISP1 A-B]
             [1/4 POINTS]^C^C(LOAD "1-4 POINTS")
             [Add 2 Level]^C^C(LOAD "add-to-levels")
             [Add-pits-drain]^C^C(LOAD"Add-pits-drain")
             [Allbylayer]^C^C(LOAD "Allbylayer")

[<-]
[->LISP2 C-D]      
             [Convert CCAD]^c^c(load "zero")(setq ccad "yes")(load "civilcad convert2")
             [Convert Geoff]^c^cscript "purgelays"
             [CCAD Pt Ht]^C^C(load "ccadpt ht lable")
             [Civ 3d Pt Ht]^c^c(load "civ 3D Pt Ht")
             [Chain-Off]^C^C^p(LOAD "Chainage-Offset") choff
[<-]
[->LISP3 E-L]
             [EditLsect]^C^C(LOAD "EditLsect")
             [Editr]^C^C(LOAD "Editrl")
             [EditXsect]^C^C(LOAD "EditXsect")

[<-]
[mylisp1]^c^crunlisp1typedentry
[mylisp2]^c^crunlisp2typedentry
[mylisp3]^c^crunlisp3typedentry

Edited by BIGAL
Link to comment
Share on other sites

  • 1 month later...

as an alternative idea - and I like the menu idea - I have a lisp with  DCL interface that I use as a simple help system.. I tend to use the keyboard commands a lot so this ay works for me, 'LH' and up it pops.

 

Essentially there sre 2 drop down boxes that could be used here. Assuming all your LISP files are saved at the same location the first drop down will list all the ^.lsp files in that location (using (setq MLF (vl-directory-files (GetMyLispFolder) "*.lsp" nil)) ), the second will list all the  LISPS in the file (by searching for the text "defun c::)" (using Lee Macs GetSyntax LISP). Click on the LISP name you can use an action tle to run the LISP

 

In my case when I click on the LISP name it wil display some text saved at the bottom of each of my LISPS as a help file.. but with a button 'run Lisp'. I can't post it at the moment - it has my company specific info and name in the file paths used.

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...