# Thread: Getting points locations at devided distance

1. ## Getting points locations at devided distance

Registered forum members do not see this ad.

Suppose that I have a room and I want to divide it into specific points.
My codes are running well up to the crossing points. I mean How can I support
the X and Y for the divided points at X and Y as well ?

Code:
```(defun c:cen (/ pt1 pt3 pt2 pt4 XLen YLen Xnum Ynum)
(setq pt1 (getpoint"\n Specify The Left corner: ")
pt3 (getcorner pt1 "\n Specify the Right corner: ")
)
;; ******** the rest of rectangl points ****************
(setq pt2 (list (car pt3)(cadr pt1))
)
;; ****** Lengths of X and Y **************
(setq XLen (distance pt1 pt2)
YLen (distance pt1 pt4)
)
;; ****** divide the X and Y **************
(setq Xnum (getint "\n Specify Number of X elements: ");; for instance 5
Ynum (getint "\n Specify Number of Y elements: ");; for instance 4
)```

2. Could you explain in more detail?
Do you just want to collect the point of the intersections of the x’s and y’s?
Use the polar function and the repeat function

3. Can not see any problem you just need a loop within a loop

(repeat Xnum
(repeat ynum
)
(setq xnum (+ xnum Xlen))
)

4. The crosses in RED are what I would like to get. Although these points
are would be changed according to user input.

Many thanks

Michaels

5. I wrote this lisp for enforcements some moons ago
Looks like this is exactly what you looking for
Change to suit

~'J'~

6. Originally Posted by fixo
I wrote this lisp for enforcements some moons ago
Looks like this is exactly what you looking for
Change to suit~'J'~
Thanks fixo,

- Why did you use the following since you didn't use it later in the routine ?
- And what does it mean?
Code:
`pc (mapcar (function (lambda (x y)(* (+ x y) 0.5)))`

It is really works fine, But I am looking forward to learing how codes are running and should be built with according to user inputs.

Any suggestion from any one would be highly appreciated.

Regards

7. Sorry,
I can't to expalin the things good because of my english level
and by this reason I'm afraid to mix something
Feel free to change the code to your suit

~'J'~

8. Originally Posted by fixo
Sorry,
I can't to expalin the things good because of my english level
and by this reason I'm afraid to mix something
Feel free to change the code to your suit
~'J'~

I do understand.

Best Regards,

9. Hello,

I still worndering how to get the intersection points in the pose.

Any idea ?

Best regards,

10. Registered forum members do not see this ad.

what are you not understanding?
do you know how to use the polar and repeat functions?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts