这是一个pline坐标系,它列出了顶点列表。你只需要一个entsel,然后检查它是一个pline还是一条line等等。我最近发布了一些东西,它可以满足你的大部分需求。将尝试查找。
- ; pline co-ords example
- ; By Alan H
- (defun getcoords (ent)
- (vlax-safearray->list
- (vlax-variant-value
- (vlax-get-property
- (vlax-ename->vla-object ent)
- "Coordinates"
- )
- )
- )
- )
- (defun co-ords2xy ()
- ; 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 co-ords)(nth (+ I 1) co-ords) ))
- (setq co-ordsxy (cons xy co-ordsxy))
- (setq I (+ I 2))
- )
- )
- ; program starts here
- (setq co-ords (getcoords (car (entsel "\nplease pick pline"))))
- (co-ords2xy)
- ; look at varaible co-ordsxy which is a list of vertices
- (princ co-ordsxy)
|