Custom Line Types with Data Connect

A number of users have been asking about using custom line types in their maps with features from the data connect, both in the AUGI forums and the Map3D Discussion Group. I would answer with a yes BUT replied. Why? Cause it’s not as simple as loading a lin file like you can with AutoCAD objects then set that object’s layer to use those line types from that lin file. So can it be done? YES. Here’s how in some simple as I can make steps. It takes a little preplanning but here is what I want to do in my example.

I have a SDF file (line type) that represents a 3 phase electrical power line, I want to display it with 3 vertical tic marks (perpendicular).


The original display.

  • First enable enhanced stylization in Map3D.
  • Add your feature data (line type) using the enhanced stylization.
  • Save that data layer to a layer file.
  • Edit the layer file.
  • Then add that layer file back into your map.

So to start we need to edit the windows registry to enable the enhanced stylization. To do this edit the key in the registry named;

“KEY_CURRENT_USER\Software\Autodesk\AutoCAD\R18.0\ACAD-8002:409\Applications\AcMapDataConnectUI”  Note: the numbers may vary depending on the version of Map3D or Civil 3D you are using.

Set the value to 1 to enable it.

Next open up Map3D and make the connection to the SDF file, but instead of using the Add To Map or Add to Map With Query , we now have an additional  option “Add to Map with Enhanced Style”.


Add the SDF data with the Enhanced Style option. Notice if you try to style that SDF layer using the normal style editor you will see that everything is grayed out and you can not change how it is displayed, add a scale range or create labels . As of right now there is no graphic users interface (GUI) to edit it.

Next step is to save the SDF layer out to a layer file. Right click on the layer in the display manger and select Save Layer.


Save the layer to a location you can get to easily for now while you are experimenting with this and give it a new name.


  Now remove the SDF layer from the Map display and disconnect from the SDF data file.

Next we start to edit the layer file we just saved, the layer file is in xml format and we can open and edit it with Windows Notepad. I suggest users stay away from some of the XML editors out there and edit with Notepad. With the layer file open scroll down to the line:

<Geometry> M 0.0, 0.0 h 4.0 </Geometry>


This is where we start editing the file. The geometry tag is telling Map3D how to display or draw the line for this data feature. It starts at 0,0 and draws a straight line 4 units horizontal. The syntax is a little different than what you use in creating a line definition for a lin file, but the same principal. The “m” stands for move to  0.0,0.0. It is the coordinate to start drawing the line at. The next part is “h” for a horizontal line then the 4.0 is for 4 units. That is all, a simple straight horizontal line 4 units long. What I want is a line with 3 vertical lines in the center of it.  First I change the 4.0 to 10.0 to make my line longer so the vertical lines are not too close to the end points.  Next I use the “m” to move to a new starting place of 4.5, -0.5, or 4.5 units to the right of the starting point of the line and 0.5 units under the line. Now I tell it to go vertical one unit up by using “v” 1.0. That draws the first vertical line one half of  a unit left from the center of the horizontal line up one unit. Next I use M 5.0, –0.5 V 1.0 for the second line and for the last line M 5.5, -0.5 V 1.0.


If you notice my screen capture of the edited file I formatted it to make it easier to read and edit, that’s what I like about Notepad other xml editors may give you errors when you try it this way.

Now there’s one other edit we need to make to get this new line to look right, I changed the length of the first horizontal line from 4 units to 10 units. So I need to change how often the line repeats though out the line segments in Map3D. Scroll down to the <Repeat> 4.0 </Repeat> tag and change the 4.0 to 10.0. I also changed the color to a red tint, the color tags <Linecolor>xxxxxxxx</Linecolor> uses a HEX value so if you need to change the color you need to know the HEX color values.


There is my editted layer file, now save the file and drop and drag onto the display manager or load it into Map3D with the load layer command. The results look like this:


The edited display.

So there you have it, custom line types for a data connect line feature. But don’t leave yet there’s more to follow in the next few weeks, not only can we create lines types like above we can create custom point markers or use a point marker in a line definition or create flow arrows in your lines and how about depression marks for contour lines?  More to come and if you try this you may notice your lines features may need some more editing to get them just right.


9 Responses to “Custom Line Types with Data Connect”

  1. 1 Tony Carcamo 03/04/2010 at 12:08 AM

    sorry to change the subject but how do you extract data or convert objects in a shapefile (shp) into basic autocad linework such as lines and polylines?

  2. 2 Dan Garrett 02/12/2010 at 12:50 PM

    On the Label those lot lines post. Can you do this on FDO data?

    • 3 map3d 02/12/2010 at 2:47 PM

      Dan, You can create a label for the length of a line feature but not for parcel (polygon features) also because lines features are polylines types there is no angle property to them so you can not get the bearings.


  3. 4 Dan Garrett 01/22/2010 at 8:33 AM

    Interesting. So you can’t use express tools, create line type for data connection line types. Don’t get me wrong, that is an awesome post. It’s that, where would you go to find out how to make all the different line types a person would want. I personally would want a line that looks a road or a highway for an example. Maybe two lines offset from each other, with a transparent color tint in between them.

    • 5 map3d 01/22/2010 at 9:06 AM

      Dan, What you are wanting is composite line types. You can do this now inside the style editor. Rick Chappell has a blog post in doing this.


    • 6 Dan Garrett 01/22/2010 at 11:57 AM

      Have you ever spent your whole live looking at a button and never pushed it. And that button can change your whole live for the better….. All this time, I’ve been looking at that button and untill today, i’ve never pushed it. I’m a new man and I feel stupendous!

  4. 7 Rick Chappell 01/21/2010 at 1:43 PM

    Nice post Murph. I had just figured how this works. Hopefully we’ll see a user interface for this soon.

  5. 8 Kevin Clark 01/14/2010 at 5:44 PM

    Way intense but it does get you there. Thanks for the info. When are you writing a book?

  1. 1 Neatline Trackback on 01/21/2010 at 1:40 PM
Comments are currently closed.


Readers Locations

Top Rated posts

Chat room


%d bloggers like this: