Jump to content

lisp for extracting areas from closed area


emadageeb

Recommended Posts

unled1n.jpgI am working on urban planning i have a big project with huge numbers of plots and i need a lisp for numbering a closed plots which t draw it by lines and extract the area with the same number to a tabe in autocad so can some one please help me by a lisp so i can only click on area Edited by emadageeb
Link to comment
Share on other sites

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    23

  • emadageeb

    8

  • LibertyOne

    7

  • stevesfr

    4

Top Posters In This Topic

Posted Images

This would sould like a fun community project to do. I'm thinking about closed polylines for plots. Not lines. You can get the area of the closed polyline easier.

Link to comment
Share on other sites

What Acad Version do you have? If you have 2008 or higher you can create a border polyline for each plot. Type in the command line "_BPOLY" and click on the button for selecting a point in the area to be bordered. Today I was coding a bit to see what would work to create a program to collect the information and be able to list the size of the plots. It's a bit future oriented, which means you could use it for other projects as long as the drawing always had the plots as polylines.

Link to comment
Share on other sites

i am using autocad 2008 & thanhs for _bploy command

also if i have polyline i still asking for numbering plots and get area in a table by clicking pick point

Link to comment
Share on other sites

About tenn years ago I programmed a room schedule in AutoLisp. Let me take a look this weekend if that will help you.

Link to comment
Share on other sites

I had some fun writing this, maybe it will help you:

 

See later post for latest code

Edited by Lee Mac
Link to comment
Share on other sites

Lee, can't get this to work. makes start of table, labels first area and then this

Command: at

Pick Point for Table:

Pick Area:

** Error: Automation Error. Not applicable **

using Acad2008 vanila

entities are LWpoly, textsize set ok

Steve

Link to comment
Share on other sites

Hi Steve,

 

Thanks for the feedback - I'm thinking this is a version issue since (as demonstrated by the gif), I have no problems with the code (on closed LWPolylines and Circles at least).

 

Would you possibly be able to tell me the line at which the code crashes?

 

(Open VLIDE, Ctrl+O (Open File), Open the above program, Debug->Break on Error (Ticked), Ctrl+Alt+E (Load Code), Run the program in ACAD -> on crash: Debug->Last Break Source (Ctrl+F9), note the line number of the highlighted code segment. Reset the Error (Ctrl+R).

 

Thanks!

 

Lee

Link to comment
Share on other sites

Lee, did so... lisp tilts on

(vla-put-rows tb 3) which was highlighted......

HTH I'd be happy to test more to help fix.

Steve

Link to comment
Share on other sites

Lee, did so... lisp tilts on

(vla-put-rows tb 3) which was highlighted......

HTH I'd be happy to test more to help fix.

Steve

 

Argh! - that's a royal shame if that line doesn't work in 2008 since I really like the way rows are added to the table in real-time (instead of creating the table after the user has finished picking areas).

 

Thanks for testing it Steve, appreciated.

Link to comment
Share on other sites

It still won't fix the error, but maybe this will be of use to you since I can't seem to get the table part to work.

 

See later post for latest code

 

Lee

Edited by Lee Mac
Link to comment
Share on other sites

It still won't fix the error, but maybe this will be of use to you since I can't seem to get the table part to work.

 

Lee

 

AF part works fine. Then cut and paste text file back to Acad, and presto, immation table !

thanks for efforts Lee

those who can use AreaTable will have one of your best.

Steve

Link to comment
Share on other sites

Oh boy, Lee Mac, you really did a good job on that. Like I said in a post before, I programmed a room schedule about ten years ago for Version 14. I was just sifting through my code today and it would be tedious to go through it all and rewrite some of it because it's interlaced with blocks and specific layer names. I like the simplicity of your programming style which gets to the point rather quickly. I seemed to have gone the complex route. I can't test anything over the weekend because I have no access to AutoCAD. I just have my AutoLisp files. My idea was to build up the program within the CADTutor community and have everyone gain a bit on learning to build up a program like this. But it also seems that the thread starter wanted something rather quick.

Link to comment
Share on other sites

i tried areatable lisp in AUTOCAD 2008 os win 7 but i have this messege

** Error: Automation Error. Not applicable **

could some one help me

Link to comment
Share on other sites

i tried areatable lisp in AUTOCAD 2008 os win 7 but i have this messege

** Error: Automation Error. Not applicable **

could some one help me

 

So try AreaLabel in post No # 13

Link to comment
Share on other sites

AF part works fine. Then cut and paste text file back to Acad, and presto, immation table !

thanks for efforts Lee

those who can use AreaTable will have one of your best.

 

I'm glad that part works for you - its just a shame the 'rows' property throws a wobbly even though it is a read/write property. Thanks anyway Steve.

 

Neat idea Lee. Tested in C3D 2011.

 

Cheers Alan - I take it the table part works for you OK in Civil3D?

 

Oh boy, Lee Mac, you really did a good job on that. Like I said in a post before, I programmed a room schedule about ten years ago for Version 14. I was just sifting through my code today and it would be tedious to go through it all and rewrite some of it because it's interlaced with blocks and specific layer names. I like the simplicity of your programming style which gets to the point rather quickly. I seemed to have gone the complex route. I can't test anything over the weekend because I have no access to AutoCAD. I just have my AutoLisp files. My idea was to build up the program within the CADTutor community and have everyone gain a bit on learning to build up a program like this. But it also seems that the thread starter wanted something rather quick.

 

Thanks LibertyOne - with my programming, I try to keep things short and simple :)

 

I suppose a community project would be beneficial to help those learning, however it would need some coordination and structure (we tried something similar recently at theSwamp).

 

i tried areatable lisp in AUTOCAD 2008 os win 7 but i have this messege

** Error: Automation Error. Not applicable **

could some one help me

 

This would be the error that stevesfr reported earlier - have a read of the other posts in the thread. It appears to be a Version related issue.

 

also arealabel cannot work with me

Unknown command "AREALABEL". Press F1 for help.

 

The command is not 'arealabel' - this is just a subfunction. The commands are printed at the command-line upon loading the program.

 

Regards,

 

Lee

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