Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PGP acting strange , returning incorrect commands

8 REPLIES 8
Reply
Message 1 of 9
was_saxman
571 Views, 8 Replies

PGP acting strange , returning incorrect commands

Hi All..........ACAD & PGP's  working fine on Friday, no one touches it all weekend, I am 1st in this morning.......I have my own set of user defined PGP commands in the USER defined section for the file, today a few of them are not calling up the correct commands, i.e. Q is my command for Quick Leader, ..today, Q calls up Match Properties,........I have re examined the PGP file....all is okay, searched that file to ensure Q  is only for quick leader and nowhere is it match prop......the command line says Q when I hit the Q key on my keyboard, I have even made up a new random PGP command for a different command, RX for Rotate......when I reinitialize,  that works correctly , so I also know that my ACAD is "looking" at this specific PGP file as well (I had to do that, because my R for Rotate does not work anymore) , my "xx" should be Match properties, now it calls up UCS (the only xx in the PGP file is Match Prop)

 

I have ACAD 2012, SP1 Win 7

 

anybody have any suggestions?, I am losing my mind here

 

Randy

 

8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: was_saxman

As extra sanity check, you can use:

 

(findfile "acad.pgp")

 

to confirm that AutoCAD is finding and using the right file location for the pgp file.

Message 3 of 9
was_saxman
in reply to: Anonymous

thanks John.....yup that shows the file ACAD is using/having problems with

Randy

Message 4 of 9
pbejse
in reply to: was_saxman


@was_saxman wrote:

thanks John.....yup that shows the file ACAD is using/having problems with

Randy


Are you saying the contents of the PGP  changes to another set of aliases? or it remains the same as you had it before? where Q is qleader and not _matchprop

 

One thing i can think of is a lisp code is running instead of the alias. as you are aware . lisp codes will have precedence over PGP alias.

 

to check if a command belongs to a lisp code

 (defun LispCom  (cmd)
      (car (member (strcase cmd)
                   (vl-remove-if-not
                         '(lambda (x) (wcmatch x "C:*"))
                         (atoms-family 1)))))

 

(Lispcom "C:Q") if the result is "C:Q" that means its calling  a lisp code, but if the result is nil then it is indeed an alias,

 

Not sure if this works for you though. worth a try

 

EDIT: if that is the case. there are 3 possible source where "Q" is defined as a funcion:

ACADDOC.. LSP , ACAD.LSP or at the starup suite.

You may need to dig in as to what  file the "Q" command is defined:

 

HTH
 

Message 5 of 9
was_saxman
in reply to: pbejse

Hi ..I gave that a try and it did return C:Q.........is that good or bad, ?

 

my PGP file does not change ..it reads as it should    Q,    *Qleader sames as the other alisaes I have defined

don't see anything in those other .lsp files....haven't changed anything in Startup in weeks/months

 

but nothing should be changed from Friday to this morning?.......

 

 

Message 6 of 9
pbejse
in reply to: was_saxman


@was_saxman wrote:

Hi ..I gave that a try and it did return C:Q.........is that good or bad, ?

 

my PGP file does not change ..it reads as it should    Q,    *Qleader sames as the other alisaes I have defined

don't see anything in those other .lsp files....haven't changed anything in Startup in weeks/months

 

but nothing should be changed from Friday to this morning?.......

 

 


Getting that result only proves that "Q" is called from a lisp code: Also you noticed that the PGP ddi not change at all.

Lisp codes are tricky, there could be a code that "calls" another lisp code that includes this line

 

(defun c:Q () (command "_matchprop")). or something similar

 

you may have to dig  deeper. using findfile and type in c:Q on "A word or phrase in the file" box (hopefully your search indexing is set to search unrecongized files).

 

You also mentioned you invoke REINIT. for acad.pgp. I guess that would reset the aliases (not sure , not really fond of PGP myself) so for that session your A-OK. but once you re-start autocad the lisp code embedded somewhere will take over again. PGP first then lisp codes.

 

I suggest you dig deeper was_saxman .

Message 7 of 9
scot-65
in reply to: was_saxman

Another thing to look for is the/your custom files that load on startup have crashed.

Editing one day, I caused an error in my MNL file and a command redefinition did not

work even though the error was later found to be after the redefinition statement.

 

???


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 8 of 9
Ian_Bryant
in reply to: was_saxman

Hi, Typing !C:Q at the command line will tell you if there has been a lisp version of the Q command loaded.

In this case Reinit of the PGP file won't help.

Typing (vl-acad-undefun 'C:Q) will disable the LISP version, and allow you to use the PGP alias, although the LISP version can still be used by typing (C:Q).

Typing (vl-acad-defun 'C:Q) will restore the LISP version.

This will work in current dwg session as a stop gap until you discover what is loading the LISP version and why.

Ian

Message 9 of 9
was_saxman
in reply to: was_saxman

HI  All...thanks for the tips.........turns out it was a personal customization .lsp file left on the machine by an employee who went on vacation and then quit..........I ended up using his machine after that, when mine blew a power supply.....

the only thing that puzzles me is that it worked fine for at least 2-3 weeks before it didn't one Monday morning....

 

Randy

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost