第一个问题,你想一个半径为所有如果是这样,那么在这里搜索的代码已经完成。此外,最好以弧度重新调整角度,因为这是autocad的默认值,但请注意,零位于东方,并且它们是按时钟测量的。
您可以将pline的co ORD作为一个列表,因此您只需使用pt1 pt2、pt2 pt3在lisp中获取角度(角度pt1 pt2)
下面是一个co ord lisp示例
- ; 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 len (length co-ords))
- (setq numb (/ len 2)) ; even and odd check required
- (setq I 0)
- (repeat numb
- (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
- ; odd (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) 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) ; list of 2d points making pline
- (princ co-ordsxy)
像这样的选择是两分
|