Author Topic: pedit thru lisp  (Read 2491 times)

0 Members and 1 Guest are viewing this topic.

viva

  • Guest
pedit thru lisp
« on: August 18, 2006, 03:32:00 AM »
hi everybody,
         i want 2 make the polyline  into single entity which is having similar value of  name field in object data  using pedit.  can anyone give me some idea to proceed

regards
vivek

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: pedit thru lisp
« Reply #1 on: August 18, 2006, 03:35:33 AM »
Like this ?
Code: [Select]
(defun c:ctp (/ ss)
  (prompt "\nSelect lines to join :")
  (if (setq ss (ssget))
    (vl-cmdf "_pedit" "M" ss "" "Y" "J" 0.0 "")
  )
)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

viva

  • Guest
Re: pedit thru lisp
« Reply #2 on: August 18, 2006, 03:51:13 AM »
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.

Code: [Select]
(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
« Last Edit: August 18, 2006, 08:48:14 AM by nivuahc »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: pedit thru lisp
« Reply #3 on: August 18, 2006, 04:30:11 AM »
What is code for ..
(ade_odgettables en) ?
(ade_odrecordqty en x) ?
(ade_odgetfield en x y cnt) ?
(ade_odtabledefn tbnam)


why this ?
(setq fis (cdr(assoc 10 enl)))

I'm trying to determine what the code is doing ..

.. and you may have to provide a sample drawing ..
« Last Edit: August 18, 2006, 04:52:30 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

viva

  • Guest
Re: pedit thru lisp
« Reply #4 on: August 18, 2006, 04:46:00 AM »
hi kerry
 that will get the table, record and field of the particular entity.

regards
vivek

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: pedit thru lisp
« Reply #5 on: August 18, 2006, 04:53:25 AM »
which Table, Record and Field ??
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: pedit thru lisp
« Reply #6 on: August 18, 2006, 04:54:23 AM »
ohhhh, this is Map ... yes ?

I can't help !
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

viva

  • Guest
Re: pedit thru lisp
« Reply #7 on: August 18, 2006, 05:12:02 AM »
hi kerry
     much appreciate for ur effort 2 help me.

regards
vivek