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.

LinkWithin

Blog Widget by LinkWithin

Ad