PDA

View Full Version : ACAD.PGP weirdness



Railrose
2009-02-25, 07:48 PM
New quirk for the PGP file.

I have "sc" as the alias for Scale. I select the object I want to adjust, type sc, & I get surprised by other commands. Sometimes, it comes up as Insert, & most of the time, I get Circle. Sometimes, I get Scale. Does anyone have any ideas on what's causing this?

Oh yeah, I'm running ACAD 2009, with Raster Design 2009.

dzatto
2009-02-25, 07:54 PM
New quirk for the PGP file.

I have "sc" as the alias for Scale. I select the object I want to adjust, type sc, & I get surprised by other commands. Sometimes, it comes up as Insert, & most of the time, I get Circle. Sometimes, I get Scale. Does anyone have any ideas on what's causing this?

Oh yeah, I'm running ACAD 2009, with Raster Design 2009.
Not sure why insert would happen, but I'm guessing you're getting circle because the S isn't registering. Maybe your keyboard is going out?
Hit F2 next time you get something other than scale and see what was typed in at the command line.

Also, you're putting custom aliases at the end of your pgp file, right? The ones at the end will override the ones in the main body of the file. Make sure you don't have another alias set up.

scott.wilcox
2009-02-25, 07:54 PM
Perhaps you have a sticky key on your keyboard, and sometimes you get just a C instead of SC, that would explain the circle command.

Try mapping another alias to scale, perhaps M, it has no default alias.

If you select the object first, pick one of the objects grip boxes, hit the space bar 3 times and use the grip edit scale function.

Railrose
2009-02-25, 07:55 PM
The command line shows SC.

scott.wilcox
2009-02-25, 07:56 PM
Not sure why insert would happen, but I'm guessing you're getting circle because the S isn't registering. Maybe your keyboard is going out?
Hit F2 next time you get something other than scale and see what was typed in at the command line.

Also, you're putting custom aliases at the end of your pgp file, right? The ones at the end will override the ones in the main body of the file. Make sure you don't have another alias set up.

Type (findfile "acad.pgp") to see the location of the acad.pgp file that is loaded. There may be several in the support paths, but AutoCAD loads the first one it finds.

Railrose
2009-02-25, 07:57 PM
Nothing would surprise me on this thing. It is 4 years old, & corporate says they won't update for at least another year.

Railrose
2009-02-25, 07:59 PM
Type (findfile "acad.pgp") to see the location of the acad.pgp file that is loaded. There may be several in the support paths, but AutoCAD loads the first one it finds.

I've looked at the PGP file, but the only thing close is the c = circle.

Also, it just started, out of the blue.

dzatto
2009-02-25, 09:33 PM
Perhaps you have a sticky key on your keyboard, and sometimes you get just a C instead of SC, that would explain the circle command.

Try mapping another alias to scale, perhaps M, it has no default alias.

If you select the object first, pick one of the objects grip boxes, hit the space bar 3 times and use the grip edit scale function.
Isn't move set to M by default?

ccowgill
2009-02-26, 01:02 PM
Isn't move set to M by default?
it was on our machines.

Railrose
2009-02-26, 03:12 PM
It is on mine, too.

jaberwok
2009-02-26, 08:13 PM
"Y" is generally unused (as a command).

Railrose
2009-02-26, 08:20 PM
I guess I'll have to learn a new alias. :(

Shouldn't have to do that, but oh well. I set it as SF. Not overly logical, but all left-handed without reaching.

dzatto
2009-02-26, 10:00 PM
I guess I'll have to learn a new alias. :(

Shouldn't have to do that, but oh well. I set it as SF. Not overly logical, but all left-handed without reaching.


That's very logical!! That's why I changed G to "erase". I never use group, and I was tired of reaching over to the delete key. :beer:

rkmcswain
2009-02-26, 10:29 PM
I've looked at the PGP file, but the only thing close is the c = circle.

Also, it just started, out of the blue.

Lisp functions overwrite PGP definitions. Maybe a lisp function defined as SF is getting loaded somehow...?

Railrose
2009-02-27, 03:26 AM
Lisp functions overwrite PGP definitions. Maybe a lisp function defined as SF is getting loaded somehow...?

We haven't loaded any lisp goodies, so there shouldn't be any changes there.

rkmcswain
2009-02-27, 01:00 PM
We haven't loaded any lisp goodies, so there shouldn't be any changes there.

Just for grins, the next time you notice it happening, type !C:SF at the command line and see what it returns

Command: !C:sf

Coolmo
2009-02-27, 02:03 PM
You should be able to fix all of this by putting some Lisp code in your ACAD.LSP file (and make sure it loads with every open) that redefines "SC" to the command scale (See below). No matter what sets SC to something else, it'll be overwriiten by the ACAD.LSP code. Works every time.



(Defun C:SC() (Command "SCALE"))

Railrose
2009-02-27, 02:53 PM
Just for grins, the next time you notice it happening, type !C:SF at the command line and see what it returns

Command: !C:sf


You should be able to fix all of this by putting some Lisp code in your ACAD.LSP file (and make sure it loads with every open) that redefines "SC" to the command scale (See below). No matter what sets SC to something else, it'll be overwriiten by the ACAD.LSP code. Works every time.



(Defun C:SC() (Command "SCALE"))


Thanks. I'll see what happens.

It just seemed odd that it started out of the blue.

rkmcswain
2009-02-27, 04:05 PM
Thanks. I'll see what happens.

It just seemed odd that it started out of the blue.

I would agree with the thought of defining this (and other) shortcuts using LISP, so to avoid these types of problems. Except that the code should go in ACADDOC.LSP, instead of ACAD.LSP. By default, ACAD.LSP is only loaded once per session, and although there is a way to change this behavior, there is no reason to. That is what ACADDOC.LSP is for.

Railrose
2009-02-27, 05:06 PM
Took me a little while to find it. It's listed as acad2009doc.lsp.

Coolmo
2009-02-27, 06:18 PM
I would agree with the thought of defining this (and other) shortcuts using LISP, so to avoid these types of problems. Except that the code should go in ACADDOC.LSP, instead of ACAD.LSP. By default, ACAD.LSP is only loaded once per session, and although there is a way to change this behavior, there is no reason to. That is what ACADDOC.LSP is for.

The reason I suggested the acad.lsp file instead of the acaddoc.lsp is because we, as a company, pull from the acaddoc.lsp so we can all be on the same page when it comes to company standards and the loading of company programs. Our acaddoc.lsp is on our server and we all pull from this central file. However, the acad.lsp file can be loaded from YOUR computer and you can add your own custom stuff into it and it doesn't mess with anyone elses. I believe the acad.lsp loads with every file opened also. At least it does for me and the only thing I did is check the "load acad.lsp with every drawing" checkbox in the options dialog.

rkmcswain
2009-02-27, 06:30 PM
Took me a little while to find it. It's listed as acad2009doc.lsp.

No, do not modify this file. Yes, it will work, but the next time you do an upgrade, reinstall, repair, etc. you will have to do it all over.

If you can't find ACADDOC.LSP, then create your own (it's a "user" file, so it doesn't come with AutoCAD)

rkmcswain
2009-02-27, 06:33 PM
The reason I suggested the acad.lsp file instead of the acaddoc.lsp is because we, as a company, pull from the acaddoc.lsp so we can all be on the same page when it comes to company standards and the loading of company programs. Our acaddoc.lsp is on our server and we all pull from this central file. However, the acad.lsp file can be loaded from YOUR computer and you can add your own custom stuff into it and it doesn't mess with anyone elses. I believe the acad.lsp loads with every file opened also. At least it does for me and the only thing I did is check the "load acad.lsp with every drawing" checkbox in the options dialog.

1. We do the same thing, but both files load from the server.

2. Yes, if you check that setting on (ACADLSPASDOC=1), ACAD.LSP will load each time, but that is the R14 way of doing it, before MDI came around. In your particular case, I guess if it works for you, then so be it, but for a general user, ACAD.LSP is for items that only need to load once per session, and ACADDOC.LSP is for items that needs to load for each document.

Coolmo
2009-03-02, 01:16 PM
1. We do the same thing, but both files load from the server.

2. Yes, if you check that setting on (ACADLSPASDOC=1), ACAD.LSP will load each time, but that is the R14 way of doing it, before MDI came around. In your particular case, I guess if it works for you, then so be it, but for a general user, ACAD.LSP is for items that only need to load once per session, and ACADDOC.LSP is for items that needs to load for each document.

Will AutoCAD load every instance of ACADDOC.LSP it finds as long as it's in the search path? I guess my question is will it load the one from the server and then load my personal ACADDOC.LSP from my computer?

rkmcswain
2009-03-02, 01:55 PM
Will AutoCAD load every instance of ACADDOC.LSP it finds as long as it's in the search path?

No, only the first one it finds.

Another way to handle a situation like yours, where users require their own startup code, but still retain a central "acad.lsp" and "acaddoc.lsp" -- is to load a 'user' file from the main "acaddoc.lsp"



(load (strcat (getvar "loginname") ".lsp") (alert "User Lisp not found"))

scott.wilcox
2009-03-04, 05:33 AM
Isn't move set to M by default?

My bad, I meant N.

irneb
2009-03-04, 08:49 AM
That's very logical!! That's why I changed G to "erase". I never use group, and I was tired of reaching over to the delete key. :beer:Uhmmm ... isn't E already set to be ERASE? Still left side of keyboard :mrgreen:.

Railrose
2009-03-05, 07:05 PM
You should be able to fix all of this by putting some Lisp code in your ACAD.LSP file (and make sure it loads with every open) that redefines "SC" to the command scale (See below). No matter what sets SC to something else, it'll be overwriiten by the ACAD.LSP code. Works every time.



(Defun C:SC() (Command "SCALE"))


I did that, but am still getting the error. After getting the error, I type in
!c:sc & get
#<SUBR @172a371c C:SC>

I did narrow it down, a little. It only seems to happen after I paste a titleblock in that I copied from another drawing.

Gigliano70
2009-03-05, 07:27 PM
Maybe.....Your fingers are soo blazin fast you've smoked your keyboard and Autocad is havin trouble keeping up..... or..... thats what you tell your boss so you get a sweet upgraded keyboard with all the bells and whistles.

Railrose
2009-03-05, 07:48 PM
Hehehehe, yeah. That's it. It is due a replacement, along with the rest of the computer, but corp says I have to wait at least another year. This one is only 4 years old.

Coolmo
2009-03-05, 09:47 PM
I did that, but am still getting the error. After getting the error, I type in & get

I did narrow it down, a little. It only seems to happen after I paste a titleblock in that I copied from another drawing.

Is it possible that the titleblock has some sort of macro inside of it that overrides everything else as soon as it's dropped in?

What is typing !C:SC suppose to give you? I know that you can put the ! in front of lisp variables at the command line to see what they equal but so far, all that !C:functionname gives back is the

#<SUBR @172a371c C:SC>

Railrose
2009-03-05, 09:51 PM
The title block has never caused issues, until recently.

R. K. McSwain said to type !C:SC to see what I get when it does it again, so I did. I don't know what it means, so I posted it to see if anyone else does.

Railrose
2009-03-05, 09:52 PM
The only thing I can figure is that my machine was formatted, & everything reloaded a few months ago, & I'm still finding squirrels in it. It originally had Win 2K, but had to be formatted to run WinXP.

rkmcswain
2009-03-05, 11:06 PM
What is typing !C:SC suppose to give you?

If SC is NOT defined as a lisp function, it will return "nil".
What you are getting shows it's defined as a lisp function.
Lisp functions override PGP shortcuts.

irneb
2009-03-06, 04:23 AM
Did you do the !C:SC after you added Coolmo's code to the ACAD.LSP file? That will always give a Lisp function, as you've just redefined to be such. Remove the code from that file, restart ACAD and run !C:SC again.

BTW, Coolmo's code may work better if you place it in any LSP file and load it through APPLOAD's Startup Suite. This is becaus ACAD.LSP gets loaded, then ACADDOC.LSP, then any MNL files, then last Startup Suite. So placing the code in ACAD.LSP could still be overwritten by offending code in any of the others.

Coolmo
2009-03-06, 01:25 PM
That's a great idea. Keep all of your shortcuts and other goodies in a personal Lisp Routine that can be modified and transfered to anywhere you go (or to another computer). That way, no matter what gets loaded, your stuff will always load last and you'll know exactly wher it's loading from.

I do the same thing with all of my menus and toolbars too. Changing the menus and toolbars provided by AutoCAD with the CUI basically forces you to take extra steps if you need to reinstall or start from scratch with another version.