Author Topic: Non-coder rookie problem - Layer Dialogue Box  (Read 2808 times)

0 Members and 1 Guest are viewing this topic.

bancell

  • Guest
Non-coder rookie problem - Layer Dialogue Box
« on: April 14, 2010, 03:32:27 PM »
I have an issue.  Very long story short, new company....not allowed to edit .pgp file but we do have a work around....we can create a lisp file to mimic the pgp file.  All my lisp shortcuts seem to work except for a couple and they are:

(defun c:D  ()  (command "layer")    (princ))
typing in "layer" gives me dialogue box but routine only gives command line version.  Have tried .layer and * and _.  System variables *seem* ok since I get the dialogue box through the normal command line. 

The same happens with "close" and "plot".

With the command "open"  it just gives me "nil" (princ removed).

Are these special type commands that require some different coding?  I discovered with the express commands that they are lisp routines and needed to be called up differently than using the command prompt.  Any help would be greatly appreciated.  Thanks.

LE3

  • Guest
Re: Non-coder rookie problem - Layer Dialogue Box
« Reply #1 on: April 14, 2010, 03:36:17 PM »
i remember using.... the combination of:

(initdia)(command "layer")

bancell

  • Guest
Re: Non-coder rookie problem - Layer Dialogue Box
« Reply #2 on: April 14, 2010, 03:43:49 PM »
that worked for the layer and for plotting.  THANK YOU!!!!  Greatly appreciated!

Now I just need to solve the open and close.

LE3

  • Guest
Re: Non-coder rookie problem - Layer Dialogue Box
« Reply #3 on: April 14, 2010, 03:55:32 PM »
don't remember about open and plot - but guess that these commands needs or are part of a group (see if ARX or LSP commands output something), so you might need to search for that and use the prefix_ and command name in order to make it work, but not sure about it.... have been a while, that don't mess with macros.
« Last Edit: April 14, 2010, 04:01:36 PM by LE3 »

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Non-coder rookie problem - Layer Dialogue Box
« Reply #4 on: April 14, 2010, 04:07:19 PM »
filedia=1 and cmddia=1  ?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

johnm

  • Guest
Re: Non-coder rookie problem - Layer Dialogue Box
« Reply #5 on: April 14, 2010, 04:29:06 PM »
Just a thought, I would write a program that would replace my pgp file with the old one.
Copy your pgp file to a location (like c:\)
In AutoCAD go to tools then options then files tab and select support files search path and add the path to the location where you stored your pgp file
Open a drawing
Run the program
Program finds the old acad.pgp file and renames it to acad_old.pgp
Use a reactor so when the drawing is about to be closed it renames the old pgp file back to acad.pgp so next time a drawing is opend it has the original pgp file loaded
Then run the reinit program and have it reload the pgp file

You are not editing the file. AutoCAD looks an acad.pgp file in the support files search path if it doesn’t find it, it looks at the next path and so on.
I’m guessing about 10 lines of code.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Non-coder rookie problem - Layer Dialogue Box
« Reply #6 on: April 14, 2010, 05:08:04 PM »
I did something similar. In newer version of AutoCAD, you can place all pgp macros at the bottom. I have a bit of code that will write all my macros to the end of the acad.pgp file.


(initdia) works on most command calls that have a dialog/commandline version.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Serge J. Gianolla

  • Guest
Re: Non-coder rookie problem - Layer Dialogue Box
« Reply #7 on: April 14, 2010, 06:17:09 PM »
You can use the minus sign before the command to bypass a dialogue box too.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Non-coder rookie problem - Layer Dialogue Box
« Reply #8 on: April 14, 2010, 06:38:27 PM »
that worked for the layer and for plotting.  THANK YOU!!!!  Greatly appreciated!

Now I just need to solve the open and close.

Open and close don't work well with LISP, along with anything else which causes the active document to change.  If you are looking for something faster than a button or palette command tool, maybe consider adding the open and close macros to the default right-click menu.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}