Author Topic: lisp to Save Layer state by Date and Time  (Read 2189 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
lisp to Save Layer state by Date and Time
« on: June 03, 2015, 04:55:47 PM »
Is there a routine that can save a layer state by Date and Time?
Civil3D 2020

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: lisp to Save Layer state by Date and Time
« Reply #1 on: June 04, 2015, 06:57:23 AM »
unless I am missing something, could you explain how you would expect to create the layer state a bit more, ie. automatically at set intervals, upon the selection of a different pspace tab or other triggering event.  You could just incorporate the date and time in the name of the layer state.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: lisp to Save Layer state by Date and Time
« Reply #2 on: June 04, 2015, 07:44:23 AM »
Sure, I have created at macro that will toggle all the layers on and off with associated colors within the Tool Palette. I am trying to create a command that will backup the current layer state (Again by a time or whatever) then the layer change gets applied. I would like the layer state to be there; in case I need to roll back to the previous layers.
Civil3D 2020

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: lisp to Save Layer state by Date and Time
« Reply #3 on: June 04, 2015, 02:08:03 PM »
There are a number of built-in layerstate functions including: layerstate-save. These functions handle most of the work, so you do not need a lot of code.
Code - Auto/Visual Lisp: [Select]
  1. (defun c:LayStBu ()
  2.   (layerstate-save (strcat "Backup_" (rtos (getvar 'cdate) 2 8)) nil nil)
  3.   (princ)
  4. )

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: lisp to Save Layer state by Date and Time
« Reply #4 on: June 04, 2015, 02:15:41 PM »
You saved the world for me! lol. Thank you,.
Civil3D 2020