Ad

Wednesday, July 22, 2009

PCEM – Fixing the Parking Lot

PCEM is a program developed by US Cost and used by the NAVFAC to develop costing for projects. I recently was tasked to develop a cost estimate using the program. I’ve used the program without any problems (on a former computer) in the past. Unfortunately I kept getting errors when I tried to add a parking lot to the model on the computer I’m using now. There appeared to be something wrong with the database that it used. After sending an email to US Cost, downloading, uninstalling and reinstalling the program I finally went into the database to see if I could find the error.

I was able to track the error to the cboPipe1SizeList.S19 Variable Assignment. This essentially fills out a list box in the program and it wasn’t providing the correct value for some reason.

image

The program copies the data needed, for the parking lot, from a file called Sitework 99Eng.PWS which is located at:

C:\Program Files\Success Estimator\Sitework

OR

C:\Documents and Settings\All Users\Documents\Success Estimator\Settings\Sitework

Opening the file in Success Estimator I was able to do a search and find the Variable assignment. By using the Formulas view I was able to take a look at the expression.

image

Once in the view I could see the problem. One of the quote marks was mistakenly added as an apostrophe. Making the change fixed the error message.

image 

So if you have the pleasure of using PCEM and are having problems, this is one way to fix the issue.

Monday, July 20, 2009

Run a Command not Using the Default Style – Station Offset

Sometimes you want to use an alignment station offset label which isn’t the default label style in the drawing. Yes, you could use the label dialog box, but if you are using the same station offset label over and over it can create extra steps. This post will use VBA and the cui to create a toolbar icon to use a different label to do a station offset label other than the default value.

The first step is to create a VBA macro that will change the default value to the label style we want. As a starting point I’m using the StartingPointProject.

image

The code sets the default label style as “Different Style” instead of the original one. Of course you would need to change the name to match the one you want to use. The first part of code makes sure Civil 3D is running.

Next a macro needs to be created to set the default style back to what it was originally.

image

The above code sets the style back to “Standard”. Of course you would want to change “Standard” to match your template.

We have to use two macros since we can’t pause a VBA macro, at least that I know of. So instead of doing it in one macro I’m going to use the cui to add the pause needed to place the label. To add the command to the cui type cui at the command prompt and then press the new command button.

image

Next give the command the name and add the macros to the command along with some pauses “\”.

image

The command is below:

^C^C-vbarun;"C:/Users/Christopher/Documents/Autodesk/AlignStaOffLabel.dvb!Module1.AlignOffLblChange";AddAlignOffLbl \\\;-vbarun;"C:/Users/Christopher/Documents/Autodesk/AlignStaOffLabel.dvb!Module1.AlignOffLblDefault";

Make note that the macro file location has the “\” reversed. Now when you run it should pause enough to place on label. Unfortunately you can’t place more than one label. You can add the command to a toolbar or the ribbon.

Here’s a quick video of it in action from a toolbar:

http://screencast.com/t/FuAxzJugo 

You can do the same for the other label commands. Just make sure to have enough \ to match the needed prompts to add the label and change the code to change the default label style.

Friday, July 17, 2009

Wednesday, July 15, 2009

In-N-Out

Found out today you can get packets of special sauce and yellow peppers at In-N-Out, cool. I usually get the cheeseburger animal style with an iced tea to drink. My kids like the free kids stickers, got a baseball pack and a butterfly pack today. In-N-Out is a small chain in CA, NV, UT and AZ with quite a cult following.

Monday, July 13, 2009

AutoCAD .NET Labs Error

I’m not quite sure what’s causing the problem, but if you download the code for the AutoCAD .NET Labs you may get some errors.

image

Error    1    Reference required to assembly 'WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the type 'System.Windows.DependencyObject'. Add one to your project.

Error    2    Reference required to assembly 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the implemented interface 'System.Windows.Interop.IWin32Window'. Add one to your project.   

Error    3    Reference required to assembly 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the implemented interface 'System.Windows.Interop.IWin32Window'. Add one to your project.   

The problem is that some references are missing or can’t be used because the wrong Microsoft Framework is referenced, at least for my OS and setup. To fix it go to the Project Properties, Compile Tab and choose the Advanced Compile Options.. button.

image

Then change the Target Framework to .NET Framework 3.0 or 3.5. The error messages will then be removed.

The Lab 7 covers how to recognize HandleEvents in Autocad so you can observe what’s happening in Autocad and then do something when something changes. If you want a better explanation download the Lab from the link above and it should have a document that covers what the Lab shows.

Thursday, July 09, 2009

Taxes, Taxes, Taxes

Lisa Jackson, EPA head, recently asked to a Senate committee "Can anyone honestly say that the head of an American household would not spend a dollar a day to safeguard the well being of his or her children?"

I for one can say I don’t want to spend a dollar a day, since I don’t believe it will safeguard the well being of my children. Mrs. Jackson was arguing that carbon-cutting legislation would, well the article didn’t state how my children would be protected, somehow make my children safer.

The $1/day she is quoting could spell disaster for my children. Personally the $1/day would cost my family $5,475 (not accounting for any interest earned) from now until my oldest child enters college. This money could be used to help pay for her education, paying down the debt (national or personal), donations to non profits or other beneficiaries that would actually help safeguard her future. Collectively the nation will spend $41,452,320,000 per year (that’s $41.5 Billion, based on 113,568,000 households in America) which is just under the $45 billion budget for the Department of Education. Maybe that’s chump change to Mrs. Jackson, but I consider that cost a major drain on the nation’s finances.

This cost would be in addition to all of the other taxes I pay for. Using the Tax Freedom Day from the Tax Foundation, I calculate I pay around $63/day in taxes. I think I pay more per day since I live in a high tax State and it probably excludes the payroll tax paid for on my behalf. If feel this is already too much.

If anything during this severe downturn in the economy the Government should be finding ways to reduce costs on families not increase them.

Well this turned out to be more of a rant than a well thought of argument, but I thought I should stand up and say I won’t fall for empty threats against my children’s future. Especially when the Government can’t seem to get it’s financial house in order which would do more to safeguard my children’s future than any carbon-cutting legislation ever could.

Transferring Contour Labels

Jeff Mishler has a good way to transfer contour labels from one surface to a newer surface as described in this Discussion Group Post. This concept may also be used to transfer contour labels from drawing to drawing. Just label the surface in one drawing, explode the labels, copy and paste them into a new drawing. After that just add contour labels by selecting the lines pasted in.

This post is more of a reminder to myself than anything else.

Monday, July 06, 2009

Major Station Label - Eliminate End Station

Expressions let you customize the way labels are shown. One instance where this may be useful is if you don’t want the end station shown on an alignment.

image 

The manual way is to use select the individual label using the CTRL key and deleting it. Using expressions will always hide the end major station label. To create the expression go into Toolspace, Settings Tab and then right click and choose new under the Major Station grouping. The expression checks to see if the major station is the end station, if it is it makes the value really small, if its not the end station then it sets the text height as 0.06”.

image

Now go into the Major Station Label you want to use, in this case I’m using the ShrinkEndStation label style.

image

So now the end label is really small and won’t show.

image

There is one problem with this expression in that if the end station is at an even interval we probably want it to show. For this case we need to check to make sure the end station doesn’t end an even major station and if it does show the label. The final expression is below.

image

You can download the Civil 3D 2010 file which contains the file from this page: http://style.civil3dreminders.com/alignments

Wednesday, July 01, 2009

Create Points with Elevation and Description

In a previous post I covered how to create a point with elevation. In this post I’ll create a macro that will prompt the user for a description and then assign it to the point. I called the macro CreatePointsWithElevDesc. The code highlighted below is the code changes.

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). To save you some time, I've posted the code here.

LinkWithin

Blog Widget by LinkWithin

Ad