Author Topic: Creating a Layerstate Reactor  (Read 4878 times)

0 Members and 1 Guest are viewing this topic.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Creating a Layerstate Reactor
« Reply #15 on: February 22, 2018, 07:04:40 PM »
OOPS

In BricsCAD I get this message:

Error: bad argument type <NIL> ; expected ENTITYNAME at [layerstate-restore]
; LISP execution error : inside <LAYERSTATE-CALLBACK> at [VLR-Miscellaneous-Reactor:vlr-layoutSwitched]
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Creating a Layerstate Reactor
« Reply #16 on: February 23, 2018, 07:55:28 AM »
OOPS

In BricsCAD I get this message:

Error: bad argument type <NIL> ; expected ENTITYNAME at [layerstate-restore]
; LISP execution error : inside <LAYERSTATE-CALLBACK> at [VLR-Miscellaneous-Reactor:vlr-layoutSwitched]

This is due to BricsCAD's implementation of the layerstate-restore function - evidently the viewport argument is not considered optional in BricsCAD.

This will require a support request to BricsCAD to resolve.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Creating a Layerstate Reactor
« Reply #17 on: February 23, 2018, 08:38:21 AM »
... In the interim: use the BricsCAD vl-layerstates-restore function.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Creating a Layerstate Reactor
« Reply #18 on: February 23, 2018, 11:44:42 AM »
Thanks

I posted this error to the BricsCAD forum.
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

GDF

  • Water Moccasin
  • Posts: 2081
Re: Creating a Layerstate Reactor
« Reply #19 on: April 15, 2018, 11:13:59 AM »
Will the following work?

(setq program (substr (getvar "acadver") 6 (- (strlen (getvar "acadver")) 1)))
(cond
             ((= program "BricsCAD")(vl-layerstates-restore (getvar "ctab") 6 NIL 0))
             ((/= program "BricsCAD")(layerstate-restore las      nil 255)))
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

GDF

  • Water Moccasin
  • Posts: 2081
Re: Creating a Layerstate Reactor
« Reply #20 on: April 15, 2018, 05:38:28 PM »
Made some other changes...it now works.

(setq program (substr (getvar "acadver") 6 (- (strlen (getvar "acadver")) 1))) 
(if (= (getvar "program") "BRICSCAD")
              (vl-layerstates-restore (getvar "ctab") 6 NIL 0)
              (layerstate-restore las      nil 255)
            ) 
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Creating a Layerstate Reactor
« Reply #21 on: April 16, 2018, 09:54:07 AM »
Gary,

You could also do something like this:
Code - Auto/Visual Lisp: [Select]
  1. (if vl-layerstates-restore
  2.   (vl-layerstates-restore (getvar "ctab") 6 nil 0)
  3.   (layerstate-restore las nil 255)
  4. )

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC