 - (defun c:bpl ( / _block _ang b e i j p s )
- (if
- (and
- (setq b (LM:ssget "\nSelect Block to Align: " '("_+.:E:S" ((0 . "INSERT")))))
- (setq s (LM:ssget "\nSelect LWPolylines: " '(((0 . "LWPOLYLINE")))))
- )
- (progn
- (eval
- (list 'defun '_block '( p r )
- (list 'entmake
- (list 'list
- ''(0 . "INSERT")
- '(cons 10 p)
- '(cons 50 r)
- (list 'quote (assoc 2 (entget (ssname b 0))))
- )
- )
- )
- )
- (defun _ang ( e p )
- (apply 'atan (cdr (reverse (vlax-curve-getfirstderiv e p))))
- )
- (repeat (setq i (sslength s))
- (setq e (ssname s (setq i (1- i))))
- (_block (vlax-curve-getstartpoint e) (_ang e 0))
- (_block (vlax-curve-getendpoint e) (+ pi (_ang e (vlax-curve-getendparam e))))
- (repeat (fix (setq j (1- (vlax-curve-getendparam e))))
- (_block (setq p (vlax-curve-getpointatparam e j)) (_ang e j))
- (_block p (+ pi (_ang e (setq j (1- j)))))
- )
- )
- )
- )
- (princ)
- )
-
- ;; ssget - Lee Mac
- ;; A wrapper for the ssget function to permit the use of a custom selection prompt
- ;;
- ;; Arguments:
- ;; msg - selection prompt
- ;; params - list of ssget arguments
-
- (defun LM:ssget ( msg params / sel )
- (princ msg)
- (setvar 'nomutt 1)
- (setq sel (vl-catch-all-apply 'ssget params))
- (setvar 'nomutt 0)
- (if (not (vl-catch-all-error-p sel)) sel)
- )
-
- (vl-load-com)
- (princ)
上面代码为多段线节点插块,但是效果不是我要的,下图是我想要的效果,求帮忙改下代码。
|