Jump to content

Area picked up by internal point


Bad3d3

Recommended Posts

  • Prompt user for point (getpoint)

 

  • Store value of (entlast)

 

  • Use BPOLY command with selected point to generate a Polyline.

 

  • Check value of (entlast) against previously stored value, if not equal, a Polyline has been successfully created.

 

  • Use vlax-curve-getarea on the Polyline entity returned by (entlast), or retrieve the Area property of the VLA-Object equivalent.

 

  • Report the area.

 

  • Delete the Polyline

Link to comment
Share on other sites

Lee, that would work for simple areas. If you have an area with holes cut out of it, the bpoly (or boundary command - same thing) would generate several polylines. So you'd either need to subtract their areas from one another - which might be difficult to figure out which from which. Or change the Advanced options --> Object type of the boundary command to generate a single Region instead.

Link to comment
Share on other sites

thanx lee for help >>but when I loaded your area label lisp in my cad is said "error: bad function: 41"

and thanx irneb for concern

Link to comment
Share on other sites

thanx lee for help >>but when I loaded your area label lisp in my cad is said "error: bad function: 41"

and thanx irneb for concern

 

I can't see what could be causing that error, and I also can't seem to replicate the error when loading the program on my system.

 

Is anyone else receiving this error when loading the Area Label program?

Link to comment
Share on other sites

I tested your program Lee, I have to say I'm impressed.

 

This:

 (defun _Select ( msg pred func init / e ) (setq pred (eval pred))...... 

 

Wicked programming :thumbsup:.

I still have much to learn.

 

Thank you for sharing Lee

Link to comment
Share on other sites

  • 7 years later...

Is there any possibility to get the area without using boundary command and also I would like to know the coding of boundary command (coding by Autodesk) just to know how it works.

Link to comment
Share on other sites

If its lines or plines no arcs there is a mathematical formula for areas based on points. Arcs add an extra level of complexity.

 

(coding by Autodesk) Autodesk pay mathmaticians no doubt a lot of money to make Autocad smart so you will never be told how they did it. Just google Boundary you will find lots of theory about boundaries.

  • Thanks 1
Link to comment
Share on other sites

Thank you. I would like to know whether there is a possibility to fetch the area of a closed polyline when the point is picked inside the closed polyline without using AutoCAD boundary command.

Link to comment
Share on other sites

54 minutes ago, Pradeep Kumar said:

Thank you. I would like to know whether there is a possibility to fetch the area of a closed polyline when the point is picked inside the closed polyline without using AutoCAD boundary command.

 

It would be far more easy and reliable if you could pick desired polyline instead of picking inside it, whereas there may be more entities that may interfere point inside polyline checking...

Link to comment
Share on other sites

55 minutes ago, marko_ribar said:

 

It would be far more easy and reliable if you could pick desired polyline instead of picking inside it, whereas there may be more entities that may interfere point inside polyline checking...

What if I would like to retrieve area between two intersecting closed polyline.

Link to comment
Share on other sites

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