Jump to content

Recommended Posts

Posted

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

Posted

Hmmm... never really thought about this one, but it seems to be quite tough - unless there is a method I am missing... :unsure:

 

 

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!

Posted

Can't you use the hatch function's code to figure this out? Just thinking out loud.

Posted

Didn't even know there was a boundary specific command. Never had to use it.

Posted

The only way I know is to borrow the ARX function BPOLY:

 

(vl-arx-import 'BPOLY)
(setq MyBoundary (bpoly (getpoint "\nSpecify internal point:")))

Posted

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)
 )

Posted

Nice one Wizman, right up my street if you know what I mean ... :thumbsup:

 

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.

Posted

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

Posted
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. :)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...