Monday, August 31, 2009

I’m Giving it Away

Trading my way to AU has been a total failure, so I’m going to give away the book, Introducing AutoCAD Civil 3D 2010, that I traded for (unless you want to trade for it to keep the trades going). If you do get it all I ask is that you provide a review of the book.

To get my copy of Introducing AutoCAD Civil 3D 2010 just post in the comments your favorite post from this blog. I’ll put all of the names of people who provided a comment in a hat and let my daughter pick a name from it on Monday September 7, 2009.

Now off to think about another way to get to AU.

Thursday, August 27, 2009

Multiple Fonts in a Label Component

I have never really tried before, but recently I tried and found you can have multiple fonts in a label style. To get multiple fonts in a label open up the Text Component Editor and click on the Format Tab.


Once in the Format tab select the text you want to change fonts. Select then select the font you want the selected text to be.


If you haven’t typed the text, you can change the font and then type and the newly typed text should be the newly selected font. I don’t usually have occasion to use this tool, but it’s good to know it’s available.

Unfortunately you can’t use the same method to have different justification in a text component label.

Wednesday, August 26, 2009

Station Tracker

Did you notice the Station Tracker made it to the ribbon in Civil 3D 2010? I hadn’t, but saw it today on the Analyze Tab.


Station tracker draws a line on the alignment associated with a profile view (or vise versa) letting you see where you are at. This can come in handy in determining where you are in the world.

Monday, August 24, 2009

Microsoft Excel – PivotTables Reports

Microsoft Excel has many features that are often overlooked. One feature that I’ve found useful in the past is PivotTable Reports. PivotTable Reports allow you to quickly sort large amounts of information. In the past I used it to keep track of equipment and personnel at a large aboveground mine in Southern California. For this example I’m going to use a smaller dataset from Excel Help.


The first step to create a pivot table is to go to Data > PivotTable and PivotChart Report… from the menu bar.


This will bring up a wizard that will help collect the data for the PivotTable.


For this example I’m using the data in the current worksheet, but you could get data from an external data sources.

Next highlight the data you want to create a report for.


Now choose to keep the data in the worksheet or in an existing worksheet.


Next drag the items from the PivotTable Field List to the places to show the report that is needed.


As you drag and drop the fields the PivotTable Report shows the data. Once finished the PivotTable should look something like this:


The PivotTable is easily modified by using the drop down arrows. One can remove data using them. For instance if you didn’t want to see golf, you could remove the data from the PivotTable.


Once unchecked, Golf will be removed from the PivotTable


Hopefully you can see the benefits of using PivotTables and will find a way to use them.

Headed to Omaha, Nebraska

I’m headed to Omaha, Nebraska this week. I often wonder how many people are actually using Civil 3D. Looking at the data from Google Analytics it would appear that not too many people are using Civil 3D and reading my blog (or searching the internet) in the Cornhusker State. Looking at the data closer it looks like there is one regular reader of the blog in the entire state, he/she works for a large architectural, engineering and consulting firm based out of Omaha.

I was looking for activities to do after the training seminar I’m going to. I noticed I missed the Omaha Civil 3D Users Group by a week. I’m planning on going to an Omaha Royals game on Wednesday if I can find my way by bus or foot from the hotel to the stadium. Do you have any suggestions on what to do in the evenings in Omaha?


Tuesday, August 18, 2009

Parcel Volume Report – Sorting (Revised)

Sometimes you think you have something correct, but find out later that it doesn’t do what you want. In this case I used a small sample set so I didn’t realize the sorting was alphanumeric and not numeric. So the parcels where sorted not exactly like it should have been.

1, 32, 102, 301, 4, 2 Is sorted as: 1, 102, 2, 301, 32, 4 which obviously not what is wanted.

To correct this to have it sort correctly I used this webpage to add to the code. It took some time to translate the post to, but I was finally able to do it. The code now sorts it as we would expect: 1, 2, 4, 32, 102, 301.


The completed class may be found here:

Monday, August 17, 2009

VBA Layer PlotStyle

When trying set the PlotStyle of a Layer the PlotStyle needs to be used in the drawing. If the plotstyle is not used in the drawing you get a “Key not found” error. Doing a search of the internet didn’t result in an answer. I finally found an answer here:

It appears that while the layer cannot be assigned a plotstyle an object can. So the solution is to create a temporary object then apply the plotstyle. After the plotstyle has been applied the object can be deleted.


Using Resume at the end of the ErrHandler has the code go back to the line that the error happened at, Resume Next would have it go the next line of code after the error.

Friday, August 14, 2009

Parcel Volume Report – Sorting

Matt Anderson gave me something to work on, he stated “Here’s a suggestion – Parcel Volume Report – add a bubble sort to sort the parcel report by number.” I don’t like bubble sorts, too confusing, so I went with another way to tackle the problem. In my solution I make the columns sortable. To do this I heavily leaned on this MSDN article (meaning I copied and modified it).

I think this only will work with Visual Studio 2008 and isn’t applicable for Visual Studio 2005. There is another article in MSDN that covers the older version of Visual Studio. (Meaning this would work only for Civil 3D 2010 and not an earlier version)

The first thing you have to do is copy the source code to the reports to a new location. The source code is located at: C:\ProgramData\Autodesk\C3D 2010\enu\Data\Reports\Net\Source (at least for Windows 7)

Next open the Solution (C3DReports.sln) in Visual Studio 2008. Do a search (Ctrl+F) for “li.SubItems.Add(oParcel.Parent.Name” and it should take you to one of two places in the code. Make sure you are in the ReportForm_ParcelVol.vb. In the code above the “For Each oSite…” add the following:

' Suspend control logic until form is done configuring form.
' Set the initial sorting type for the ListView.
ListView_Parcels.Sorting = SortOrder.None

After the Second Next add the following:

' Connect the ListView.ColumnClick event to the ColumnClick event handler.
AddHandler ListView_Parcels.ColumnClick, AddressOf ColumnClick

Now we need to add the column click event handler and the ListViewItemComparer Class. The ListViewItemComparer Class will sort the column. All of the revised code is highlighted in yellow below:


So now when you click on a column the items in the list will be sorted in numerical order. If I used this report often, I’d probably add the capability to select which sites are added to the list. Maybe a post for another day.

To finish this up compile the code by going to Build on the Menu bar and choosing to Build C3DReports. Copy the file from the obj/bin/build/ folder and then overwrite the original report .dll (after backing up the original file).

I’ve got an Office product on my machine that most of you probably don’t have otherwise I would have posted a revised .dll, but to make it easier here’s the revised class. Just unzip, replace the original class and recompile the code.

This post has been revised:

Also I’m still looking for trades, so make an offer!

Thursday, August 13, 2009

Civil 3D 2010 Swap Parts – Part 1

I’m underemployed this week and was looking for something to post on to fill my time. It took me a bit, but someone in the Discussion Group asked if you could swap multiple parts in 2010. I was pretty sure you couldn’t do it out of the box, but was thinking it may have been added to the API in 2010. To my surprise the ability to swap parts was added to Civil 3D 2010. This addition will allow us to swap multiple parts within one command.

The first step was to make sure it worked. To do this I created a quick VBA routine that made sure it worked.


The first part makes sure Civil 3D is running. Next I prompted to get a pipe. If it is a pipe I then went through and got the Settings for the drawing, which contains the collection of Part Lists. Once I got the parts list I went ahead and got the first on in the list. Next I got went through each Part Family in the Part List to get the Pipe type. Once I got the Part Family I could get a Part Size Filter. In this case I just got the first one. Finally I had all of the information to swap the pipe. In this case I swapped an 18” concrete pipe with a 24” x 24” Concrete Box culvert. Now that I know it works I can create some dialogs that let the user select the swapped pipe size. That will be for a future post though.

Average Difference Between Profiles

Here’s a quick post on how to get information from Civil 3D into Excel to determine the difference between two profiles for an alignment.

  • First run the Incremental Station Elevation Difference Report from the Toolbox.
  • Next copy all from the HTML document and then paste into Excel (you can change the default output location to Excel rather than HTML, do a Google search and you should be able to find how to do this)
  • Paste the information into Excel.
  • Do a search and replace for the ‘ mark to have the text number to be numbers.

Here’s a quick video showing the steps:

Wednesday, August 12, 2009

Slope Arrow – Custom Arrow

Sometimes the arrows head Civil 3D provides doesn’t encompass all of the options we want. If you try to add a custom arrow head to a Surface Slope arrow with an expression added to always have it point downhill you may find that it doesn’t rotate the way it should. This appears to be due to the Direction Arrow not flipping, but just the arrow head (the start stays the start and the end stays the end, but the arrow head goes from the start to the end instead of rotating both the line and the arrow).


We can use an additional expression to fix this. The expression will adjust the X offset for the arrow head. In this example the length of arrow is based on the picked points. If you want a fixed length arrow you’ll have to adjust the expression to match the length of the line. The expression is rather simple, just see if the arrow head needs to be offset and if it does adjust it by the picked points length:


I called the expression ArrowheadOffset. Then we can add the offset to the label style.


Once we close out of the label style composer we can see that the arrowhead is now in the correct location and rotation.


I think I may have skipped some steps but you can download the the completed style from this link: The file is in Civil 3D 2010 format.

Tuesday, August 11, 2009

Trade to AU Update

I received, via FedEx, the traded copy of Introducing AutoCAD Civil 3D 2010. There’s a nice picture of a dam on the cover and also comes with access to the book’s supporting website which contains “all the files you need to complete the tutorials, as well as plenty of inspiring professional examples.”

So if you want to trade for the book let me know by sending me an email

Also early enrollment starts for Autodesk University 2009 tomorrow, August 12, 2009.

Monday, August 10, 2009

Navisworks Manage – Selection Sets

In Navisworks Manage you can create Selection Sets. Selection Sets allow you to create a group of objects. You create Selection Sets by selecting objects in the Selection Tree or the Scene Area. The Scene Area is like Model Space in AutoCAD. You can select multiple objects by using the Ctrl key while selecting multiple objects. I’m not quite sure what the Navisworks programmers have against the Shift key, but doing multiple selections in the Selection Tree using the shift key doesn’t work. Within the Scene Area using the Shift key selects the entire model.

Once you select the objects you want, right click in Selection Sets and choose Add Current Selection. This will add a new selection set to the list allowing you to type in a name. You can right click on a selection set and choose delete to erase it. Sometimes you may want to change the selection set, which is possible. Just select the selection set from the list, select the objects you want to add, then right click on the selection set and choose update. Or you can select the objects and then right click on the selection set and choose Add Current Selection.

Selection sets are used in other portions of the program, such as TimeLiner. TimeLiner allows you to show the model being built based on an imported schedule. Here’s a short video.

Friday, August 07, 2009

Navisworks - Saved Viewpoints

I’ve been exploring how to use Navisworks over the past few weeks off and on. I’ve found that there isn’t much information out there on how to use the Navisworks programs. The product doesn’t come with any tutorials and the classes on Autodesk University seemed more about the final product more than about using the program. This is a post on how to add temporarily saved viewports in Navisworks Freedom 2010, the steps are the same for Navisworks Manage 2010 except that they are saved with the model.

The first thing to do is zoom, pan or orbit to the view you want to save. Then open the Saved Viewports, if it’s not docked on one of the sides you can open if from the Workspaces toolbar.


You can either leave it minimized or use the pin to stick it to the side of the window.


Next right click in the white saved viewport area and choose Save Viewport.


Now you can select an item in the list and it will go to the saved view.

Here’s a video showing it in action:

Unfortunately it doesn’t appear that the Saved Viewpoints are saved when you close the model. So if you want them to stick it looks like you are going to have to have a purchased version. The viewports are saved in Navisworks Manage.

Thursday, August 06, 2009

Pipe Info

In a previous post I created a Custom Pipe oSnap, unfortunately I wasn’t able to figure out a way to show the invert or slope information in the toolbar. After searching the internet for a while trying to find a solution I came across a site that pointed me to an ADN class that covered AutoCAD: TransientGraphics API from May of 08. I downloaded the class information and started modifying the code to work with pipes. The original code took lines, arcs and polylines and divided them up showing points.

Transient graphics allows you to show temporary objects on the screen rather easily. You essentially create objects such as text or points and it draws it on the screen. Using that plus tracking the cursor location you are able to show information on the screen for the user. In this case I wanted to show pipe specific information while I moved the mouse around the screen. Since the code is quite lengthy I’ll let you explore it on your own. I added it to the Civil 3D Reminders Pack and after you netload the dll you can type PipeInfo at the command line and hover over a pipe. Depending on where you are on the pipe will determine if you get an invert or the slope of the pipe. I didn’t spend much time on this to make it look pretty, I don’t have a usability group like Autodesk has, but provides the information. Here’s a quick screencast showing what it does do:

To end the command type EndPipeInfo. The code is in the QuickEditPipes.vb file. The compiled dll and code may be downloaded at the Civil 3D Reminders Pack webpage.

I’m not sure if I’m going to take this any further at this point. If I add quick edit capabilities I’m not sure how to handle what happens to upstream/downstream pipes. Do you have any ideas?


I’m trying to learn Navisworks. My first major roadblock is bringing the data from Civil 3D into Navisworks. In order for it to show properly you have to either install the Civil 3D Object Enablers from the Autodesk Website or if you are on a 64-bit machine use the 32 bit version of Navisworks Manage. I’m not sure which one fixed my problems first so I’d try opening the dwg in the 32 bit version first, it that doesn’t work install the Object Enablers. There also is a NWDOUT command that is available after installing Navisworks Manage from within Civil 3D.

If your interested in learning more about Civil 3D and Navisworks check out this upcoming AutoCAD Civil 3D Webcast: Coordinated Design, Analysis, and Visualization with AutoCAD Civil 3D and Navisworks on August 14.

Also check out the NWNAVIGATOR command in Civil 3D. It uses Navisworks’ engine to show the model in Civil 3D and it appears to work better than Object Viewer.

Wednesday, August 05, 2009

Logical Operators

I was looking in Civil 3D 2010 Help to see it it indicated what “logical approximately equal” meant. I wasn’t able to find what it meant, but did run across this:

“Note Logical operators return 1.0 for true and 0.0 for false. Since they return values, you can perform logical AND and OR with addition and multiplication. For example: ((a<b) + (b>c)) tests for a < b or b > c. ((a<b)*(b>c)) tests for a<b and b>c.”

We can use this to simplify expressions. For instance I did this post with nested IF statements. The expression for South was:

IF({Segment Direction}<(pi+0.00000194),IF({Segment Direction}>(pi-0.00000194),(0.1/12),0.000001),0.000001)

The expression could be simplified to:

({Segment Direction}<(pi+0.00000194))*({Segment Direction}>(pi-0.00000194))*(0.1/12)+0.000001

It is essentially an If statement that we can use to simplify the expression since it returns 0 or 1. Since it returns 0 or 1 we can multiply or add expressions together to determine what the value is. In the above expression I’m using it as AND expression. Both need to be true to get the text to show to get a value of 1. If either is false the text height will be really small. I think nesting IF statements gets confusing when creating them and being able to use logical expressions will simplify creating them.

Also I’m still looking for trades for the Introducing AutoCAD Civil 3D 2010. If you want to trade something for it let me know. It doesn’t have to be Civil 3D related either make me an offer I just may say yes.

Tuesday, August 04, 2009

One Signed Book – First Trade

I was able to trade the signed copy of Mastering Autocad Civil 3D 2008, see previous post, for an unsigned copy of Introducing AutoCAD Civil 3D 2010. The book is hot off the presses and available now, either in a trade with me or from your favorite bookseller. I traded the book with Mark over at Engineered Efficiency. Be sure to check out the new Civil 3D site civil3dpedia presented by Engineered Efficiency. You may even see me post over there from time to time.

For more information about the book use the link below and if you want to trade for it let me know by Emailing me.

Monday, August 03, 2009

Custom Pipe oSnap

I’m trying to create a Quick Pipe Editor to use with Civil 3D 2010. My final goal is to have a tool similar to the feature line quick edit that is within the program already that works on pipes. The first step is to create a tool that shows a glyph at the end of the pipe. I’m trying to do this with a custom pipe oSnap. With help for the Through the Interface blog I was able to modify the code he posted about to create the code. First I translated the code from c# to and then modified it to work with Pipes.

The code that I used my be found in here:

Here’s a short video with the code in action: The little P s are the resulting code. The next step is to add relevant information to the crosshair tooltip instead of Pipe End.

Note: I’m still looking for someone who wants to trade something for a signed copy of Mastering AutoCAD Civil 3D 2008. It can be anything, just make an offer. Thanks.

Saturday, August 01, 2009

One Signed Book

Autodesk University is coming up in early December and I think it would be nice to go. In order to get there I thought I’d have some fun by trying to make a series of trades, starting with a signed copy of Mastering AutoCAD Civil 3D 2008 and finishing with a 3-Day, All-Inclusive Pass to AU, to make it there. Kind of like the person who traded a red paper clip for house.

Mastering AutoCAD Civil 3D 2008 is a great reference for using Civil 3D and is well written, click on the picture for more information. The book is sitting on my shelf at work, and I occasionally pick it up to look up some information.

So why should you participate in these trades? Well if I do get to go I’ll probably take some programming classes to expand my knowledge which may show up in future posts to this blog.

If you have something to trade, just Email me.

***Check out what I traded this for here.


Blog Widget by LinkWithin