Jump to content

Running a custom command (CUI button) from the commandline


mickydee81

Recommended Posts

Hi all,

 

I have made a button for saving an xref

 

^C^C-LAYER;S;0;F;*;;QSAVE;

 

changes layer to 0 and freezes all layers and saves.

 

is there a way that I can run this button from the command line??

 

Any help would be appreciated

 

Cheers, Have a good one.

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

Yes there is.

You can create a new command, and incorporate this macro into the definition.

Once you have done that you can use ALIASEDIT to define a shortcall for it.

Link to comment
Share on other sites

Hi Dadgad,

 

thanks for the help. Do I create the new command in cui? is this the same as creating a custom button?

 

Cheers

Link to comment
Share on other sites

In the screenshot you can see where you can right click on any named command and a drop down menu will give you the option of NEW COMMAND.

Name it, then insert your macro on the right hand side, in the highlighted box. Save it.

Then you can use ALIASEDIT to create your shortcall for it.

You can also define a toolbar image for it at the top of the right hand dialog, so that if you want to add it to any toolbars you can recognize it.

creating a new command and entering macro in cui.jpg

Link to comment
Share on other sites

Another way is to add lots of little lisp defuns, you make your own master lisp and use appload to load then make sure you add it to "history" in appload.

 

Ask for others you may want, this example will grow exponentially I have around 30 in my autoload.

 

Almost forgot you can also add predefined commands by copying the code from the CUI.

 

; save as "mylisps.lsp" etc
(defun c:Lofq ()
(command "-LAYER" "S" "0" "F" "*" "" "" "QSAVE")
)
(defun c:ze ()
(command "Zoom" "E")
)

[/code]

Link to comment
Share on other sites

  • 4 weeks later...
Yes there is.

You can create a new command, and incorporate this macro into the definition.

Once you have done that you can use ALIASEDIT to define a shortcall for it.

 

Hey Dagdad, can I quiz you about this? I thought you could not call custom commands from the autocadlt.pgp Alias Edit. I was excited to read your post and so I had another attempt. Still nothing. Maybe it is an LT limitation.

 

For example, could I make a macro that drew a line from 0,0 to 10,0 (L;0,0;10,0;;), assign it to LL in my pgp file and expect that macro to run when I type LL[enter]?

 

Can anyone else confirm they can do this? Does anyone know if it is possible or not on LT?

 

Thanks!

Link to comment
Share on other sites

I was not aware that it could not be done, seems like you should be able to, as long as you define a NEW COMMAND first.

I will give it a try.

Link to comment
Share on other sites

I certainly have never had any luck with that, you can create keyboard shortcuts for custom commands, they require the use of the Ctrl, Shift or Alt keys (or combination)

Link to comment
Share on other sites

I certainly have never had any luck with that, you can create keyboard shortcuts for custom commands, they require the use of the Ctrl, Shift or Alt keys (or combination)

 

Well, I am certainly inclined to take your word for it steven, in light of your considerable mastery of custom macros, familiarity with, and penchant for LT Magic!

I am very happy you showed up, as I have sitting here for some time trying to figure out a way to do it, unaware that you had already joined the thread.

You have saved me a lot more time which would have been frittered away trying to do it. :beer:

 

Sorry for falsely raising your hopes YZ. :|

Link to comment
Share on other sites

Haha, no problem. I'm glad to put it to bed.

 

About 2 months ago I finally created my first keyboard shortcut command using CTRL+1, 2, & Q. And also changed some of the Function keys. It is a really powerful thing.

 

When I saw this I thought perhaps I was just too green to get it working and gave up to easily way back when I first tried. It does seem to me to be a good and easy thing for AutoDesk to implement.

 

It seems the OP got it sorted. Must be an LT restriction. Thanks again guys.

Link to comment
Share on other sites

Please don't anybody give up on my account, I would love to find a way to get it to work, maybe I'm just missing something, and having to use two or more keys together is just such a hassel , so I use toolpalettes and toolbars instead.

Link to comment
Share on other sites

The few of these that I have done, I have always placed as icons on custom toolbars too, I am surprised to find that it either can't be done, or is so difficult to do at the commandline.

Edited by Dadgad
Link to comment
Share on other sites

  • 2 weeks later...
is there anything that is assumed that should be done here. because i still cannot find my command in the alias editor listing.

 

Alias editor?

 

Are you referring to the acad.pgp file?

Link to comment
Share on other sites

i dont know. just following the instructions at the top of the page you go from the CUI to the alias editor. is there something inbeetween that needs to be done to get the command that was made to show up in the alias editor as mentioned above?

Link to comment
Share on other sites

Dadgad provided the explanation in post #4. The acad.pgp file, where command aliases are stored, and the CUI are two totally different creatures. Maybe you added your new alias to the wrong part of the file.

Link to comment
Share on other sites

I never edited my pgp. His original post says nothing about editing the pgp. Is that what I need to do? It sounds like you are assuming that I already knew to do this.

Link to comment
Share on other sites

Dadgad reference the ALIASEDIT command which is one way to eidt the acad.pgp file.

 

Are you trying to create a new command alias? Yes or no?

 

Another option would be to follow BIGAL's advice in post #7 re: little lisp routines. There are two or three different ways these can be loaded.

Edited by ReMark
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...