hello
so I've been using this lisp by Kent1Cooper it works okay for me but I would like it to.
1. Select between two blocks depending on the layer of the pline it's being attached to.
2. I would also like it to align to the pline
Kent1Cooper's lisp:
(defun C:clp ; = Insert Block at Near End
(/ ss ent nogo)
(prompt "\nUsing only individual-pick or Fence selection option(s),")
(if (setq ss (ssget '((0 . "LINE,*POLYLINE,ARC")))) ;; include Spline/Ellipse if open? Ray?
(foreach item (ssnamex ss)
(if (member (car item) '(1 4)); individual-pick or Fence selection used
(progn ; then
(setq ent (cadr item)); entity name
(command "_.insert" "tie_options" "_scale" 1 "_none"
(if
(<
(vlax-curve-getDistAtPoint ent (vlax-curve-getClosestPointTo ent (last (last item))))
(/ (vlax-curve-getDistAtParam ent (vlax-curve-getEndParam ent)) 2); half length
); <
(vlax-curve-getStartPoint ent); then -- closer to start
(vlax-curve-getEndPoint ent); else
); if
(* ; rotation
(/
(angle
'(0 0 0)
(vlax-curve-getFirstDeriv ent (vlax-curve-getParamAtPoint ent (getvar 'lastpoint)))
); angle
pi
); /
180
); *
); command
); progn
(setq nogo T); else -- selected by wrong method
); if
); foreach
); if
(if nogo (prompt "\nSome object(s) selected by incorrect method(s)."))
(princ)
); defun
Solved! Go to Solution.