Automated Property Set Data - Part 1

February 5, 2021 Joe Hedrick, LS, EIT

Back in November, 2019, one of my colleagues created a video  that explains the basics of utilizing property set information inside of Civil 3D.  While they have been in Civil 3D for a few years, if you are new to the feature, I encourage you to watch this video as it explains some important concepts.

About 9 months ago, IMAGINiT began creating gravity and pressure part libraries for different regions in the United States.  One of the first libraries we created was Iowa Statewide Urban Design and Specifications or SUDAS for short.  One of the unique aspects of designing in Iowa is that while manholes are labeled with rim elevations, inlets are a little different.  They have a concept of “form grade” which is 6” lower than the insertion elevation.  The form grade is what gets annotated on plans for inlets.

 

The challenge was “How can we label this elevation in a consistent and automated workflow?”  We bounced some ideas around internally and settled on utilizing Civil 3D Property Sets.

Step 1 – Defining the Property Set Definition

Start by defining the property set definition.  This is essentially the container that houses the code that we are going to create.  The feature is found on the “Manage” tab of the ribbon.

Expand the tree and right click on “Property Set Definitions”, select “New”, and give the new definition a name.

Next, the definition needs to be associated to the correct object type(s) in Civil 3D.  From the “Applies To” tab, check the box for “Structure” since we will be applying this to gravity structure objects.  Note that property sets can be applied to almost anything inside of Civil 3D.

The rest of the work will be done from the “Definition” tab.  “Add an Automatic Property Definition” and select “Handle”.  A handle inside of AutoCAD is essentially a unique id number for the element.

In this application, knowing what the actual handle isn’t very beneficial so toggle the “Visible” checkbox so that it ultimately will not be displayed to the user.

The final part of the property set definition is defining a formula that subtracts 6” from the insertion point elevation.  Add a formula definition and in the resulting dialog box, give it a name.  In the lower left corner of the “Formula Property Definition” dialog box, double click on “Handle” which will add it in brackets in the upper left portion of the dialog.

The last part is to add the formula.  Property set definitions utilize VBScript which means to access properties of a Civil 3D object, the COM (VBA) API should be used.  The COM API is locked very specifically to a particular version of Civil 3D which means that the formula utilized will vary slightly depending on what version of Civil 3D is used.

The following code works specifically for Civil 3D 2021 and is simplified as much as possible.  This could certainly be more elaborate and elegant but this should get the point across.


     RESULT="--"

     On Error Resume Next

     Set oApp=GetObject(, "AutoCAD.Application")

     Set oCivilApp=oApp.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication.13.3")

     Set obj=oCivilApp.ActiveDocument.HandleToObject("[Handle]")

     Dim StructName, StructType,FormGrade

     StructName=obj.Name

     StructType=InStr(StructName,"IN")

     If StructType=0 Then FormGrade=obj.RimElevation Else FormGrade=obj.RimElevation-0.5

     RESULT=FormatNumber(FormGrade,2)


The first 5 lines basically initialize the method and gets the structure object.  The next line defines a couple of variables.  In an effort to automate this as much as possible, I am going to use the structure naming convention as a way to delineate between manholes and inlets.  Remember, rim elevations are labeled for manholes while the form grade elevation is labeled for inlets.  If the structure name contains “IN”, then the form grade elevation will be the rim elevation – 0.5’.  If the name doesn’t contain “IN”, it will simply equal the rim elevation.  The final line of code simply rounds the result to 2 decimal places.

Copy and paste the formula into the “Formula” section of the dialog box.  Replace the [Handle] that was added in the previous step.

Select “Ok” and the formula definition will be added to the overall property set definition.  Note that this one should be “Visible”.

 

Select “Ok” to close out of the “Style Manager” dialog box.  Congrats!  The new property set definition is now defined.  Next step is to apply it to some structure objects.

 

Step 2 – Adding the Definition to the Objects

Below is a simple pipe network that I will be using for this demonstration.  It has a mix of manholes as well as inlets that conform to the naming convention I explained previously.

The easiest way to add a property set to objects is utilizing “Properties”.  From the “Extended Data” tab, select “Add Property Sets”, select the objects (select similar works great in this situation), and pick the property definition(s) to add to the structures.

That is all there is to it!  The property set was added to the selected structure objects.  Lets do some checking to make sure everything is working correctly.

The property set information will be displayed in the “Extended Data” tab.  Notice when a single inlet is selected, the form grade displayed is 0.5’ lower than the rim elevation.

I noticed when checking the final manhole that it was mistakenly labeled as an inlet.  The property set information was displaying correctly based on the definition but incorrectly because I labeled it wrong.

Simply changing the label will update the property set data.

 

Congrats on making it to the end!  To quickly recap, the post described the process of creating a new property set definition from scratch, used a formula to define some simple logic and perform calculations, and assign that definition to objects in a drawing.  A video demonstrating these steps can be found here.  Stay tuned to the next couple of posts where this data will be incorporated into labels and tables.

About the Author

Joe Hedrick, LS, EIT

Solutions Architect<br><br>As a Solutions Architect, Joe assists clients in developing implementation plans for Autodesk Infrastructure products as well as provides consulting services. <br><br>Joe has over 25 years of experience in land surveying and civil engineering encompassing field-data collection, site design and layout, residential subdivision design, and land planning. He is an EIT and a licensed land surveyor in Virginia, and earned his Bachelor of Science degree in Civil Engineering Technology from Old Dominion University in Norfolk, Virginia. <br><br>

Follow on Twitter Follow on Linkedin More Content by Joe Hedrick, LS, EIT
Previous Article
Automated Property Set Data - Part 2
Automated Property Set Data - Part 2

Next Article
Recreating Problem Drawings Part 4: Layout Recreation
Recreating Problem Drawings Part 4: Layout Recreation

Using the Design Center to recreate drawing assets.

×

Get Tips Delivered.

Subscribe to Email Updates.

First Name
Last Name
Country
Thank you!
Error - something went wrong!