A Little Script Editing for Tree Surveys

by: James Wedding, P.E. | 04/14/2017
Estimated Reading time: 2 - 4 minutes

I’ve presented a “Don’t Bore Me with Your Site Plain,” class a few times now, detailing the process of taking a Civil 3D design over to InfraWorks and fully realizing all of the design’s beauty. We look at working with existing topography, plat information, site grading, parking striping, landscape elements–he full kit and caboodle. There’s a lot that can be done with Civil 3D and AutoCAD drawings just straight up, but some of the elements need a little love. To whit: tree surveys.

Most tree surveys include some form of measure and description as part of the process. Here’s a sample of some typical tree points:

511,13731574.1014,2064883.5545,888.3034,TR 13 OAK
512,13731560.3044,2064887.6989,888.4505,TR 21 OAK
513,13731554.0595,2064899.3509,888.2266,TR 21 OAK
514,13731586.7049,2064886.5761,888.2502,TR 13 OAK

Imported into Civil 3D and exported out as points in an SDF file, you can drag and drop these points in to InfraWorks. You’ll get something like this when you assign them a typical Tree style in InfraWorks:


Nice, but it doesn’t really reflect the variety and nature of a real tree survey. Let’s make that better. Thanks to my friend Wes Newman, I’ve got a little script to add to my SDF import operation:

function Process(SOURCE, TREES) {
 var descString = SOURCE["DESC"].split(/\s+/);
 TREES.NAME = descString[2];
 if (descString.length >= 2) {
      if (descString[2] == "OAK")
           TREES.RULE_STYLE = "3D Model/Vegetation/T19-V03 Dark Red";
           TREES.RULE_STYLE = "3D Model/Vegetation/T19-V03 Green";
      var scale = descString[1] / 12;
      TREES.MODEL_SCALE_X = scale;
      TREES.MODEL_SCALE_Y = scale;
      TREES.MODEL_SCALE_Z = scale;
 } else
 TREES.RULE_STYLE = "3D Model/Vegetation/T19-V02 Yellow";
 return true;

Now, this script works for my sample file, not yours. You’ll need to update and modify base on your tree survey coding setup, but I think you get the idea. Copy and paste this code into the Script tag of the Data Source Configuration dialog:


Now, click close and refresh, and you’ll see the change:


Notice that a scale factor has been applied, tied to the surveyed size of the tree. In this case, it’s a 20″ Oak, so 1.667′. I hope this makes your InfraWorks tree survey a little easier! Let me know on Twitter if you have any questions: @civil3D.


Rate this post:
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)