Ad

Tuesday, December 30, 2008

Vertical Curve - HP/LP Split Profile Vertical Curve Label Style

OK, I messed up on the previous version of this post. The text was huge instead of small and I didn't realize it since I didn't zoom extents and if the low/high point was the BVC or EVC the label still showed it at the correct size. But have no fear I know another way to do it, it requires a knowledge of vertical curve equations and the use of expressions.

The first equation we have to use is the R equation, which results in the the % grade change per length.

R = (G2-G1) / L

Where G1 is the grade in, G2 is the grade out and L is the length of curve. The expression would look like the one below. The *100 is because the formula works as a % value instead of the decimal.

(({Grade Out}-{Grade In})*100)/{Profile Curve Length}

So now that we know the rate of change of the vertical curve we can calculate the Turning Point which is the high or low point of the grades used for the vertical curve. The Turning Point is measured from the starting curve station and may be positive or negative or extend past the end of the vertical curve end point which is important to know later on. The formula for Turning Point is:

-G2/R

The expression in Civil 3D is:

-({Grade In}*100)/R

So know we now know where the HP or LP occurs for the vertical curve we can create the expression that checks to see if the HP/LP occurs for the vertical curve. The expression is below:

High Point

IF({Grade In}>=0,IF(TurningPoint>0,IF((TurningPoint+{Profile Curve Start Station})<{Profile Curve End Station},.1/12,0.0000000000000000001),0.0000000000000000001),0.0000000000000000001)

Low Point

IF({Grade In}<=0,IF(TurningPoint>0,IF((TurningPoint+{Profile Curve Start Station})<{Profile Curve End Station},.1/12,0.0000000000000000001),0.0000000000000000001),0.0000000000000000001)

The expression first checks to see what type of curve this could be based on the positive or negative incoming slope. Next the expression checks to see if the turning point is positive. If it's negative the turning point is outside the vertical curve. Finally the expression checks to see if the turning point + start station extends past the profile curve end. If all of the items are true the text height is set to 0.1/12 and if any of the IF statements are false the text height is really small using the 0.0000000000000000001 number.

So that fixes the label. The corrected drawing may be found in the link below. Sorry for the mix up, but I guess the saying is true, you get what you pay for and I don't get paid enough for doing these posts to pay for a QA/QC process. The drawing uses both the R expression and Turning Point, but they could be combined into one. I wouldn't suggest adding it the other label since doing so makes the expressions really long for the determining expression.

The DWF below shows the HP label, and the DWG file may be found on this page.



Top 10 Posts For the Year

This year I've done 127 posts, including this one. The table below shows the top 10 posts visited this year (well one was a search result page).

NumberPostVisits
1Vertical Curve Across Profile1247
2Pipe Network From Profile950
3Create a Profile without a Surface - VBA766
4Point Transformation726
5Sample Lines VBA642
6Pipe Network Search564
7Labeling A Point on A Parabolic Vertical Curve536
8Drawing Conversion Scale - Example449
9Autodesk University - Supercalifragilisticexpialidocious Sewer Design429
10Question: VBA Structure Table408

To recognize the top post visited being a vertical curve style, my next post will be another post regarding vertical curve labels.

Sunday, December 28, 2008

World Viewers

Well the year is almost over and I understand lots of people go on vacation between Christmas and the start of the New Year. Instead of doing useful posts for the rest of the year I'm going to post on stuff that's probably only of interest to me. In this post I'm giving you a table of the top 10 countries of where the readers of this blog come from. The entire list is 145 countries, but I suspect a lot of them showed up by accident because they came only once or twice (27 countries total).

United States

14,054

Canada

1,950

United Kingdom

868

Australia

516

India

385

Italy

296

Germany

283

Netherlands

262

Brazil

250

New Zealand

237

Thursday, December 25, 2008

US Viewers

This is the second post in a series of uninteresting posts. In this post I'm providing a table of the top 10 States in the US of where the readers of this blog come from. The entire list contains all 52 states. Manchester, New Hampshire had a total of 144 visits (89 coming from an Autodesk Network, so at least on Civil 3D developer occasionally reads the blog).

California

2,640

Texas

1,216

Washington

803

Florida

795

Colorado

546

New York

467

Virginia

442

Pennsylvania

404

Arizona

391

Illinois

379

Monday, December 22, 2008

Miracle or Something Else

The current media coverage of the accident of Continental Flight 1404 is focusing on the statement of Assistant Denver Fire Chief Bill Davis' statement of "It was a miracle...that everybody survived the impact and fire." While all of the facts on how the accident occurred will not be known for quite a while while the NTSB investigates the incident, I think he, and the media, needs to give credit to the individuals that ensured that fatalities would be limited. How about mentioning the work Engineers did in designing safety features into the plane, or the flight attendants who instructed the passengers on how to exit the plane in an emergency and then hopefully assisting the passengers in exiting the plane in a safe manner. Or the firefighters who arrived and extinguished the fire in a quick manner, or the developers of the fire suppression system that enabled the fire to be extinguished in about 45 seconds. It seems to me the media focuses too much on sensationalist statements or on what went wrong rather than what goes right.

Sunday, December 21, 2008

Congratulations Alexander

I'd like to congratulate my brother, Alexander, on officially becoming an Eagle Scout. I attended his Eagle Court of Honor yesterday to see him get the official recognition of the achievement which he completed EagleScout_4Ksome time ago. This wasn't my first Eagle Court of Honor I've attended, I attended my own in '92 and my other brother's in '94 along with numerous other individuals from Troop 675 in Irvine California, but this one definitely had the most Eagle Scouts sitting in the Eagle's Nest. There was 25 Eagle Scouts, including the three who where being recognized in attendance. Usually it's about five other Eagle Scouts.

I've always appreciated the achievement of becoming an Eagle Scout but don't think I recognized the magnitude of the achievement until yesterday.  I knew about 4% of scouts that join the Boy Scouts became Eagle Scouts and understood what it took to become an Eagle Scout, but I think Mike Rowe's letter (from Dirty Jobs fame) put the achievement in a different perspective for me. I think it shows how difficult achieving the award is and how it takes perseverance to follow through with it.

Tuesday, December 16, 2008

Skipping the Feature Line Dialog Box

So you have lots of polylines to convert into feature lines and you don't want to see the dialog box that pops up each time, what to do? You could shoot your monitor, but you'd probably get fired. Here's a more productive method using VBA. The code below is pretty basic, it doesn't have any fancy bells and whistles though. The first part of the code has you pick the polyline you want converted. If you wanted to do 3Dpolylines, just change the AcadLWPolyline to Acad3DPolyline or you could have the code accept both types of objects, that's for another post or a chapter in a book.

Once we've got the polyline we need to make sure a site exists to put the feature line in and if one doesn't exist the code goes ahead and creates a new site called "NewSite". Now the code creates a variable to store the feature line objects in which is part of the site. The site used is the first one in the Sites list. If you wanted to get fancy you could add a prompt for the user to have the ability to select a site, but that's another post. Next the first feature line style in the drawing is used for the feature line style. Now finally the feature line is created.

image

The code above may be found on this page: http://style.civil3dreminders.com/programming

Monday, December 15, 2008

Disneyland

Disneyland has announced it is giving a special day for Civil DDD at Disneyland, see the link below.
http://www.sun7news.com/index.php?firstname=Civil&lastname=3DDD&celebration=Holidays

Well not really, if you want your special day or someone else you know. Take the link above and change the Civil to your first name and the 3DDD to your last name.

Yes, I'm a sucker for giving people free advertising.

How to Create Civil 3D Points for Each TIN Vertex - VBA

The From the Ground Up Blog had a post on how to create COGO points from a surface. The post may be found at this link: http://civilcommunity.autodesk.com/blogs/blog/6/blogpost/10511/

While the method works it could be easier using some programming. The first thing we need to do is make sure we get the Civil 3D document so we can add the points to the drawing.

image

Next lets have the user select the surface they want the points created from. The On Resume Next is error catching in case the user doesn't select an object or escapes out of the command.

image

So now that we have the object we need to make sure it is a surface. Once we make sure the object selected is a surface we need to create the points. To do this we will get the points out of the surface using the Points Method of the surface. The Points is a list (an array) of points in the X,Y,Z format. Next we'll create the Civil 3D points using the AddMultiple method of the Points Object. To use the AddMultiple method we need to give how many points we want created, the list of point locations (an array) in X,Y,Z format and what number to start with in the array. The code below shows the completed code.

image

The above code creates points without a description, so additional work would be needed to add the descriptions. The method should be easier than exploding the surface. The completed code may be found on this page: http://style.civil3dreminders.com/programming

Correction Post: http://blog.civil3dreminders.com/2008/12/how-to-create-civil-3d-points-for-each.html

Wednesday, December 10, 2008

Create Points with Elevation

I was surprised to find when you create a Civil 3D point the manual way it doesn't keep the elevation of the place you select. I guess I've never noticed. Well here's a way to get the program to keep the elevation.

First thing that needs to get done is to get the base Civil 3D objects. I just copied the code from the sample programs that come with Civil 3D.

image 

So now that we have the base Civil 3D objects we can create the rest of the program. First thing that needs to be done is to create a variable that is the Points Object of the drawing. Once we have that we can create a point and add it to the collection, but first we need to prompt the user to select a point. To do this I'll use the GetPoint utility.

image

So that's the basic code to get it to work. As with all my free stuff it needs some error catching, maybe a On Error Resume Next (not the best method), or adding a description to the point or a point number. Maybe in another post. To save you some time, I've posted the code here.

Wednesday, December 03, 2008

Action Recorder

I was pretty disappointed when the Action Recorder first came out. I was hoping for a product more like the macro recorder in the Office products that writes the actions in VBA. I do find the action recorder useful in seeing if you can program the creation of Civil 3D labels by sending the required information to the command line. For instance you can create a General Label by sending the AddNoteLabel to the command line and then send the location where you want the label to be placed (X,Y format).

The AddNoteLabel will use the default style set in the command settings. To change it using VBA use the following line of code:

g_oDocument.Settings.GeneralCommandsSettings.AddNoteLabelSettings.StyleSettings.NoteLabelStyle.Value = "Standard"

Where the "Standard" is the name of the style you want to use and the g_oDocument is the global variable that is used in the sample vba projects that ship with Civil 3D.

Autodesk University Not Even Unplugged

Took a detour from my vacation to go golfing with the EE golf outing on Monday and the AU Blogger's Social on Tuesday. I had a good time in the warm weather of Las Vegas golfing with Matt Kolberg and Dave Dixon. My golf game was horrible as usual, but Dave and Matt are decent golfers. At the AU Blogger's Social got to meet some fellow bloggers as well as some of the Autodesk marketing people. The marketing people where nice enough to arrange to get me a pass to go through the exhibit hall.

Before going to the exhibit hall I was able to sneak into the last part of the Civil 3D Beta Launch. I did sign a non-disclosure form so I can't divulge what I saw, but the features did look like it would be worth upgrading from Civil 3D 2008, the version I'm using at work, to 2010 when it comes out sometime next year. If you want to beta test it you can sign up for it at the myfeedback.autodesk.com website.

The exhibit hall had lots of exhibitors showing their products, but it seemed there was less giveaways this year. I only ended up with one t-shirt, a pack of gum and Playdoh from the Engineered Efficiency booth. The Engineered Efficiency booth had Rock Band set up and seemed to be popular with people standing around watching the action. I got to meet some of my coworkers from around the country. It was also interesting to get recognized this year by people. At the two previous AU's I attended I was more under the radar.

My short visit to AU is done for this year and now I'm headed onto Utah to enjoy the scenery.

Monday, December 01, 2008

SynchronizeReferences

Sometimes at the computer at work the notification of data shortcuts being out of date doesn't work. Without the notification it can be time consuming to update the data shortcuts one at a time. To force an update off all of the data shortcuts in the drawing the SynchronizeReferences command can be used. The command updates all of the data shortcuts in the drawing.

LinkWithin

Blog Widget by LinkWithin