TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: mkweaver on April 19, 2011, 10:36:30 AM
-
I know where to find the information for layers frozen in viewports. How about layers with other overrides (color/lineweight/linetype)?
Thanks,
Mike
-
It's in the extension dictionary of the layers.
-
Thanks for the reply Tim. I haven't done much with extension dictionaries - time to do some studying.
Mike
-
This may help you in your quest:
http://www.theswamp.org/index.php?topic=35274.0 (http://www.theswamp.org/index.php?topic=35274.0)
-
Here are some codes I use to dig into entity data. If you want to step through layer 0, then call like
(ChaseEntData (tblobjname "layer" "0"))
(defun c:ChaseEntData (/ Sel)
(if (setq Sel (entsel))
(ChaseEntData (car Sel))
)
(princ)
)
;-----------------------------------------
(defun ChaseEntData (Ent / DiaRtn DataList)
(while
(and
Ent
(setq DiaRtn
(SingleSelectWide
(mapcar
'(lambda (x / tempType)
(if
(and
(equal (type (cdr x)) 'ENAME)
(setq tempType (cdr (assoc 0 (entget (cdr x)))))
)
(strcat
(vl-princ-to-string (car x))
"\t\t"
(vl-princ-to-string (cdr x))
" [ "
tempType
" ]"
)
(strcat
(vl-princ-to-string (car x))
"\t\t"
(vl-princ-to-string (cdr x))
)
)
)
(setq DataList (entget Ent '("*")))
)
"Select entity name to chase."
nil
)
)
)
(if (not (equal (type (setq Ent (cdr (nth (car DiaRtn) DataList)))) 'ENAME))
(setq Ent nil)
)
)
)
(defun SingleSelectWide (Listof Message Toggle / DiaLoad tmpStr tmpTog tmpList)
(setq DiaLoad (load_dialog "MyDialogs.dcl"))
(if (new_dialog "SingleSelectWide" DiaLOad)
(progn
(start_list "listbox" 3)
(mapcar 'add_list Listof)
(end_list)
(if Message
(set_tile "text1" Message)
)
(if (not Toggle)
(mode_tile "toggle1" 1)
)
(action_tile "listbox"
"(if (= $reason 4)
(progn
(setq tmpStr (get_tile \"listbox\"))
(if Toggle
(setq tmpTog (get_tile \"toggle1\"))
)
(done_dialog 1)
)
)"
)
(action_tile "accept"
"(progn
(setq tmpStr (get_tile \"listbox\"))
(if Toggle
(setq tmpTog (get_tile \"toggle1\"))
)
(done_dialog 1)
)"
)
(action_tile "cancel" "(done_dialog 0)")
(if (= (start_dialog) 1)
(progn
(setq tmpList (read (strcat "(" tmpStr ")")))
(if (= tmpTog "1")
(cons T tmpList)
tmpList
)
)
)
)
)
)
-
I stand in awe.
Thanks for the links and code. It looks like everything I might need will be covered.
Mike