Style template workflow for importing shapefiles

Style template workflow for importing shapefiles

m_kingdon
Advisor Advisor
3,153 Views
11 Replies
Message 1 of 12

Style template workflow for importing shapefiles

m_kingdon
Advisor
Advisor

Hi all,

 

Apologies if this is a simple question.  I am a Civil 3D user who is trying to incorporate GIS functionality into my workflow.

 

When I set up a new project I am importing shapefiles downloaded from the local authority GIS portal.  I want all the imported objects to conform to predefined styles, including custom labels.  Is this possible?

 

shapefile template 2.png

 

shapefile template.png

Mike Kingdon
Civil 3D Zealot

EESignature

0 Likes
Accepted solutions (1)
3,154 Views
11 Replies
Replies (11)
Message 2 of 12

ChicagoLooper
Mentor
Mentor

Sorry, you can't do that using the Toolspace because the shapefile isn't a Civil3D entity. For shapefiles, you'll need to use the Map Task Pane. 

 

<<Generally speaking, the Map Task Pane is to Map3D like Toolspace is to Civil3D.>>

 

Using the Task Pane, you can't really create a template but you can save the layer's styling and the pointers to the data source. Right-click the layer in the Task Pane=>Save Layer=>Name and Save this .layer.=>Click Save.

 

Then in a new drawing you may use the drag-and-drop method. Drag the saved layer from its folder and drop it directly onto modelspace. The dropped layer will display in modelspace and be listed in the Task Pane. The styling from the original drawing will carryover to your new one.

 

Although the function doesn't let you use the .layer as a template, it allows you to save the style to an external file. This means you can email this .layer file to another colleague in a another office in order to keep your styles consistent. Dragging-and-dropping doesn't lock you in to the layer style. In the new drawing, you are still allowed to modify and overwrite the style in the original layer file. 

 

Alternatively, you may use the MAPIMPORT command. This command will convert the Feature Data Objects (ESRI's points, lines and polygons) into AutoCAD entities. You can organize the Acad entities by placing each feature class on separately named layers. For example, road lines on one layer and stream lines on another. Or separate the transportation feature class by Type, e.g. Interstates, US Hwys, State Routes, surface streets, and private roads can each be place on separate layers.    

 

MapImport only requires the shapefile be available during the MapImport procedure. Once the import is completed, the shapefile is no longer needed. Saving this drawing will also save AutoCAD Properties, i.e. Layer name, color, line weight, linetype and transparency.

 

 

 

Chicagolooper

EESignature

Message 3 of 12

parkr4st
Advisor
Advisor

if you want the same symbol for a point,   yes

beware of copyright problems

There are libraries of symbols available.

within the libraries are Pictures folder or similar which hold graphics of the icons

 in map 3d points style- at the bottom of the select symbol drop down list    load....  navigate to the symbol

save the .layer file to maintain the connection

consider file locations if you have to share data.

I not sure about line styles

Message 4 of 12

m_kingdon
Advisor
Advisor

I can't seem to get that to work.  If I drag and drop a .layer it just adopts the suffix (1) without changing the layers currently in the drawing.  Doing the process the other way round has the same effect.

 

Am I missing something?

 

layer.PNG

Mike Kingdon
Civil 3D Zealot

EESignature

0 Likes
Message 5 of 12

ChicagoLooper
Mentor
Mentor

You can't make a template in Map3D. The procedure mentioned above only allows you to save the 'style' (or customizations) you've applied to a specific Stormwater Catchpit_points.

 

Once you've styled your shapefile, choose the color, symbol, line thickness, fill color, rotation, etc, etc, you can, you can save the style to an external .layer file.

 

If you need the same style applied to another set of Catchpit points, then you'll need to perform all the stylizations again. Draggin-and-dropping that saved layer file won't work on a second, or separate, shapefile. 

 

Alternatively, you may use MAPIMPORT on all the Stormwater Catchpits shapefiles in order to convert them into plain vanilla AutoCAD points. Be sure to 'Create Object Data' when performing the import. Once you have all the points converted from ESRI to AutoDesk, you can perform MAPEXPORT on all the catchpits. This will convert them back to a single huge shapefile that contains all catchpits. You can now apply a style to a single shapefile instead of applying the same style to multiple shapefiles.   

Chicagolooper

EESignature

Message 6 of 12

parkr4st
Advisor
Advisor

 a template in Map3d is a saved map with a .dwt extension.  

new map set CS put in the styled FDO data  and save it as a .dwt file.

open the .dwt file to start map and save the new map to the .dwg extension

are there two types of templates being discussed here?  Template from ArcMap?  don't cross up the lingo between applications.

 

maintain a "Master file" of all points and use queries to show different subsets of the data each with its own .layer file. Add new data to the FDO file and fill in the data table as wanted.  the symbol will appear in the map when the relevant data is entered.  Hydrant will show the hydrant icon when you tab off the field in the table.  Check in features to save it to the FDO file.

 

Before the .layer is saved go to the dataname(1) in task pane, double click and rename it i.e. Main Street Data

when the .layer is D &D into a map "Main Street Data" will be in the task pane

this will retain all the styling

 

Message 7 of 12

m_kingdon
Advisor
Advisor

I saved the drawing file with the modified layers as a dwt and using it as a template.  I then started a new drawing with this template, saved it as a .dwg, connected to a new folder of shapefiles but the problem with the layers still persists.  I can't get new data sources to adopt an existing layer. 

 

Coming from a Civil 3D background I really don't understand why having data conform to a style is so difficult!

 

I have been reading about styles and the existence of a Display Library.  I tried copying a layer into the Display Library but the paste option is greyed out.

 

map3d styles.png

Mike Kingdon
Civil 3D Zealot

EESignature

0 Likes
Message 8 of 12

m_kingdon
Advisor
Advisor

Just to clarify what I am trying to do.

 

I download GIS data from the local authority to start a new project.

Data is available in both GIS (shapefile) and .dwg formats.

 

Our current workflow involves using the .dwg format, which are drawings with vanilla CAD objects.  All relevant linework and point data needs to be manually labelled to be useful (pipe diameter, manhole depths etc)

By downloading and using the GIS shapefiles instead and using the Map 3D styles I can bypass the need to do manual labelling by using styles on each shape object.

 

The inability (or my lack of knowledge) to apply a style to an imported shapefile makes this workflow slow and essentially useless.

Mike Kingdon
Civil 3D Zealot

EESignature

0 Likes
Message 9 of 12

ChicagoLooper
Mentor
Mentor

I fully understand what you're trying to do and iIt can't be done. 

 

 It appears you are trying to take an AutoCad-ish concept and use it to on an ESRI product. GIS shapefiles to a template so all shapefiles follow a label style format=>No way, can't be done. I don't understand why you insist it can.

 

I would look at using the Mapimport command to bring in the shapefile. This command will turn the ESRI entities into AutoCad entities (Acad point or Acad line or Acad polygonal entities). The MapImport command also allows for the creation of OBJECT DATA. By creating OD, you would essentially turn the AutoCad entities into smart objects and would provide the ability to query, label, alter properties and all that other good Map3D stuff. Turning shapefile geometry into AutoCad entities combined with creating OD from the shapefile's dbf, would result in the best of both worlds: the familiarity to work with AutoCad entities and power of ESRI's shapefile database.

 

BTW, just because you don't create labels from OD, doesn't necessarily mean the database isn't attached to those imported entities, the data still exists, it just hasn't been used in mtext labeling. 

Chicagolooper

EESignature

0 Likes
Message 10 of 12

O_Eckmann
Mentor
Mentor
Accepted solution

Hi,

 

.layer file is an xml file which stores stylisation AND source data.

You can edit this file, rename source data to new SHP file location and save.

Then D&D this .layer to connect new data source with your stylisation.

For example, I've stylised my building SHP and export this to a .layer file.

image.png

At the end of .layer file you find your source location in <value> </value>

 

        <Provider>OSGeo.SHP.3.0</Provider>
        <Parameter>
          <Name>DefaultFileLocation</Name>
          <Value>D:\Donnees\IGN\BDTopo\Dept92_BD_TOPO_SHP\E_BATI\BATIMENT.SHP</Value>
        </Parameter>

 

You just have to find and replace with new location.

 

Olivier 

Olivier Eckmann

EESignature

Message 11 of 12

m_kingdon
Advisor
Advisor

I just got round to trying this, and yes it does seem to work.

My workflow.

  • Copy .layer files with custom styles into a new project folder (with new shp files just to keep projects organised)
  • Open each .layer file in notepad, rename <Name>DefaultFileLocation</Name> to new shp folder.
  • Connect shp folder in a new drawing
  • Delete the default layers and disconnect shp folder
  • Drag and drop .layer files with customer style into the new drawing
  • Reconnect shp folder.  The shp data will now update to the new .layer files that were just dragged in.

Maybe I could do a few steps in a different order, but this workflow seems to work fine.

 

Mike Kingdon
Civil 3D Zealot

EESignature

Message 12 of 12

mwalker3FJ4S
Observer
Observer

is there a way to repath multiple shape files? 

0 Likes