Adding Parameters to Custom Subassemblies

When working with the out-of-the-box subassemblies in Civil 3D, you can normally manipulate many different values.  These values give the user more control over the shape of the subassembly, so they can get a more accurate representation of the design.  Having this control can be a great time saver!  Creating a basic subassembly is described in part 2 of the series, but in this entry we are going to focus on giving the user more control over the subassembly.

Out of the Box

In the picture above, you can see the Parameters tab of the Subassembly Properties menu.  From here, There are input values that the user can modify and output values based off of the values supplied by the user.

These parameters can be setup inside of the Subassembly Composer in the Input/Output Parameters tab.

Input and Output Parameters Tab

Press the large gray “Create parameter” button to begin.  When you are creating these properties, you should start by selecting a type and then naming the parameter.

Parameter Type

To setup a parameter controlling the width of my assembly, select Double as the Type and give it a name and default value.

Width

Once the parameter is made, you just need to insert the parameter where it is applicable.  In this case we are setting up a value that controls width, so naturally we want it to be used when adjusting the horizontal offset or Delta X.

Delta X

We can also create simple equations with your parameters, using arithmetic operations such as addition and multiplication.  This means that instead of specifying Width I could set this value to Width*2-1.

Double is only one of the parameters we have available.  As you can see below there are actual several different types.

Parameter Type

Each has its use.  Notice in the image below some of the values have different formats, such as a ratio when using slope and a percent when using grade.

Example Parameters

One of the parameters that is easy to overlook is String.  I like this type because it allows you to be able to change shape or link codes on the fly.  To do this, all you have to do is create a material parameter for each shape and input the parameter into Shape Codes property.

Material Code

From here, we should be able to adjust all these parameters in our new custom subassembly.

Custom Subassembly Properties

Parameters can give the users a huge amount of control.  Be on the lookout for my next entry in this series, which will help enhance that control by giving our subassemblies the ability to seek out targets.

 

Leave a Reply

Your email address will not be published. Required fields are marked *