Tips & examples to help you make full use of Property Sets in Civil 3D
Labels and Tables
Property Sets can of course be used for adding annotation to our Civil 3D drawings. When Property Set data is added to a Civil 3D object, its fields are made available in the Label Text Component Editor.
We can also add the same information to Tables, although the Property Set data isn’t exposed in the Table Editor. To add PS data to a Table Column, type the required field into the Component Editor as follows:
<[PS:Pipes:Bedding(CP)]>
Where PS denotes Property Set data, Pipes is the name of the Property Set, and Bedding is the name of the field. The (CP) is a formatting field which in this example denotes Capitals Preserved.
Using Pick Lists
For many types of data, we would want to restrict the user to a specific list of possible values. This can be achieved by adding a List to our Property Data.
In the Style Manager, turn off the Filters.
This gives us access to more features, one of which is the List Definitions.
In this example, we’ve added a new list for Pipe Bedding. The list “Applies To” setting must be assigned to “Manual Property Definition.”
Items can then be added to the list as required.
In the Property Data set, the list can be accessed by adding a manual property, and then choosing the “List” option for the Type of field.
Notice we also have a Formula field whose source is set to the new Bedding_Class property. This is required as a List field and cannot appear in a Civil 3D label, but the Formula field will do.
After adding this Property Set to Pipes in the drawing, the user can select a value from the defined list.
VBScript in Formulas
Complex data fields that can read properties of objects and manipulate data can be created by using VBScript in formula fields. One of the issues you may find is that you’d like to know what commands are available to you, but the VBScript Code helper is empty.
The information that populates this is saved in an XML file. Since the PS feature has been “borrowed” from AutoCAD Architecture, the definition file is still available. It can be downloaded from this link: https://forums.autodesk.com/autodesk/attachments/autodesk/61/20135/1/ADT_VBScript.xml
Copy the file into C:\Program Files\Autodesk\AutoCAD 20XX folder.
The helper will then be populated as shown:
VBScript can be used to retrieve data from Civil 3D objects by making use of the Civil 3D API.
Here is a simple example that creates a field that displays either a manhole diameter or length x width, depending on whether it is a circular or rectangular structure.
RESULT="--"
On Error Resume Next
Set oApp=GetObject(, "AutoCAD.Application")
Set oCivilApp=oApp.GetInterfaceObject("AeccXUiLand.AeccApplication.13.0")
Set obj=oCivilApp.ActiveDocument.ObjectIDToObject([ObjectID])
If obj.BoundingShape = 1 Then
Result = CStr(obj.StructureInnerDiameterOrWidth*1000)
Else
Result = Cstr(obj.StructureInnerLength*1000) + " x " + CStr(obj.StructureInnerDiameterOrWidth*1000)
End If
The Civil Application must be set to the correct value depending on the version of Civil 3D.
The following codes are valid for recent versions:
2018 - 12.0
2019 - 13.0
2020 - 13.2
To use the code snippet shown above, the Object ID of the structure must first be defined as a property field using an Automatic property definition.
Property Set Commands
Aside from using the Manage ribbon to access the Property Set definitions, there are several commands that can be used on the command line that you might find useful:
We hope you find this post useful.
If you would like to consider a training course, explore our full range of Civil 3D training courses.
If you require any further information on Civil 3D, please feel free to get in touch.
Author
Dave Bosworth
As a Civil Engineering Surveyor, Dave worked for many years on construction projects across the UK where he gained unique experiences in the use of design technology in both infrastructure engineering and GIS/mapping.