TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: mohan on September 05, 2021, 02:55:01 AM
-
I wanted to paste objects on array of points pls fix my lisp
(defun c:somefun ( / x y pt )
(setq x 0) (setq y 0)
(while (setq pt '(( + x 20) ( + y 20) 0.00 ))
(command "_.cutclip" (ssget) "" "_.pasteclip" pt )) (princ))
thanks
-
Why not just array in a lisp. Just write down the steps when running manually.
-
Array will copy objects, but my one is existing objects
Ok guys, I understood it is a difficult one !
Please help for this shape . . . (ssget) I am not doing anything here manually I will replace (ssget) with (ssget "_x" '((0 . "INSERT") (2 . "myblockname")) for block selection or any other objects
I just need a lisp to finish my work out (It will work through layouts & model spaces)
-
Back to request 1 this is 250 blocks at spacing of 10 X and Y
(setq x -10.0 y 0.0)
(repeat 50
(setq x (+ 10 x))
(repeat 50
(vl-cmdf "-insert" "Test" (list x y 0.0) 1 1 0 )
(setq y (+ y 10))
)
(setq y 0.0)
)
request 2 just get start pt and set x & y
(repeat 10
(vl-cmdf "-insert" "Test" (list x y 0.0) 1 1 0)
(setq y (+ y 10))
(setq x (+ x 10))
)
-
That was awesome ! thank you so much dear . . . :smitten:
small correction on the 2nd
add this: (setq x 0.0) (setq y 0.0)
(repeat 10
(vl-cmdf "-insert" "Test" (list x y 0.0) 1 1 0)
(setq y (+ y 10))
(setq x (+ x 10)))
If you know any (design / pattern of points program by mathematics) in the google just share with me (Example: Lee Mac sir website has)
-
Remove the "c" code was pasted from a block with 1 attribute.