• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

creating a grid of points with constant values to set

  • Thread starter Thread starter marcolimongiello
  • Start date Start date

marcolimongiello

Guest
Hello.
I admit to being very little practical of the lisp language.
I would need a little program that computes me a so-called "cycle for" for points, i.e. by keyboard I have to enter numbercolumns and numerals and then increase a constant k le ascisse (x) and another constant j le ordered(y) remaining z=w (another constant) thus constructing a grid of points and then make it appear on the sheet, all this starting from the first known point.
 
waiting for the lispino, you can solve with the command _array of a point placed in the origin 0.0.0 of the Cartesian axes.

:
 
Hello everyone,
I press to be at the first weapons with the lisp language.
I can't create what in other languages (e.g.basic) is defined cycle for, since the commands that until now I have tried while and repeat define me only the last value of the created cycle.
the objective of my program would be to give from keyboard 2 variables (a and b), to define a coordinate point (x,y,z) where of these increases of a quantity' known to every iteration only the x (y and z remain constant).defined the grid of points I must then copy from a base point defined previously an element in all points created from the cycle for. allego for those who is interested in solving my problem creating ke.

(setq a (getreal "insert number of columns :"))
(setq b (getreal "insert element diameter :"))
(setq for 1.3)
(setq w (* per b)))
(Sectq div 2)
(setq y (/ b div))
(Sectq z (/ b div))
(seq baricentro "0,0,0")
(while (/= a 0)
(progn)
(setq x (+ x w))
(setq pointdestination (strcat (rtos x 1 2) "," (rtos y 1 2) "," (rtos z 1 2))
(setq xboxnotruo (ssget "_c"(-1 1) '(0 -3)))
(command"_copy" xboxnotruo "" baricentro puntodestinazione e "")
(setq a (1- a)
)
)
 
I see it that way, I changed your routine a little bit.
I used count for the while, are of the opinion that the variables that define the number of iterations should not change them, I used list to define the coordinates, moved ssget out of the cycle since the selection is always the same.

bye
 

Attachments

If I can ask you another courtesy, I have a problem on the _copy command.
I have to select how I normally autocad a selection point and move the selected figure to that point (in the case of first from baricentro to destination point).the command line
(command"_copy" xboxnotruo "" baricentro puntodestinato "")
He does it wrongly
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top