Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetPoint - Getting multiple points from a user..

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
Hi again,

What's the best way to code the GetPoint function so that the user can select a random number of points in turn on screen and then when finished all those will be passed to array?

The main aim of this is to obtain the internal area of a room/building - the program will take these points, create a polyline from them, obtain the area calculation, then delete the polyline. Then the answer can be inserted as text in the centre of the room. I need the user to be able to select all points required (which could be 4, 8, 11 whatever). This should all happens while the Acad screen is still in focus the when the user has select all necessary points, focus return to the form.

The points should be passed to an array for the points list. I know how to use the GetPoint function but how do obtain multiple random points?

Any help would be greeted with a large grin and thanks..

Renegade..
 
Off the cuff....

(setq ptlist nil)
(while
(setq pt (getpoint "\nSelect a point: "))
(setq ptlist (cons pt ptlist))
);while
(setq ptlist (reverse ptlist))
;;to get points in order selected

;;or draw a polyline
(command "._PLINE")
(while (> (getvar "CMDACTIVE") 0)
(command pause);pauses for user input
);while
(command "");ends pline command

HTH,
Carl
 
Thanks CarlAK,

That's great. Do you or anyone else know what it would be in VBA? I've not touched on AutoLISP as yet and I'm trying my hand at VBA first as it's a bit easier.

Thanks again..

Renegade..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top