PDA

View Full Version : Looking for code similar to insert command


tflaherty
2005-06-03, 09:19 PM
I'm working on a routine that finds the center of a room and inserts an electrical fixture at that point. One of the options the user can select is to insert a ceiling fan with 4 recessed lights around it in a square/rectangular shape. So, I want the routine to prompt for the x distance and then prompt for the y distance using the x distance as the default answer, just like the insert command does when prompting for the x & y scale factor.

Can somebody please point me in the right direction for adding this piece of the code?

Thanks in advance!

scwegner
2005-06-03, 09:51 PM
The prompt part is simple:

(setq xfactor (getreal "\nEnter x scale factor: "))
(setq yfactor (getreal "\nEnter y scale factor <use x scale factor>: "))
(if
(not yfactor)
(setq yfactor xfactor)
)

Can you take it from there? Alternatively, you could use getdist instead of getreal which would allow you to rubberband from the centerpoint.