另一个是UCS OB,如果说插入旋转为零,则文本的旋转为零,然后UCS W
如果你真的需要得到顶点,你需要看距离1-2和2-3来计算更长的距离,但即使这样,你也可能得到顶部而不是底部。
- (defun plcords (/ ent obj plobs )
- (vla-load-com)
- (defun getcoords (ent)
- (vlax-safearray->list
- (vlax-variant-value
- (vlax-get-property
- (vlax-ename->vla-object ent)
- "Coordinates"
- )
- )
- )
- )
- (defun co-ords2xy ( / I)
- ; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z
- (setq numb (/ (length co-ords) 2))
- (setq I 0)
- (repeat numb
- (setq xy (list (nth (+ I 1) co-ords)(nth I co-ords) ))
- (setq coordsxy (cons xy coordsxy))
- (setq I (+ I 2))
- ) ; end repeat
- )
- (setq plobjs (ssget (list (cons 0 "lwpolyline"))))
- (setq numb1 (sslength plobjs))
- (setq x numb1)
- (repeat numb1
- (setq obj (ssname plobjs (setq x (- x 1))))
- (setq co-ords (getcoords obj))
- )
- (co-ords2xy)
- (setq inc (length coordsxy))
- (repeat (/ inc 2)
- (setq x (rtos (nth (setq inc (- inc 1)) co-ords) 2 3 ))
- (setq y (rtos (nth (setq inc (- inc 1)) co-ords) 2 3 ))
- (setq xy (strcat x "," y ))
- (princ xy)
- (princ "\n ")
- )
- )
- (plcords)
|