Communities.bentley.com-Importing a CAD Drawing Using Modelbuilder TN

10
 communities.bentley.com http://communities.bentley .com/Products/Hydraulics___Hydrolog y/w/Hydraulics_and_Hydrology __Wiki/importing-a-cad-drawing-in- bentley-watergems  Applies To Product(s): Bentley WaterCAD, Bentley WaterGEMS, Bentley HAMMER, Bentley StormCAD, Bentley SewerCAD, Bentley SewerGEMS, Bentley CivilStorm  Version(s): 08.11.XX.XX  Environment: N/A  Area: Layout and Data Input  Subarea: N/A  Original Author: Jesse Dringoli, Bentley Technical Support Group  Importing A CAD Drawing Using Modelbuilder [TN]  Overview Some older versions of the Hydraulics and Hydrology product line (WaterCAD, WaterGEMS, StormCAD and SewerCAD) used a much different procedure for converting "polylines to pipes", compared to the 08.XX.XX.XX versions. This TechNote provides tips and techniques for effectively importing a CAD drawing into V8 XM or V8i using the new method. This procedure is similar for WaterCAD, WaterGEMS, HAMMER, StormCAD, SewerCAD, SewerGEMS, and CivilStorm.

description

Importing a CAD Drawing Using Modelbuilder TN

Transcript of Communities.bentley.com-Importing a CAD Drawing Using Modelbuilder TN

  • communities.bentley.comhttp://communities.bentley.com/Products/Hydraulics___Hydrology/w/Hydraulics_and_Hydrology__Wiki/importing-a-cad-drawing-in-bentley-watergems

    Applies To Product(s): Bentley WaterCAD, Bentley WaterGEMS, Bentley HAMMER, Bentley StormCAD,

    Bentley SewerCAD, Bentley SewerGEMS, Bentley CivilStorm Version(s): 08.11.XX.XX Environment: N/A Area: Layout and Data Input Subarea: N/A Original

    Author:Jesse Dringoli, Bentley Technical Support Group

    Importing A CAD Drawing Using Modelbuilder [TN]

    OverviewSome older versions of the Hydraulics and Hydrology product line (WaterCAD, WaterGEMS, StormCAD andSewerCAD) used a much different procedure for converting "polylines to pipes", compared to the 08.XX.XX.XXversions. This TechNote provides tips and techniques for effectively importing a CAD drawing into V8 XM or V8iusing the new method. This procedure is similar for WaterCAD, WaterGEMS, HAMMER, StormCAD, SewerCAD,SewerGEMS, and CivilStorm.

  • BackgroundIn older versions of WaterCAD, WaterGEMS, StormCAD and SewerCAD, the user would import a CAD drawing(.dxf or .dwg) via File > Import > Polyline to Pipe. Upon release of the V8 XM edition, this functionality wasmerged into Modelbuilder, which is a powerful tool used to import many different types of data. Since the steps inthe Modelbuilder process are very similar for most data source types, there are some extra options involved for aCAD drawing, which could initially cause some confusion to new users of V8 XM and V8i.

    Preparing the CAD Drawing

    1. First, you should take some time to clean up your CAD drawing prior to performing the conversion. Look forentities that should not be converted, such as leader lines, and move them to their own layer. Turn off or removelayers that you do not wish to convert. Do a quick review of your drawing and correct any potential conversionproblems that you may find.Note: It is recommended that you perform a "save-as" before cleaning up thedrawing, so that you can retain the original.

    2. Next you will need to save your CAD drawing into a DXF format, as this is the only CAD type format thatModelbuilder currently accepts. DXF is the "drawing exchange format", so almost all CAD programs have theability to save to it. Whenever possible, try to save to the earliest DXF format, for better compatibility. Forexample, in AutoCAD, go to File > Save As, and choose "2004 DXF" as the format.

    Importing Your CAD Drawing Using Modelbuilder Note: This process remains the same whether you are in the standalone, AutoCAD,Microstation, or ArcGIS platform.This process also assumes that you have certain pipe diameters separated by layerand thatyou're using V8i version of the software. If you're using V8 XM instead, the stepsin the Modelbuilder process will look slightly different, but basic procedureremains the same.

    1. Open WaterCAD/GEMS and start a new project. Ensure that the correct unit system is specified.Go to Tools >User Data Extensions.

    2. Right click on "Pipe" and choose to create a new user data extension. We will import the layer name into thisfield so that we can assign diameters at a later point. Give it a name, keep the default data type of "Text" and clickOK.

  • 3. Start Modelbuilder by going to Tools > Modelbuilder. In the main window, click the "New" button to start a newModelbuilder run.

    4. In the first step, select "CAD Files" as the Data Source type and browse to your .dxf file. Once selected, atable will be displayed in the lower left corner, showing all the layers that exist in the drawing. Layers that youwould like to be imported should be checked. Unchecked layers will not be imported. The layer type will bedisplayed after the name of each layer, showing you if the layer contains points, lines, or polygons. In thisexample, we have checked only the layers that represent water distribution pipes of various diameters. Layerscontaining roads, annotations and other irrelevant items have been unchecked:

  • Note: If you have a lot of layers that need to be unchecked, you can right-clickanywhere in the list and choose "clear selection".Note: In many cases, nodal elements such as tanks, pumps, etc are represented in aCAD drawing as a series of lines. In this case, they cannot be imported as theirrespective nodes in the modelbuilder process. The user must enter these elementslater on after the import.

    5. Click the Next button to proceed to the second step. In this step, you should select the appropriate unit andalso make sure the check box next to "Establish connectivity using spatial data" is checked. This option allowsModelbuilder to use the spatial information inside the CAD file (lengths, coordinates of endpoints/bends, etc) tobuild the model, instead of the user needing to explicitly specify the start/stop node (which is typically not possiblefor a CAD drawing.)

    In addition to this, the "Tolerance" field will allow Modelbuilder to automatically connect pipe end points that arewithin the specified value. Make sure "Create nodes if none found at pipe endpoint" is checked. In most cases,only polylines are imported from a CAD drawing, so you'll want junctions to be created at the ends of these.

  • For the "Tolerance" options, takethe following CAD line for example:

    In this zoomed-in view, notice thata gap exists due to drawingimperfections. This gap is 1.5ftwide. Now, if we import this CADfile with 1ft set as the tolerance, itwill create two nodes at the actualend points of these pipes:

    This is because the distancebetween the end points was notwithin the tolerance. If we were toinstead import this drawing with a2ft tolerance, it would connectthese end points and join them at ajunction:

    6. In the next Modelbuilder step, you willonly need to keep the "Add objects todestination if present in source" box checked, since we arecreating new elements based on the CAD drawing data.

    7. In the next step, accept "Current scenario" and "Label".

    8. In the next step, you must configure how the data in eachlayer is mapped to WaterCAD/GEMS. Click each layer from thelist on the left and then configure the attributes on the right:

    "Table Type"

    This is used to select the type of element that a layer will beimported as. For a CAD file, you will most likely be importingpolylines only. So, this field will be set to "Pipe" (for WaterCAD,WaterGEMS and HAMMER) or "Conduit" (for SewerCAD,SewerGEMS and CivilStorm).

    "Key/Label"

    This is the field used to create labels for the elements created bythe modelbuilder process. It is also used to link up elements whenupdating existing ones. In the case of importing a CAD drawing,most likely a field containing unique labels does not exist for thepolylines. So, you should select "" for each layer. This willcause Modelbuilder to automatically generate unique labels,utilizing a combination of an element's layer type label, its shapetype, and a numeric ID that represents the order in which it wascreated.

    "Start"/"Stop"

    Choosing the "Establish connectivity using spatial data" causes the connectivity information to be taken from theCAD drawing, so you do not need to specify a start/stop node field for the pipes/lines. So, simply leave these as "".

  • "Attribute"

    At the bottom right corner of this Modelbuilder step, the usercan link fields in the source data to fields in the program. In thecase of a CAD drawing, typically there are no additional, usefulattributes. However, you could link the "Layer" field to the userdata extension attribute that you created in step 2. In thisexample, the user data extension was named"AutoCADLayer":

    By linking this field, there will be an attribute in theWaterCAD/GEMS model that contains the name of the layerthat the pipe came from. Later on this will be useful.

    Note: Make sure that you set the key/label field and "layer" mapping for eachlayer. If your DXF contains points, they will show up as separate layers on theleft side. You can then click and assign them to a node element type such asJunction.

    9. In the last Modelbuilder step, choose to build the model. Modelbuilder will then import the layers and provideyou with a summary, including a "Messages" tab that you can use to view informational messages about theimport process. In this case, there are some messages about nodes being created due to missing start/stopnodes. This is expected since we were only importing polylines, with the "Create nodes if none found at endpoint"option selected.

  • 10. After

    closing the summary and closing Modelbuilder, you will be prompted to synchronize the drawing. Choose "Yes"and your model should show up in the drawing area. If it does not, then go to View > Zoom > Zoom Extents.

    Note: Upon completion of your ModelBuilder run, it is suggested you use theNetwork Navigator tool to identify any connectivity or topological problems in yournew mode

  • Assigning Pipe DiametersNow that our model has been created, we can assign diameters to the pipes, based on the layer attribute that weimported.

    1. Open the pipe flextable via View > Flextables.

    2. Click the yellow Edit button () and add your user data extension. To do this, first find it in the list on theleft side, click on it, and then click the single arrow button pointing to the right side. Click OK and you willnow see a column in the flextable, containing the layer that each pipe came from. In our example case, thelayer "12_WATER" represents 12" pipes, "16_WATER" represents 16" pipes, and so forth.

    3. Rightclickonanyof the

    column headers, choose "Filter", and select "Custom". In the query window, double click on your user dataextension field from the list on the left and click the equals sign button. Then, click the green button on the top-right corner to retrieve a list of unique values from this field. Double click on one of the diameters (layer names)shown. In our example case, we'll start with the 10" layer:

  • When you clickOK in the querywindow, theflextable will befiltered to onlyshow pipes thatcame from thelayer that youqueried on(those from the"10_WATER"layer in ourexample case.)

    Note: After performing your filter, the bottom left corner of the flextable willshow you how many pipes met the query condition and are displayed (for example "68of 4714 elements displayed")

    4. Now, assign the correct diameter by right clicking on the "Diameter" column header and choosing "GlobalEdit". Keep the operation as "Set", and enter the appropriate diameter as the value. Click OK and your diameterswill be assigned.

    5. Repeat steps 3 and 4 for each layer, assigning out all your diameters.

    Note: When done, you can reset your filter by right clicking on any column headerand then choosing Filter > Reset.

    Note: An alternative way to assign diameters would be to bring each layer in oneby one. Instead of using the user data extension, create a Prototype under View >Prototypes, and set the pipe diameter to the smallest one in your CAD Drawing.Next, uncheck all layers in the first Modelbuilder step except for the onecorresponding to that diameter. Import the pipes per above and they'll be assignedthe diameter specified in the prototype. Next, change the pipe prototype diameterto the next size, open the Modelbuilder run again, uncheck the first diameter andcheck the next one. Continue on like this for each diameter.

    See AlsoProduct TechNotes and FAQs

    Haestad Methods Product Tech Notes And FAQs

    External LinksWater and Wastewater Forums

  • Bentley Technical Support KnowledgeBase

    Bentley LEARN Server

    Importing A CAD Drawing Using Modelbuilder [TN]OverviewBackgroundPreparing the CAD DrawingImporting Your CAD Drawing Using ModelbuilderAssigning Pipe DiametersSee AlsoExternal Links