SunnyTurtle Posted May 3, 2011 Posted May 3, 2011 Hi all I am having a problem with the TORIENT command which aligns text and other stuff to a particular angle for example a line Now i am very lazy and have millions of text to align with different line i wanted to make a shortcut to this command an i created this lisp [font=Tahoma](defun c:to () (command "torient"))[/font] But I doesn't work for me it says that it is an unknown command. But when I type it in manually it works fine If this helps there is a variable torient i looked that up using !torient Quote
Cad64 Posted May 3, 2011 Posted May 3, 2011 You don't need a lisp routine for this. Just put a command alias in your pgp file. Quote
Lee Mac Posted May 3, 2011 Posted May 3, 2011 Just for completeness: Since TOrient is an Express Tool command, it cannot be called using the command function in LISP, instead you can call it using: (defun c:to nil (c:torient)) Quote
alanjt Posted May 3, 2011 Posted May 3, 2011 You don't need a lisp routine for this. Just put a command alias in your pgp file. *cough*AGREE*cough* Quote
SunnyTurtle Posted May 4, 2011 Author Posted May 4, 2011 Just for completeness:Since TOrient is an Express Tool command, it cannot be called using the command function in LISP, instead you can call it using: (defun c:to nil (c:torient)) This works well thanks it is just a simple lisp now but i have a lisp that im working on that could use this command as well Thanks Lee Mac You don't need a lisp routine for this. Just put a command alias in your pgp file. Where do you find the pgp file and is it like a short cut registry or something Quote
Cad64 Posted May 4, 2011 Posted May 4, 2011 Where do you find the pgp file and is it like a short cut registry or something The pgp file contains all of your command aliases. You can access it from within Autocad by going to the Tools menu > Customize > Edit Program Parameters (acad.pgp). The file will open in Notepad and you can edit existing aliases or add your own at the bottom, in the "User Defined" section. Here's another way to create command aliases through the Express Tools Alias Editor: http://www.ellenfinkelstein.com/AutoCAD_tips_create_alias.html Whatever way you choose to edit your pgp file, you will need to run the REINIT command after editing in order for your changes to take effect. Note: Whenever making changes to any files, be sure to save an unedited backup copy, in case you royally screw it up. :wink: Quote
irneb Posted May 5, 2011 Posted May 5, 2011 Whatever way you choose to edit your pgp file, you will need to run the REINIT command after editing in order for your changes to take effect.If you use the Express Tools "Command Alias Editor" you don't need to run ReInit afterwards. :wink: Quote
SunnyTurtle Posted May 26, 2011 Author Posted May 26, 2011 Hi again this it being a while since i fixed this problem but i am have the same problem again but a little different this time. I am trying to create a shortcut to a lisp. Now if i had the ablity to edit this lisp i would just change the (defun c:ncopy ()..... to (defun c:nc ()....... but i don't have access to it or at least i don't think i do. So is there a way to shortcut the a lisp (defun c: nc () (command ncopy)) This does not work so what am i doing wrong Quote
CHLUCFENG Posted May 26, 2011 Posted May 26, 2011 Slight modification... (defun c:nc () (c:ncopy) ) Quote
CHLUCFENG Posted May 26, 2011 Posted May 26, 2011 agreed. Sometimes folks may want a temporary override for a command alias. It is still not good practice to modify native AutoCAD command aliases. Check the ACAD.pgp and add aliases that are not currently in use, otherwise, it drives your CADD Department Manager up a wall when trying to troubleshoot what went haywire on your machine. :wink: Also, the CADD Manager usually has a few tricks up his/her sleeve that can truly tweak your machine back into submission! I might even resemble that remark. Quote
Recommended Posts
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.