谢谢比尔。这并不是我真正想要的,尽管它也很有用。谢谢你教我如何调整箭头大小。我要做的是选择在一端指向同一方向的双箭头。下面是我试图调整的代码,以便它可以做到这一点,不幸的是,我的第二个箭头是线的长度!问题的一部分是我也不理解原始代码的一半。
- (defun c:pidarrow1 (/ Ent EntName Point Points FirstPt)
- (and
- (setq Ent (entsel "\nSelect Line near Arrow End: ");list of entity properties
- Point (cadr Ent)
- EntName (car Ent);entity name
- Ent (entget EntName)
- )
- (= (cdr (assoc 0 Ent)) "LINE")
- (progn
- (setq Points (list (cdr (assoc 10 Ent)) (cdr (assoc 11 Ent))))
- (if (< (distance Point (car Points))
- (distance Point (cadr Points))
- )
- (setq Points (reverse Points))
- )
- (setq FirstPt (car(reverse Points)))
- (setq SecondPt (polar (cadr Points)(apply 'angle Points)-2.5))
-
- (entmakex
- (append
- (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity"))
- (vl-remove-if
- (function
- (lambda (g) (vl-position (car g) '(-1 0 5 100 10 11 210)))
- )
- Ent
- )
- (list (cons 100 "AcDbPolyline") (cons 90 4) (cons 70 0))
-
- (if (or (= (setq op (strcase (getstring "\nDo you want a double arrow head? (Yes or No): "))) "Y")
- (= op "YES"))
- (progn
- (list (cons 10 (polar FirstPt (apply 'angle Points) 2.5));length of arrow
- (cons 40 0.)
- (cons 41 0.83333)))); width of arrow
- (mapcar (function (lambda (p) (cons 10 p))) Points)
- (list (cons 40 0.83333); width of arrow
- (cons 41 0.)
- (cons 10 (polar (cadr Points) (apply 'angle Points) 2.5)));length of arrow
- ))
- )
- (entdel EntName)
- (princ)
- )
- )
|