Author Topic: Viewport layer overrides? Where is the data  (Read 2107 times)

0 Members and 1 Guest are viewing this topic.

mkweaver

  • Bull Frog
  • Posts: 352
Viewport layer overrides? Where is the data
« 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

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Viewport layer overrides? Where is the data
« Reply #1 on: April 19, 2011, 10:37:58 AM »
It's in the extension dictionary of the layers.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

mkweaver

  • Bull Frog
  • Posts: 352
Re: Viewport layer overrides? Where is the data
« Reply #2 on: April 19, 2011, 11:36:45 AM »
Thanks for the reply Tim.  I haven't done much with extension dictionaries - time to do some studying.

Mike

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Viewport layer overrides? Where is the data
« Reply #3 on: April 19, 2011, 11:46:57 AM »
This may help you in your quest:

http://www.theswamp.org/index.php?topic=35274.0

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Viewport layer overrides? Where is the data
« Reply #4 on: April 19, 2011, 12:04:23 PM »
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"))

Code: [Select]
(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)
        )
    )
)
Code: [Select]
(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
)
)
)
)
)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

mkweaver

  • Bull Frog
  • Posts: 352
Re: Viewport layer overrides? Where is the data
« Reply #5 on: April 19, 2011, 04:02:30 PM »
I stand in awe.

Thanks for the links and code.  It looks like everything I might need will be covered.

Mike