to extrude with text in polyline

to extrude with text in polyline

anycganycgJ8A6A
Advocate Advocate
907 Views
1 Reply
Message 1 of 2

to extrude with text in polyline

anycganycgJ8A6A
Advocate
Advocate

hi   i need some help ~

i found this code .

but there is error.

 

that code is   extrude with text.

 

there is  polyline ,  and   text in polyline.

if i select polyline ,    i would like to extrude   obj  as  txt value  .

 

 

(defun c:txtb (/ ss i sn pts n s in psn)
 ;
  (if (setq ss (ssget '((0 . "*POLYLINE"))))
 
 
  (repeat (setq i (sslength ss))
  
     (setq sn (ssname ss (setq i (1- i))))
    
    
      (if (and (vlax-curve-isclosed sn)
         (eq (- (fix (vlax-curve-getendparam sn)) (fix (vlax-curve-getstartparam sn))) 4)
       )
      
      
       (progn
           (foreach x (entget sn)
          (if (eq (car x) 10)
            (setq pts (cons (list (cadr x) (caddr x)) pts))
          )
           )
          
           ( if (setq s (  ssget "_WP" pts '((0 . "text"))  )   )
           
           (progn
           
            (setq en (ssname s 0))
            (setq elist (entget en))
            (setq txt (cdr (assoc 1 elist)))
            (setq sum  (atof txt) )
            (command "extrude"  en  "" sum  "" )
            
           )
           
          )
         )
      
      
      
      
     )
  )
    
    )
  )
  (princ)

0 Likes
Accepted solutions (1)
908 Views
1 Reply
Reply (1)
Message 2 of 2

Kent1Cooper
Consultant
Consultant
Accepted solution

If I understand correctly what you want, try changing this:

 

(command "extrude"  en  "" sum  "" )

 

to this:

 

(command "extrude"  sn  "" sum  "" )

 

The 'en' variable is the Text  object, but the Polyline  object is 'sn'.

Kent Cooper, AIA
0 Likes