Jump to content
Bad3d3

Area picked up by internal point

Recommended Posts

Bad3d3

Hello all

I need a lisp to type the area of a geometry by picking an internal point..

thanx for all

Share this post


Link to post
Share on other sites
Lee Mac

  • 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

Share this post


Link to post
Share on other sites
irneb

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.

Share this post


Link to post
Share on other sites
Lee Mac

Good point, use a Region over Polyline.

 

I've already gone down this road in my Area Label program :)

Share this post


Link to post
Share on other sites
Bad3d3

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

Share this post


Link to post
Share on other sites
Lee Mac
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?

Share this post


Link to post
Share on other sites
pBe

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

Share this post


Link to post
Share on other sites
Lee Mac

Thanks pBe :)

Share this post


Link to post
Share on other sites
Pradeep Kumar

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.

Share this post


Link to post
Share on other sites
BIGAL

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

Share this post


Link to post
Share on other sites
Pradeep Kumar

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.

Share this post


Link to post
Share on other sites
marko_ribar
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...

Share this post


Link to post
Share on other sites
Pradeep Kumar
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.

Share this post


Link to post
Share on other sites
BIGAL

Whats wrong with the bpoly methods already mentioned once you get the area you can erase the bpoly if you want.

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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