bsamc2000 Posted March 30, 2009 Posted March 30, 2009 Okay I'm stumped. I would like to be able to select a point and return a boundary for the area selected. Similar to a boundary hatch. I have been looking for a way to do this in VB.Net but I can not find an example. VBA would also be okay. Any information would be greatly appreciated. Thank you, Brian Quote
Lee Mac Posted March 30, 2009 Posted March 30, 2009 Hmmm... never really thought about this one, but it seems to be quite tough - unless there is a method I am missing... The way I would approach it in LISP would be to construct a line of any length or angle at the selected point and find all the intersections of this line with all the objects in the drawing (not a slow task), then find the closest intersection to the point and find the object that lies on that intersection. But I'm hoping there is an easier way! Quote
Magnum Z Posted March 30, 2009 Posted March 30, 2009 Can't you use the hatch function's code to figure this out? Just thinking out loud. Quote
Magnum Z Posted March 30, 2009 Posted March 30, 2009 Didn't even know there was a boundary specific command. Never had to use it. Quote
uddfl Posted March 30, 2009 Posted March 30, 2009 The only way I know is to borrow the ARX function BPOLY: (vl-arx-import 'BPOLY) (setq MyBoundary (bpoly (getpoint "\nSpecify internal point:"))) Quote
lpseifert Posted March 30, 2009 Posted March 30, 2009 not VBA and not bulletproof ; return area of picked boundary LPS 02-2009 (defun c:da (/ elname ip sqft sqyd acre) (setvar "cmdecho" 0) (setq elname (entlast) ip (getpoint "Pick internal point: ") ) (command "boundary" ip "") (if (eq (entlast) elname) (alert "No boundary created!") (progn (setq ar (command "area" "o" "l")) (setq sqft (getvar "area") sqyd (/ sqft 9.0) acre (/ sqft 43560.0) ) (alert (strcat "\n Square Feet = " (rtos sqft 2 2) "\n Square Yards = " (rtos sqyd 2 2) "\n Acres = " (rtos acre 2 3) "\n" ) ) (entdel (entlast)) ) ) (setvar "cmdecho" 1) (princ) ) Quote
wizman Posted March 30, 2009 Posted March 30, 2009 http://mathworld.wolfram.com/ConvexHull.html Quote
wizman Posted March 30, 2009 Posted March 30, 2009 or this, since you're concern are on points, group of points will always form a boundary http://mathworld.wolfram.com/TravelingSalesmanProblem.html Quote
Lee Mac Posted March 30, 2009 Posted March 30, 2009 Nice one Wizman, right up my street if you know what I mean ... But I think the OP wanted to select a point inside an object and for the LISP or VBA to recognise the object that you have clicked inside. Quote
wizman Posted March 30, 2009 Posted March 30, 2009 lee, you're right, most of the time i'm thinking way off the mark and this is one of them, off to bed....'-) -\m/izan Quote
Lee Mac Posted March 30, 2009 Posted March 30, 2009 lee, you're right, most of the time i'm thinking way off the mark and this is one of them, off to bed....'-)-\m/izan Ahh, no worries - I think I should be off to bed soon too... Nice idea though - good links. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.