Author Topic: Array of points  (Read 1494 times)

0 Members and 1 Guest are viewing this topic.

mohan

  • Newt
  • Posts: 98
Array of points
« on: September 05, 2021, 02:55:01 AM »
I wanted to paste objects on array of points pls fix my lisp
Code: [Select]
(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


"Save Energy"

BIGAL

  • Swamp Rat
  • Posts: 1396
  • 40 + years of using Autocad
Re: Array of points
« Reply #1 on: September 05, 2021, 11:22:42 PM »
Why not just array in a lisp. Just write down the steps when running manually.
A man who never made a mistake never made anything

mohan

  • Newt
  • Posts: 98
Re: Array of points
« Reply #2 on: September 06, 2021, 07:26:25 AM »
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)
« Last Edit: September 06, 2021, 07:35:45 AM by mohan »
"Save Energy"

BIGAL

  • Swamp Rat
  • Posts: 1396
  • 40 + years of using Autocad
Re: Array of points
« Reply #3 on: September 07, 2021, 08:28:36 PM »
Back to request 1 this is 250 blocks at spacing of 10 X and Y

Code: [Select]
(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
Code: [Select]
(repeat 10
(vl-cmdf "-insert" "Test" (list x y 0.0) 1 1 0)
(setq y (+ y 10))
(setq x (+ x 10))
)
« Last Edit: September 08, 2021, 10:11:06 PM by BIGAL »
A man who never made a mistake never made anything

mohan

  • Newt
  • Posts: 98
Re: Array of points
« Reply #4 on: September 08, 2021, 10:49:17 AM »
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)
« Last Edit: September 09, 2021, 02:06:23 AM by mohan »
"Save Energy"

BIGAL

  • Swamp Rat
  • Posts: 1396
  • 40 + years of using Autocad
Re: Array of points
« Reply #5 on: September 08, 2021, 10:11:57 PM »
Remove the "c" code was pasted from a block with 1 attribute.
A man who never made a mistake never made anything