hi kerry
thanks for ur worthy information.actually i dont want 2 select any polyline. by running lisp it wants 2 check the name field and join when it contains the same value. i had written the code 2 check out the name field from object data. after that i dont know how 2 proceed.
(defun c:CHK_PL()
(command "zoom" "e")
(setq echo (getvar "cmdecho")
osmode (getvar "osmode"))
(setvar "CMDECHO" 0)
(setvar "OSMODE" 0)
(setq layername(getstring "enter the route layer :"))
(setq layinfo(ssget "x" (list(cons 0 "lwpolyline")(cons 8 layername ))))
(if layinfo
(progn
(setq leng(sslength layinfo))
(setq no 0)
(repeat len
(setq enl(entget(ssname layinfo no)))
(setq fis(cdr(assoc 10 enl)))
(setq en(cdr(assoc -1 enl)))
(setq tblst (ade_odgettables en) lst2 nil)
(foreach x tblst
(setq lst1 nil recqty (ade_odrecordqty en x) cnt 0)
(foreach y (ODGFLD x)
(setq cnt 0
(repeat recqty
(setq lst1 (cons (list y (ade_odgetfield en x y cnt) cnt) lst1))
(setq cnt (1+ cnt))
) ;CLOSE REPEAT
) ;CLOSE FOREACH
) ;CLOSE FOREACH
(if ( /= lst1 nil)
(progn
(setq zv(assoc "NAM" lst1))
(setq res(cdr zv))
(setq second(nth 0 res))
))
(setq no (+ no 1))
)
)
(alert "There is no polyline"))
)
(defun odgfld (tbnam / lst tbdef)
(setq lst nil)
(if (setq tbdef (ade_odtabledefn tbnam))
(progn ;THEN
(foreach x (cdaddr tbdef) (setq lst (cons (cdr (assoc "ColName" x)) lst)))
(setq lst (reverse lst))
) ;CLOSE THEN PROGN
(setq lst nil)
) ;CLOSE IF
(setq lst lst)
) ;CLOSE FUNCTION ODGFLD (Object Data Get Fields - Returns List of Fields)
regards
vivek
EDIT: Wrapped your code in [ code ] tags for ya