Author Topic: Layer Previous  (Read 2767 times)

0 Members and 1 Guest are viewing this topic.

DanB

  • Bull Frog
  • Posts: 367
Layer Previous
« on: October 05, 2011, 04:30:16 PM »
Using the following code:
Code: [Select]
  (defun c:lp ()
   (command ".layerp")
  )

Why do I not get the various outputs at the command line, such as "Restored previous layer status." or "*No previous layer status*" that I get if I type "layerp" on the command line? I have other similar shortcuts I have made for ".laycur" and ".laymcur" that still continue to show their respective outputs.

Thanks
Dan

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Layer Previous
« Reply #1 on: October 05, 2011, 04:39:35 PM »
Check your CMDECHO variable.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Ketxu

  • Newt
  • Posts: 109
Re: Layer Previous
« Reply #2 on: October 05, 2011, 11:04:14 PM »
Check your CMDECHO variable.
Right, Set it's value back to 1 and problem will be solved. If in some of your rountine you set it to 0 at begin, you should re-set it's value at the end

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: Layer Previous
« Reply #3 on: October 06, 2011, 02:35:28 AM »
If you just make shortcuts, you also can use aliases wich will fire the command instead of running it inside lisp.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Layer Previous
« Reply #4 on: October 06, 2011, 04:30:00 AM »
I think we're missing something here. CmdEcho? Are you sure? That's not going to affect the text displayed from inside the LayerP command is it? I thought that would turn on/off the display of issuing the LayerP command onto the command-line.

Now NoMutt may have an influence ... I'd think.

But!  :laugh: I think we're going too far with this. The code tells me there's a nil that will display on the command line. And as people generally make the command-line as small as possible, this probably scrolls the LayerP's message off-screen.

So try modifying your code thus:
Code: [Select]
(defun c:lp ()
  (command "_.LayerP")
  (princ)
)
That should sort out the nil at the end of the "shortcut".
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

DanB

  • Bull Frog
  • Posts: 367
Re: Layer Previous
« Reply #5 on: October 06, 2011, 09:03:01 AM »
I at one point I did have the (princ) in my code and my cmdecho was in fact set to zero(0). Changing it to one(1) has gotten the desired results.

If anyone cares to share a different approach it is welcome but I have a startup LISP routine that loads my custom routines as well as where I create small codes for my own command aliases. This is how I track my own preference settings and customization.

Thanks for feedback.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Layer Previous
« Reply #6 on: October 06, 2011, 03:13:12 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.