Author Topic: [AutoCAD 2008] how to control locked layer display fading use AutoLISP  (Read 4039 times)

0 Members and 1 Guest are viewing this topic.

e2002

  • Guest
       As we known that the command "laylck" in AutoCAD 2008, it can fading display the locked layers . but the command "laylck" can't select multiple objects at once (wish the next version of AutoCAD will support).

      About 3 years ago , i written a lisp function do the same as the command "laylck" , it still works in AutoCAD 2008 very OK, but i find a fifference between my function and command "laylck" : if using "laylck" , then fading display OK, if use my function "lkpt:Layer:Lock" ,the layers locked , but fading display is not support . my programming with ActiveX , not use (entget) (entmod) ...

     I want to know , is AutoCAD 2008 supply a new lisp function to control the locked layer's fading display ? or any method to control this with LISP develop ?

    I posted this question on Autodesk Discussion Group ( http://discussion.autodesk.com/thread.jspa?threadID=554850 ),
one answer told me the new system variable "LAYLOCKFADECTL" , but i read the help file i found the system variable not the right answer. would anyone can tell me the right answer ?
« Last Edit: March 24, 2007, 03:25:20 AM by e2002 »

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
I sure can't find any way to enable the fading in ActiveX....I get the same results that you describe in my own function.

Crank

  • Water Moccasin
  • Posts: 1503
I've just read on the Spago forum that layer fade control requires regening.
Perhaps you should set REGENAUTO on.
Vault Professional 2023     +     AEC Collection

whdjr

  • Guest
Why not use layiso.  It locks the layers that are faded so that you can't change them and it allows for multiple selection.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Hi there e2002,
The workaround until they get the COM API fixed is to set/reset the "LAYLOCKFADECTL" variable.
Code: [Select]
(defun c:lockLayers (/ activeDoc layList lays fadeSet)
(vl-load-com)
  (setq activeDoc(vla-get-activedocument (vlax-get-acad-object)))
  (setq layList'("Layer1"));;<<<---do whatever to get the list you want locked
  (setq lays (vla-get-layers activeDoc))
 (mapcar '(lambda (x)
     (vla-put-lock (vla-item lays x) :vlax-true)
     )
  laylist)
  (setq fadeSet(vla-getvariable activeDoc "LAYLOCKFADECTL"))
 
  (vla-setvariable activeDoc "LAYLOCKFADECTL" 0)
  (vla-setvariable activeDoc "LAYLOCKFADECTL" fadeSet)
  (princ)
)
« Last Edit: March 28, 2007, 11:18:57 AM by Jeff_M »