Jump to content

Running a custom command (CUI button) from the commandline


mickydee81

Recommended Posts

Ok. I am just trying to be able to type a command into the command prompt that I created a script for in the CUI, and have it run like a normal command. Can I or can I not do that? If so, how?

Link to comment
Share on other sites

  • Replies 28
  • Created
  • Last Reply

Top Posters In This Topic

  • Dadgad

    6

  • BIGAL

    4

  • YZ

    4

  • mickydee81

    4

Top Posters In This Topic

Posted Images

You would have to create a command alias by adding it to your acad.pgp file via the ALIASEDIT command, or clicking on the Manage tab of the Ribbon and then selecting the Edit Aliases from the Customization panel or manually (old school) editing the acad.pgp. If AutoCAD is running and you use the last method you would have to issue the REINIT command and make sure to place a checkmark in the box for PGP file.

Link to comment
Share on other sites

Between Dagdad, steven-g and I we could not find a way to create a custom command that you can type into command line.

 

You can edit a command line version of a core AutoCAD OOTB command. But it does not seem that you can assign a new command line string that will call a new script from cui. Even if you change, say, LINE in CUI to a different macro string, typing LINE (or L) in the command line will still call the OOTB LINE command.

 

However, the one thing you can do is assign keyboard shortcuts. Maybe that is your best way around it BowHunter. For example, you can set your new scripts to CTRL+1, CTRL+2, etc.

Link to comment
Share on other sites

YZ to UNDEFINE or REDEFINE a command do just that, L is now lol. Me personally I stay away from the default commands and use simpler methods like zzz xxx for custom commands.

Link to comment
Share on other sites

I did not know about UNDEFINE or REDEFINE. Looks like LT does not have it. Sounds perfect though. I use keyboard shortcuts. If I could assign zzz to a custom command I would for sure, that's a great idea.

Link to comment
Share on other sites

Hi all,

 

just to be clear. Someone has written a lisp routine in my offices called basesave which achieves the same thing as the macro in the original post. I never had any luck adding an alias to the button and running it from the command line.

 

Cheers

Link to comment
Share on other sites

Undefine etc. are not recognized in LT, and looking at your link Bigal they appear to be run by a startup LISP in full autocad, LT can run startup scripts, but no LISP. I still have found no other method other than the shortcut key combination with Ctrl, Shift or Alt, for custom commands (for keyboard control).

Link to comment
Share on other sites

Thanks steven-g

 

mickydee81 just add this to your acaddoc.lsp

 

; I dont know the command to run or do you just load it
(defun c:BSL () (load "basesave")(command "somethingorother"))

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