Jump to content

Extract OBJECT DATA in Lisp


Arizona

Recommended Posts

GIS Mapping

I have a drawing from the County containing every Lot in the County.

The lots are Closed Polylines, with Object Data containing the Block and Lot number info.

 

I want to write a Lisp routine where I select the Closed Polyline, then pick a point, and ACAD inserts an attributed block at that point with the Block & Lot number filled in for me (I already have this block, use it almost every project).

 

The routine should be easy for me to write, but I have not been able to determine how to extract the Object Data.

A plain old ENTGET does not get the Object Data.

It's apparently not a ENTNEXT thing, that just seems to get me the next polyline in the drawing.

 

All I need is to set a variable to the value of the Object Data, and I'll be able to complete the routine.

 

My googleing yielded nothing...

 

Thanks Guys!

Jeff

 

I'm working in ACAD 2009 Map if it makes any difference...

Link to comment
Share on other sites

It's not X-Data guys, it's Object Data.

They are not blocks, they are Closed Polylines.

 

I've attached a drawing. In it is nothing but closed polylines.

Select one and open the 'properties' box. Towards the bottom of the properties box is the "OD" (object data).

PARCELS 3539.dwg

Link to comment
Share on other sites

Sorry Jonathan, but I think you need to go back and read that OP again.

 

"The lots are Closed Polylines, with Object Data containing the Block and Lot number info."

 

Block and Lot refers to the system Counties use for recording real estate lot information.

 

Oh, and - Object Data (OD) and Extended Data (XData) are two different things.

Link to comment
Share on other sites

You will need to look into OD functions such as.

 

(ade_odgettables ent) 
(ade_odtabledefn tbl) 
(ade_odgetfield ent tbl fld 0)

 

I hope this helps as a starting point.

 

(defun getfield (ent field) ;field as string
 (setq tbl (nth 0 (ade_odgettables ent)))
 (setq fields (ade_odtabledefn tbl));not needed but included for reference
 (setq return (ade_odgetfield ent tbl field 0))
 return
 )

Link to comment
Share on other sites

  • 10 months later...

Bump -

 

There is an easier way to export Object Data Table data into an Excel file that doesn't require Autolisp. Use the MapExport command (in Autocad/Map or Civil 3D only) to export the object with attached ODT's (and/or Autocad block attributes and/or object properties!) as and ESRI Shapefile. The .dbf portion of the ESRI Shapefile is an old dBase database file format that can be opened directly in Excel and saved as an .xlsx (or other) file with columns for each of the ODT fields and object properties selected and a row for each of the objects selected.

 

Oh, and BigAl's simple 'DumpIt.lsp', though useful in other scenarios, does not list out any ODT, let alone its data. I tracked it down and tried it.

Link to comment
Share on other sites

  • 1 month later...
what should I do with this code? can you explain me?

 

What is it that you are trying to do? I'm sure that I can be of assistance, though a little more information would be helpful.

Link to comment
Share on other sites

A Map Annotation Template will do what you're looking for: http://help.autodesk.com/view/MAP/2018/ENU/?query=Annotation%20Template

 

I wrote a lisp that annotates almost anything depending on the object data. For a parcel it has ten options, most insert various data at the centroid of the parcel while one brings up the parcel from the Property Appraisers office online and another opens it in GIS. It will label contour elevation using object data, polyline elevation, or even a Civil 3D surface.

 

What makes using object data complicated is that every office organizes and names it differently. I have to modify the lisp every couple years whenever they rename and reorganize it. Because of that my code may be of no use to you.

Link to comment
Share on other sites

  • 5 years later...

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