July 18, 2006

Exporting Attributed Data to CAD: Part 3


Blocks for Lines and Polygons

We had a Pirate themed vacation at home the week before last. We decided to make the best of the pool and take advantage of the Pirates of the Caribbean debut to take a home vacation. My daughter and her friends joined us for a week of Piratey activities during the day. The family also attended Pirate attractions nearby. We sailed on a tall ship with the crew in character as pirates, attended opening day of the Disney film, and dined at a Pirate dinner show. We had pirate music, sharpy-ink tattoos and drank bilge water (lemonade) out of old bottles. I felt like the Robin Williams character from 'Hook' playing Peter Pan with a bunch of real kids.
True Pirates really aren’t that much fun in fact they represent the worst of humanity, but pretending to be piratey is a blast, so instead of getting all bogged down with reality… sometimes its fun to just go with it! In AutoCAD you can’t include named text attributes on any entity other than a block insert, which is essentially a point. I can throw up my hands and just not try to attribute lines or polygons when exporting GIS data, or we can accept the limitation and just go with it!

Since I can export GIS points as blocks with attributes, I can create GIS points from the GIS lines and polygons for the sole purpose of holding the attributes of said lines and polygons. A good way to make points from lines or polygons is to use the ArcInfo FEATURE TO POINT geoprocessing tool. I think a good way to create points that can be inferred as related to lines is to put them on the line near the polyline's midpoint. When I am creating points that describe a polygon I think a generally accepted norm is to put the point inside the polygon. Since the FEATURE TO POINT tool retains the attributes of the input features the resulting points will have the attributes of the lines or polygons. By exporting the resultant points using the same technique as defined in the previous post, you can create blocks with attributes that have the attributes of the lines or polygons they surround or run through. Like a pirate it may not be pretty, but its one easy way to get what you want without working too hard.

July 11, 2006

Exporting Attributed Data to CAD: Part 2


Block Party: Points

Last week included the 4th of July holiday, and we and the neighbors on our street had a traditional block party. We barricaded the streets and set up tables and volleyball. We set up several barbeques in the driveways and had a great time.

In honor of the good’ol American block party the first posting on attributing CAD drawings will be several suggested methods of using the AutoCAD block insert entity. Block insert entities have the ability to hold named textual attributes. Blocks with attributes can retain the ArcGIS feature attributes when data is exported to an AutoCAD file using the ArcInfo Export to CAD geoprocessing tool.

A little background information about the AutoCAD block entity is probably warranted for the GIS-centric readers. A “block” is defined as a specified collection of other AutoCAD entities. Once defined and saved instances of the block can be placed as a single entity. Blocks can be simple or entire drawings. Blocks definitions can contain special entities call attribute definitions, or AttDef entities. These entities have logical names called tags. When an instance of a block containing one or more AttDef entities is placed as a block insert entity the AttDef magically turns into a block attribute sub-entity, and can hold a text value. This textual block attribute can be visible or invisible. It looks and is formatted in the same way as a text entity. The major differences between the block attribute and text is that once placed it is tied to the insert entity and has a logical name (tag name).

Blocks themselves have a logical name or RefName, also called the block name. Block names are unique in any given drawing. The geometry of a block insert entity is an insert point. Although a block may be defined with complex geometry the block insert entity is essentially a point.

In terms of GIS and CAD interoperability, a GIS point feature maps very well to a CAD block insert entity with attributes.

To ensure that the ArcInfo Export to CAD tool creates block insert entities from your exported GIS point features you must override the default behavior of the tool, which will create AutoCAD point entities from the GIS point features. This is accomplished by adding a specially named column to your GIS feature class called ‘CADType’ and calculating its string value to be the keyword “Insert”. This effectively tells the Export To CAD tool to create Insert entities rather than the default Point entities.
You will also need to supply an AutoCAD seed file as input to the Export to CAD tool that contains all of the block definitions you will be referencing. This seed file needs to contain the block definitions, and you will need to ensure that the AttDef tag names in the those block definition match the column names of the exported GIS point features. If you already have blocks defined with different tag names you can always rename the GIS column names to match and get the desired affect.

If you are a GIS user this may seem a little compliated, but to an AutoCAD user, they should be tracking right along, so just print out the above paragraph and they can easily create a seed file with the correct block definitions for you. You need a block defined such that the AttDef tag names match your GIS feature attribute column names.
The next step to ensure the proper creation of AutoCAD block insert entities with attributes from the Export to CAD tool is to include a specially named column called ‘RefName’ in the GIS features you are exporting to AutoCAD. You then need to populate that field with the name of the AutoCAD block that you would like to use to represent the GIS point in AutoCAD. When the points are exported, the GIS point’s coordinates will be used as the insertion point of the AutoCAD block insert entity and any matching tag names will be populated with the appropriate values. Any numeric fields will automatically be converted to appear as text values in the cooresponding AutoCAD block attributes.

This works great for points... what about linear features and polygons?

(Stay tuned for more in the series…)

July 10, 2006

Exporting Attributed Data to CAD: Part 1

I am not sure why this might be the case, but I seem to be solicited for a disproportional amount of requests for directions from strangers. It happened again last week while filling up at the gas station. A woman passed two other people to interrupt my window washing and ask me for directions. (Maybe because I am tall, people think I can see farther?) Anyway, I was glad I was able to point this person in the right direction.

For whatever reason I was reminded of the saying, “You can’t get there from here.” as a response to directions. I’ve been given that instruction by others and have heard others give it. I understand what they mean to say is that the traveler's current path isn’t leading them any closer to their destination.

I was on vacation last week (more about that later) and it is time to get back to work. Before I left on vacation I was asked by a number of people a couple different ways, "What is a good way to export ArcGIS features to CAD, while retaining the feature attributes?" Rather than giving the easy and technically accurate response of, you can’t… I thought I’d start a series on exporting features as attributed CAD data to outline some strategies for what you CAN do when exporting GIS data to AutoCAD or Microstation.
FREE hit counter and Internet traffic statistics from freestats.com