Hi all,
I have one lisp & i want to modify this, i just need to place 12mm line instead of circles.
Please see following code which i have.
(defun c:slot (/ a d e i l n pa p p0 p1)
;; SRJ » 2019-11-12
(cond ((and (setq e (car (entsel "\nPick a line: ")))
(setq p0 (vlax-curve-getstartpoint e))
(setq p1 (vlax-curve-getendpoint e))
(setq d (- (distance p0 p1) 200))
(setq i (/ d (setq n (fix (1+ (/ d 400.))))))
)
(setq p0 (polar p0 (setq a (angle p0 p1)) 100))
(repeat (1+ n)
(setq
l (cons
(list (entmakex (list '(0 . "CIRCLE") '(8 . "SLOTS") (cons 10 p0) '(40 . 1.875))) p0)
l
)
)
(setq p0 (polar p0 a i))
)
(setq pa (+ a (/ pi 2)))
(while (setq p (getpoint "\nPick a point until offset is correct: "))
(setq pa (+ pa pi))
(foreach x l
(entmod (append (entget (car x)) (list (cons 10 (polar (cadr x) pa 10)))))
(entupd (car x))
)
)
)
)
(princ)
)
(vl-load-com)
Solved! Go to Solution.
Solved by ronjonp. Go to Solution.
(defun c:slot (/ a d e i l n pa p p0 p1) ;; SRJ » 2019-11-12 (cond ((and (setq e (car (entsel "\nPick a line: "))) (setq p0 (vlax-curve-getstartpoint e)) (setq p1 (vlax-curve-getendpoint e)) (setq d (- (distance p0 p1) 200)) (setq i (/ d (setq n (fix (1+ (/ d 400.)))))) ) (setq p0 (polar p0 (setq a (angle p0 p1)) 100)) (repeat (1+ n) (setq l (cons (list (entmakex (list '(0 . "CIRCLE") '(8 . "SLOTS") (cons 10 p0) '(40 . 1.875))) p0) l ) ) (setq p0 (polar p0 a i)) ) (setq pa (+ a (/ pi 2))) (while (setq p (getpoint "\nPick a point until offset is correct: ")) (setq pa (+ pa pi)) (foreach x l (entmod (append (entget (car x)) (list (cons 10 (polar (cadr x) pa 10))))) (entupd (car x)) ) ) ) ) (princ) ) (vl-load-com)
@Anonymous wrote:
.... i just need to place 12mm line instead of circles. ....
[I don't see how Message 5 is a solution....]
That shouldn't be difficult, but what is the geometric relationship between the selected Line and the 12mm Lines to be added? Should the added ones start on the selected one and extend 12mm perpendicular from it? Should they be centered where the Circles are [10 drawing units off the selected Line], and maybe perpendicular or maybe parallel to the selected one? Something else?
@Kent1Cooper wrote:
@Anonymous wrote:.... i just need to place 12mm line instead of circles. ....
[I don't see how Message 5 is a solution....]
...
Agreed .. not a solution ... but it does point out a problem.