Trimble
PDF Export RSS - Latest News


Import from DWG with textures

This tutorial shows how to create a DWG conversion rule, which links the layer names as keys in the conversion, or map them to properties.

The layer name in Autocad is in many cases built up of several paragraphs and carries the properties for the objects

  • 3D_«Drawing key»_ «Free text»_X_«Fase»_«Drawing key»_«Materialcode»
  • Eks: ”3D_K_Bridge_X_F99_H_ Concrete01
  • When converting, we can use the “free text” link as a conversion key.

In the example below, we will import a DWG (can be downloaded for testing here), consisting of the following AutoCAD layers:

  • 81020_K_Bridge_XFP1_K_Concrete01
  • 81020_K_Trafficbarrier_XFP1_K_Steel08

We will import the DWG, set up a Regular Expression in the conversion, and convert to Bridge and Trafficbarrier objects, with textures. A “regular expression” describes one or more strings to match when you search a body of text.

Start the import tool, and select the DWG file to load.

Click Select Rules

In the next dialog, click New, then give the rule a suitable name.

You are now in the Conversion Rule editor. Click New Rule .

For this example we set up Source Feature = CadSolid and Source Attribute = layer. In Convertion Key Value, click * Edit Value….

Type in Bridge under substring and click OK.

A regular expression for the text string “Bridge” is now filled in. Also set Destination Feature to Bridge. Now, if the text string “Bridge” is somewhere in one of the AutoCAD layer names, it will be mapped to feature Bridge. Since we have a layer name called “1020_K_Bridge_XFP1_K_Concrete01”, this layer will be converted to Bridge.

Do the same thing for the Traffic barrier.

Click Attributes Conversion per Feature (marked yellow in the picture below).

First we add the attribute bridgeMaterial for the bridge. Set up like the picture below shows. bridgeMaterial we get from acadProperties.layer (the AutoCAD layer name).

Click the mapping button to the right in the row for bridgeMaterial. Then we set up the mapping. Set up as the picture below shows, with Regular Expression you can type in yourself (/.*Xxxxx.*/i). In this case, if “Concrete” exists somewhere in the layer name, bridgeMaterial will be mapped as Concrete [1].

Similarly, we add the textureName property for Trafficbarrier. Set up like the picture below shows. we get from acadProperties.layer (the AutoCAD layer name).

Click the mapping button at the right of the row of textureName. Then we set up the mapping. Set up as the picture below shows, with Regular Expression you can type in yourself (/.*Xxxxx.*/i). In this case, if “Concrete01” exists somewhere in the layer name, textureName will be mapped as T_Concrete01..

You can of course set up many more mappings for textures here. All available textures that can be mapped are found with the installation:

C:\Program Files\Vianova\Novapoint\<version>\Configuration\Textures

Now do the same for the conversion of the Traffic barrier. Here, the properties for constructionMaterial and textureName are used. Set up like the picture below shows.

Click OK in the Conversion Rule editor, and select the conversion rule when completing the import.

Now we can see the result in 3D. We must select the drawing rule Default, as this drawing rule supports textturing. The end result will be like this:

Last modified: 2017/08/03 12:08 by vn_no_jko
CC Attribution-NoDerivs 3.0 Unported License.