Friday, February 27, 2015

Subassembly Composer, A Primer -- Part 6, Creating a Shape

Article by Timothy Corey

Having left our exploration of Subassembly Composer at the point where we know how to set both geometric and surface targets, we realize that every subassembly we have created has been zero-thickness. You can create surfaces from this type of subassembly, you can quantify it using QTO Manager but you cannot take advantage of Civil 3D's Material Volume reporting capabilities...

Until now. This part of the primer will show you how to create a basic Shape object in Subassembly Composer. By now you know how to create points and links, so for this exercise, we let you alone to create your version of a sidewalk. Use your own numbers to make a rectangle, something like this:

Before you draw your shape, one important consideration. Will you be creating Surfaces from the Link Codes you apply to your shape? If so, remember, Civil 3D surfaces cannot handle vertical faces. Although you could rely on your users to set Overhang Correction in their Corridor Surface creation, many find it more reliable to do the correction themselves.

For example, say we plan to use the base of the Shape as a Datum surface. If we were to rely on Overhang Correction for this assembly, the far right end of our sidewalk would likely be missed in modeling the Surface.

To model this correction into the subassembly, we created the lower right point an X offset of -0.001 from the upper right point. To create the lower left point, we used an X offset of 0.001. 

If you only plan to use this subassembly for quantity takeoff, but not for a surface, ignore what was said above and use vertical faces all you like.

Back to the How-to: To create a Shape, drag the Shape tool from the Toolbox to the Flowchart.

Now, all you need to do is add the Links that define the Shape. You can either press the Add Link button four times or you can press the little box with pointer icon at the right end of the box. Press the icon and then select inside the shape.

The next part of the series will show you how to allow users to assign their own Point and Link Codes while placing your custom subassembly. It might be a couple of weeks, as our schedule is full.

Monday, February 23, 2015

Subassembly Composer, A Primer -- Part Five, Targeting other Geometry

Article by Timothy Corey

Now you are able to target a surface and you are able to make the link decide on cut or fill. The office staff are astounded at your abilities. A raise is imminent.

But now some dufus senior engineer says he wants to be able to target some other geometry, like a feature line, an alignment, a profile or a 3d polyline. Why the heck would he need to do that? He can already target a surface. "Ok, whatever, dude, I'll do it."

Start a new subassembly and add your UserSlope input parameter. You should be pretty good at this step by now. For this subassembly, we will also want a User Offset input parameter.

The subassembly will use this value in any area it cannot find its assigned targets. It is common that a subassembly does not find assigned targets. For example, you are grading in an area with an existing retaining wall. Along the wall, you want your new point to grade to the existing base of wall. The retaining wall does not extend the entire length of the corridor region, so parts of the region need an assigned offset.

Next, move to the Target Parameters tab and add two parameters: one for offset and one for elevation.

Although you might want to use the same drawing object for both offset and elevation, you must create two parameters and the user must assign the same object twice when setting the targets. There is no "both" option. Should there be? Yes, in the author's opinion, there should.

Add P1 at the origin. Add P2&L1. Set Point Geometry Type to Slope and Delta X. Specify your UserSlope input parameter for Slope and UserOffset for Delta X. For Offset Target, drop the list down and pick your TargetOffset parameter. Same for Elevation Target. This critical step is what allows your user to specify target geometry from the Parameters tab of Corridor Settings.

Save and test in Civil 3D.

Your rise in status to office hero continues unabated. Congratulations.... for now.

Part 6 will show you how to create a Shape in Subassembly Composer, because the world is neither flat nor zero-thickness.


Wednesday, February 18, 2015

Subassembly Composer, A Primer -- Part Four, Deciding on Cut or Fill


Article by Timothy Corey


Well, that's pretty cool, now we can make a surface link by creating a Surface Target Parameter and targeting it with our point and link. Sweet.

But we want more. The current surface link will cut or fill based on whether UserSlope is positive or negative, but won't decide if we are in cut or fill on its own.

That's where a Decision (Toolbox window) comes in.

We will start this primer with a subassembly that has the UserSlope and SurfaceTarget parameters that we created in Part 3, but delete everything from the Flowchart, except the Start object.

Add P1 at the origin.

Drag a Decision from the Toolbox to the FlowChart. Drop it below P1.

The Decision object is your basic If/Then or True/False option provider within Subassembly Composer.

What we need to determine is whether P1 sits in cut or fill, below or above the surface at this location.

In the Properties window, in the Condition box, you will see grey text saying Enter a VB Expression here. Click in the box and type P1.DistanceToSurface(SurfaceTarget)<0 font="">. Inside the parentheses is the name of your Surface Target Parameter. If Subassembly Composer accepts the expression, you won't see a little warning symbol.

In the example, I have changed the labels to Fill and Cut. If the Distance to Surface is negative, less than 0, that means we're in cut, and vice versa.

Drag a new point below the Decision. It will connect to the Cut side (left) of the Decision.

Set the properties of P2 so that it targets a surface at a positive UserSlope.

Notice the use of math.abs to be sure we get a positive number from UserSlope.

Now add P3 and connect to the Fill side of the Decision.

And set its properties:

Notice the - sign in front of math.abs(UserSlope). This forces the slope in a fill direction.

Test this by changing the Preview Value of SurfaceTarget (target parameters window) from a positive to a negative number.

A more succinct method of doing the same thing, without need for a Decision, is to put an If statement right in the box for P2 Slope, like this:

Thanks to our friends at for this suggestion. 

Of course, test in Civil 3D before distributing to your amazed colleagues. The boss is gonna be astounded and your job will remain secure....until he asks for the users to be able target feature lines, alignments and profiles. That's Part 5.

More about VB Expressions in Subassembly Composer here.

Saturday, February 14, 2015

Subassembly Composer, A Primer -- Part Three, Targeting a Surface


Article by Timothy Corey


Now you have a subassembly that is meant to connect to a curb subassembly. This new subassembly lets the user apply slope and offset values for creation of a new point and link.

It doesn’t do much, but there is awesomeness in its power.

The engineers in the office love this new subassembly and you have become a hero among them. Then…that new guy, right in front of the boss, asks if you can make the new point intersect with a surface. The boss looks at you, “Yeah, can you make it do that?” If you don’t make it do that, he might ask, “Yeah, can you make it do that.” He has internet, he knows it can be done.

The good news is, yes, YES, it’s simple to create a surface link with Subassembly Composer. Your position is secure, or will be once you read to the end of Part 3 of this primer.

At this point in our process, we will create a new subassembly file in Subassembly Composer. We have saved the previous file in a secure location.

The new point is going to target a surface and we want the user to be able to supply the slope. As before, we will need an input parameter for slope, but we will also utilize the Target Parameters window. 

Use Packet Settings to name your subassembly as you wish.

Create your user slope input parameter like you did in Part 2 of this primer. 

Now, something new! Move to the Target Parameters tab. Create a new parameter and name it something meaningful, like SurfaceTarget. No spaces allowed in the name. The user sees what you use in the Display Name column. Preview Value is an elevation for the surface in the preview window. This allows you to test your subassemblies, especially as they become more complex. And, of course, be sure you’ve set the Type to Surface. 

Now, create P1 at the origin and then add P2 and L1. Set the point geometry type to Slope to Surface. Replace the default slope value to the name of the input parameter you created for slope. I used UserSlope for mine. For surface target, drop down the list and pick the target parameter you created. 

You’ll see its name there and once you pick it, your link will appear in the Preview window, unless you left the Preview Value of the surface target at 0. Remember that setting, back on the Target Parameters window?

Save your subassembly, import it into Civil 3D and give it a try. Pass it around to your colleagues.

What, your boss said he knows there’s a way to make it check for cut, but go to fill if it needs to? Part 4, coming soon… 

Sunday, February 8, 2015

Subassembly Composer, A Primer -- Part Two, Using Input Parameters

Article by Timothy Corey


You have successfully created a custom subassembly that slopes away at five percent for ten feet. That's pretty cool, but now the designers are complaining that they want to be able to change the slope and offset.

You need to add some input parameters to your subassembly. Here's how.

In Subassembly Composer, go to the Input/Output Parameters tab in the lower right of the screen.

I usually set my Side parameter Default Value to Right. Do as you wish with that.

Press the Create parameter bar (it's a button that looks like a bar, and it's easy to hit it when you don't mean to, making parameters you don't want or need. Be careful, you can't delete a parameter once your press the button.) I called my first parameter User Slope. Set Type to Grade, Direction to Input, Default Value to whatever you want as the default slope and DisplayName to what you want the user to see in the Properties dialog in AutoCAD Civil 3D.

Input the UserOffset parameter using the values above.

A couple of notes: This example uses Grade for UserSlope because I want the default user-input to be in percent. If you want run:rise slope input, use the Type called Slope. I used Integer for the UserOffset Type because I want input to be in whole units. If you want to be able to use decimals, set the Type to Double.

Almost done now, but we need to tell our subassembly point P2 to use these parameters instead of fixed values. In the Flowchart or Preview window, pick P2. On the Properties window, replace the Slope value of -5% with UserSlope. No quotes, just that name. If you mis-type, you will get a red warning symbol, so if you don't see that, you know you typed it correctly.

Replace Delta X of 10 with UserOffset.

Go to the Packet Settings tab and rename the subassembly. While I am building a subassembly, because I might test it in AutoCAD Civil 3D and then come back to Subassembly Composer to tweak it, I use 01, 02, 03 at the end of the subassembly and file names, incrementing each time. This allows me to continue to load versions of my subassembly into AutoCAD Civil 3D without closing and re-opening each time. Use Saveas to save the pkt file.

Go back to Civil 3D and import the updated subassembly.

Erase the previously placed subassembly from the assembly and then place the updated version. Notice that the Properties dialog now lets you input Slope and Offset. Try various values and see how your subassembly changes. In the example below, I have changed the values to 12% and 5 feet of offset.

That's it for part two of this primer. Part three will cover creating targets. Coming soon...

Subassembly Composer, A Primer -- Part One, The very basics


Article by Timothy Corey

Many of our Civil 3D users want to realize the value of Subassembly Composer, but are spinning their wheels getting started. A common refrain is, "I know what it does, but the process of how to do it is just not clicking."

If that's you, stick with me through this primer.

Familiarize yourself with the Subassembly Composer user interface.

Tool Box, contains the tools you will use to place subassembly points, links and advanced decision making instructions.

Item 2 is the Flowchart. When you place a tool, you drag it from the Tool Box, you drop it in the Flowchart. As build your subassembly, the flowchart is where you'll interact with the various points, link and other tools you place. You will manage links between them here.

Below the Flowchart is Properties (Item 3 in the top image.) Each tool you place will have properties that control it. For example, when you place a point, its properties let you define where it is placed in reference to another point. Maybe you want to go ten feet at 25% slope. You will tell Subassembly Composer this in the Properties window.

Item 4 is Preview. As you create more points and parameters, they will be displayed in the Preview as though you were viewing a cross section. Use Preview for reference, but be aware, as your subassemblies become more complicated, not all your points and links will display.

Picking a point or link in Preview will load its properties in the Properties window. This can be more intuitive than reading your way through the flowchart.

Item 5 is a combination window that includes Packet Settings, Input/output Parameters, Target Parameters, Superelevation and Event Viewer.

Go to Packet Settings tab to name your subassembly.

Input/output Parameters is where you define user-changeable values like slopes and offsets.

Target Parameters is where you define Surface, Offset and Elevation targets. If a point you place is supposed to intersect a surface, you will need a surface target. If you want a point to follow a feature line, 3d polyline, alignment or profile, you will need Offset and/or Elevation targets. We'll explain.

Create a subassembly that creates a point at pre-defined slope and x offset.

This is the most basic point you can create in Subassembly Composer, so it's a great place to start.

We are building a new road with travelway, curb and shoulder. For the travelway and curb, we have used existing Civil 3D subassemblies.

Our first custom subassembly will add a shoulder from the back of curb. The shoulder will be sloped away from the curb at five percent and will be ten feet wide.

In Subassembly Composer, drag a Point from the Tool Box to a place below the Start image in the Flowchart.

Now focus your attention below the Flowchart, to the Properties window. Point number will be P1 and will increment as you insert more points. This is the starting point of our shoulder subassembly and we will place our next point in reference to this point, P1.

In the Properties window for P1, note the From Point is automatically set to Origin and the Point Geometry Type is Delta X and Delta Y. Leave these values for this point.

If you want to place a point code here, you can, but in the example we are not placing a point code on this point because we plan to use a point code, supplied by the Curb subassembly and to which this point will be attached, for all drafting, reporting or modeling.

Now, drag another point from the Tool Box to the Flowchart. This will be P2 & L1. P stands for Point, L for Link. Notice the arrow pointing from P1 to P2 & L1. That shows you the connection between points.

In the Properties window, change the Type from Delta X and Delta Y to Slope and Delta X. We said the point will be sloped down at 5 percent and 10 feet right of the connection point, so we need to set the point creation type to match the value types we have. Take a moment and read the other types.

From Point should be set to P1. Set slope to -5%. If you don't want to enter the % sign, enter -.05. If you type 5 without the percent sign, you will get 500 percent. Optionally, you can type 5%. Type 10 for the offset.

Notice that for this point, we have entered a point code of "Shoulder." You must use the quotation marks to enter a string of text for the point code. If you do not want a link between points, you can scroll down and uncheck Add Link to From Point. You can optionally add multiple link codes like "Top" "Datum" "Pavement"  Either be sure each is enclosed in quotes or put all inside one set of quotes, but add commas between: "Top, Datum, Pavement"

We're almost done with this most basic subassembly. Move to the Packet Settings tab and give your creation a name.

Then go to the upper left corner of Subassembly Composer and use SaveAs to save your packet file. Pay attention to where you put it.

Go back to Civil 3D where you have your assembly design started, ready to have the shoulder attached. On the Ribbon, go to Insert tab, click where it says Import in the Import panel. This will expose extra functions. Pick Import Subassemblies...

This location has been changed for 2016. Import Subassemblies has graduated from the dropdown to the main part of the Import panel.

For Source File, press the file folder icon to browse and select the .pkt file you just saved.

Pick the tool palette onto which the new subassembly should be placed.

So now you've imported your custom subassembly into AutoCAD Civil 3D. Here is it is on my Custom SubAssy's Tool Palette tab.

Attach it to the back of curb like you would any other subassembly. As you place the new subassembly, notice the settings in the Properties window.

There is some information being reported, but no settings can be changed. What if you want the user to be able to change the slope and offset values? That's where creating Input Parameters come in and that's the next lesson, Part Two.