Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MODIFY CODE

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Anonymous
779 Views, 7 Replies

MODIFY CODE

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)

7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

(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)

Message 3 of 8
devitg
in reply to: Anonymous

please upload your sample.dwg where to apply it 

Message 4 of 8
Anonymous
in reply to: devitg

PLEASE SEE ATTACHED CAD

Message 5 of 8
ronjonp
in reply to: Anonymous

(defun c:slot (/ a d e i l n pa p p0 p1)
;; SRJ » 2019-11-12
....

Not cool ...

Message 6 of 8
Anonymous
in reply to: ronjonp

THANK YOU SIR

Message 7 of 8
Kent1Cooper
in reply to: Anonymous


@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?

Kent Cooper, AIA
Message 8 of 8
ronjonp
in reply to: Kent1Cooper


@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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


Autodesk Design & Make Report