Arizona Posted July 26, 2016 Share Posted July 26, 2016 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... Quote Link to comment Share on other sites More sharing options...
jonathann3891 Posted July 26, 2016 Share Posted July 26, 2016 Take a look at Lee Mac's dynamic block functions http://lee-mac.com/dynamicblockfunctions.html#setdynamicpropvalue If you could share your block, that would be helpful. Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted July 26, 2016 Share Posted July 26, 2016 The data is probably stored in Xdata or Xrecords. To look for Xdata try this: (entget (car (entsel)) '("*")) Quote Link to comment Share on other sites More sharing options...
Arizona Posted July 26, 2016 Author Share Posted July 26, 2016 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 Quote Link to comment Share on other sites More sharing options...
jonathann3891 Posted July 26, 2016 Share Posted July 26, 2016 In your OP you stated you were using a dynamic block. Quote Link to comment Share on other sites More sharing options...
Arizona Posted July 26, 2016 Author Share Posted July 26, 2016 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. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted July 26, 2016 Share Posted July 26, 2016 I do not see any Object Data in Properties, could this be something to do with MAP? Also a .shx is missing. Quote Link to comment Share on other sites More sharing options...
Arizona Posted July 26, 2016 Author Share Posted July 26, 2016 It definitely could have something to do with Map! I do not have access to a standard version of ACAD to test that. Quote Link to comment Share on other sites More sharing options...
Hippe013 Posted July 26, 2016 Share Posted July 26, 2016 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 ) Quote Link to comment Share on other sites More sharing options...
jonathann3891 Posted July 27, 2016 Share Posted July 27, 2016 Maybe this will help? http://www.cadtutor.net/forum/showthread.php?53420-Object-Data-to-Attribute-Data-to-perfection Quote Link to comment Share on other sites More sharing options...
Arizona Posted July 27, 2016 Author Share Posted July 27, 2016 Thanks Hippy and Jonathan, that's a lot of good info. I'm sure I can get it with all that reference data. Thanks again. Quote Link to comment Share on other sites More sharing options...
Hippe013 Posted July 27, 2016 Share Posted July 27, 2016 I am happy to help! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 28, 2016 Share Posted July 28, 2016 Try DUMPIT.LSP this reveals a world of secrets about an object. Quote Link to comment Share on other sites More sharing options...
DaveS Posted June 27, 2017 Share Posted June 27, 2017 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. Quote Link to comment Share on other sites More sharing options...
samsudeenmanoos Posted August 16, 2017 Share Posted August 16, 2017 what should I do with this code? can you explain me? Quote Link to comment Share on other sites More sharing options...
Hippe013 Posted August 16, 2017 Share Posted August 16, 2017 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. Quote Link to comment Share on other sites More sharing options...
tombu Posted August 16, 2017 Share Posted August 16, 2017 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. Quote Link to comment Share on other sites More sharing options...
nanjac86 Posted June 23, 2023 Share Posted June 23, 2023 @tombu Can you please share the lisp which you created. So that we can modify for our needs. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.