I have attached an AutoCAD 2010 file as an example of what i am about to try and explain. Please bare with me.
I can export the x/y information in itself using the ptExport.lsp routine. I haven't found a way of exporting the entity information because i can't seem to get that one working. (both lsp files attached)
What i actually require is being able to extract the polygon x,y, information along with the corresponding text within the polygon itself i.e ITRD 33651 37, and ideally the entity handle itself.
If you understood that, firstly thanks.
If you know how to help then i would forever in your debt.
Thanks in advance for looking
Note i have to do this for somewhere in excess of 5000 polygons!! GULP!
Basket.dwg
PtExport.lsp
gethandle.lsp
A couple of ideas when doing a ssget you can do "WP" within polygon so do a ssget first make a list of polygons actually they are plines then use that polygon ID for your "WP" in the second ssget.
Secondly theres lots of point from pline routines search here or Lee-mac.com
You need this also for the code below to work tested with 4 points
(setq ss (ssget "WP" (list pt1 pt2 pt3 pt4) (list (cons 0 "Text,mtext")))); replace (list pt1 pt2 pt3 pt4) with say (setq newlst (pts returned from pline vertex's))(setq ss (ssget "WP" newlist (list (cons 0 "Text,mtext"))));then foreach or repeat x times(setq ans (entget (ssname ss x))) (setq handle (assoc 5 ans))(setq text (assoc 2 ans) ; need different for mtext walk line by line
Thanks for your reply 'BIGAL'.
Although i have been a CAD design draughtsman for many years i am on very unfamilar ground with this. What is 'ssget'? What is a point from pline routine?
The text isn't quite duplicated, what the drawing depicts is cable baskets at different levels. The numbers are all the same but fo one digit.
You need a programming language to do what you want hence the example in lisp you can use VBA .Net C## maybe even a Autocad macro to do what you want.
Have you written any programs ? Do you have basic lisp skills ? Because you posted the lisps you are using I assumed that you understood how to write programs.
Ssget is "get a selection set of objects" the you can drill down and retrieve the properties of the object such as the vertices that make up a pline.
Using "WP" this is within a ploygon so it will only search within a certain area, "X" is complete drawing
cons 0 "text" is a filter only look for text objects used with "X" it would every bit of text in your drawing
adding cons 8 "Connections" would mean search within polygon for text objects on layer "Connections"
Thanks for the explantions.
No i haven't written any programs at all. I downloaded the lisp files from this site.
I think i need to look for a "dummies" guide to writing lisp scripts?!
I have a feeling it will take me a considerable amount of time to write what i need so i may have to resort to doing it the long winded way!
Its not that hard its just a case of getting the two or 3 programs you need and glueing them together you have the first two you need a 3rd which is what I was hinting at.
So you want the polygon x,y points and the text within thats ok why do you want the handle ? Also when you get all this info how do you really want it exported as a CSV file, simple column text file or straight into excel etc
The rtos is exporting 8 decimals do you need that many ?
I was thinking that i could extract the handle and associate that with the text, as some of the text in my other drawings doesn't sit within the confinds of the polygon.
I need it in a simple .csv file so that i can import it into a software database.