PDA

View Full Version : Accessing embedded object data


anderson.scottglen
2007-03-05, 11:46 PM
My company just got a few huge GIS base map file full of polylines and no text for a few counties. Navigating it for the linework you need is an ordeal, especially if you're not familiar with the area. There is data stored within the polylines however, I've attached an image of the properties pane to clarify. I'm not familiar with dictionary entities, but I don't think this applies. I did a (ssget '((0 . "DICTIONARY"))) and it returned nil, but I could still be wrong, sure.

What I would simply like to do is write a routine to prompt for a string (street name), wildcard search the STREETNAME field for matches, add those matches to a selection set and perform a zoom object on that set. That plan might need tweaking, but that's where I'd start.

An (entget (car (entsel))) on the polyline in the image returns this data, so I am unsure of how to proceed:((-1 . <Entity name: 7d4a6140>) (0 . "LWPOLYLINE") (5 . "6E1B0")
(102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 7d4a6148>) (102 . "}") (330 .
<Entity name: 7bd9acf8>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"PC_Roads") (100 . "AcDbPolyline") (90 . 17) (70 . 0) (43 . 0.0) (38 . 0.0) (39
. 0.0) (10 6.75329e+006 2.06806e+006) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10
6.75328e+006 2.06813e+006) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 6.75328e+006
2.06815e+006) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 6.75328e+006 2.06816e+006)
(40 . 0.0) (41 . 0.0) (42 . 0.0) (10 6.75328e+006 2.06818e+006) (40 . 0.0) (41
. 0.0) (42 . 0.0) (10 6.75328e+006 2.0682e+006) (40 . 0.0) (41 . 0.0) (42 .
0.0) (10 6.75328e+006 2.06822e+006) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10
6.75328e+006 2.06824e+006) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 6.75328e+006
2.06826e+006) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 6.75328e+006 2.06828e+006)
(40 . 0.0) (41 . 0.0) (42 . 0.0) (10 6.75328e+006 2.0683e+006) (40 . 0.0) (41 .
0.0) (42 . 0.0) (10 6.75328e+006 2.06833e+006) (40 . 0.0) (41 . 0.0) (42 . 0.0)
(10 6.75328e+006 2.06835e+006) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10
6.75328e+006 2.06837e+006) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 6.75328e+006
2.06839e+006) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 6.75328e+006 2.06841e+006)
(40 . 0.0) (41 . 0.0) (42 . 0.0) (10 6.75328e+006 2.06843e+006) (40 . 0.0) (41
. 0.0) (42 . 0.0) (210 0.0 0.0 1.0))

This leads me to believe this is beyond the capabilities of LISP, but I don't know where to look. That's all I'm asking for really. Thanks!

T.Willey
2007-03-06, 12:16 AM
Dictionaries are there own objects. Then can not be searched for with 'ssget' as they are not graphical. Picked one of the polylines with see and see what it returns.

(entget
(cdr
(assoc
360
(entget
(car
(entsel)
)
)
)
)
)

rpstraiton
2009-04-09, 08:41 PM
I was hoping that this thread would have kept going, cause I am looking for the exact same info. I have a bunch of polylines brought over from GIS. Instead of looking from a STREETNAME, I am trying to get a CON_NUM & LOT_NUM to label. I ran that code and got the following:

Select object: ((-1 . <Entity name: 7efc3f40>) (0 . "DICTIONARY") (330 .
<Entity name: 7efc3f38>) (5 . "98") (100 . "AcDbDictionary") (280 . 1) (281 .
1) (3 . "*A1") (360 . <Entity name: 7efc3f48>))

I then searched the dictionary to see what records and got this:
(dictsearch ent2 "*a1")
((-1 . <Entity name: 7ed0bba8>) (0 . "IRD_OBJ_RECORD") (5 . "1E65") (102 .
"{ACAD_REACTORS") (330 . <Entity name: 7ed0bba0>) (102 . "}") (330 . <Entity
name: 7ed0bba0>) (100 . "CIrdBaseRecord") (1070 . 516) (1071 . 1) (1004 .
"01003000000042004C004F0043004B002000410000004F0E0000") (100 . "CIrdObjRecord")
(330 . <Entity name: 7efc3e98>))

I can't see anywhere where it has the LOT_NUM and/or CON_NUM labels. Anyone have any ideas?

T.Willey
2009-04-09, 08:57 PM
I can't be of much help, as I don't have LDD, and the entities come in as proxy graphic since I don't, but I would search the enames to see if they have the info you want. I wrote a little program that will let you see what is what with enames. No error checking, and will only work if you pick on an ename from the dialog, but it might help shed some light on the problem for you.

Dialog definition attached. Just place in a search path, and type ' ChaseEntData ' to run the command. Select the polyline, and then go from there.


(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
)
)
)
)
)
)