## Tuesday, January 31, 2012

### Rounding

You might not have noticed, or no one told you, but computers suck at math. Well more specifically they suck at rounding. I’ve been told JavaScript especially sucks at math, and one should avoid using it for Math. I guess that’s why Autodesk choose to use JavaScript to do the reporting within Civil 3D for the XSL type reports.

One such report is the Inverse_Report. You may notice that some of your bearings are slightly off. This is because of floating precision that computers use and the method Autodesk has chosen to round numbers. To fix this error we can use a common method to round the value to the correct number. To do this travel to the folder that holds the XSL reporting files:

C:\ProgramData\Autodesk\C3D 2012\enu\Data\Reports\xsl

Next open the General_Formating_JScript.xsl, if you are on my computer it will be on the top if you sort by Date modified (your results may vary). Once you open the file look for:

var anglePrec = 3;

If you want your bearings to be rounded to the nearest second change the value from 3 to 0. For any other rounding values, change it to the desired precision. Unsure why this wasn’t included in the Parcel settings within Civil 3D. This is just a diversion from the task at hand, otherwise known as padding.

Next scroll down until you reach this code snippet:

`function formatAngleNumber(number){    var strFormatted;    strFormatted = number.toFixed(anglePrec);    return strFormatted;}`

Change the above code to the following:

`function formatAngleNumber(number){    var strFormatted;    // strFormatted = number.toFixed(anglePrec);  strFormatted = Math.round(number * Math.pow(10, anglePrec)) / Math.pow(10, anglePrec);    return strFormatted;}`

The // comments out the original line of code. The next line makes the number large and then divides the resulting math by a large number to make it small again. By doing this we can hopefully eliminate the rounding issue.

## Tuesday, January 24, 2012

### Importing Excel Data

With all of the new features that come out, sometimes it’s hard to catch what you may have missed in the past. In this video I’ll cover how copy and paste data from Excel into AutoCAD to get a table that prints nicely. Other methods such as printing to PDF or using an OLE image can come out blurry and not print well on the plans. this method alleviates this problem and provides a way to show the data using an AutoCAD table.

That works great for single use, but what if you want a link between Excel and AutoCAD. Well That’s where Data Links come in handy. The video below goes through the steps.

Now that I can possibly make some revenue through videos on YouTube, you might see some more content presented in this fashion.

## Monday, January 23, 2012

### Cosmic Shelf

This weekend I attended StartUp Weekend SLO, held at Cal Poly, SLO. It was a great event where you pitch business ideas and then create teams for the most popular ideas. The teams then create a business based on those ideas. Some ideas pivot, or change into other ideas, some die and some stay until the end.

The team I joined was Cosmic Bookshelf. The concept is a way to interact with your virtual books in a bookshelf. I joined because it seemed the most not a web only application. My expertise was having read some blog post on the Kinect by Kean Walmsley at Through the Interface on using the Kinect as a input tool. The interaction with the bookshelf was to be with the Kinect.

It was a great experience and I learned a whole bunch. I learned how to work with the Kinect as well as putting some JavaScript into action. I haven’t done any JavaScript work before, and I was surprised how easy it was to pick up. Reading the first part of a book and my previous experience helped out. At the end of the weekend the startup was presented to the other attendees and judges. The presentation is below.

After all of the presentations, the judges tallied up their scores. The startup I worked on won honorable mention for innovative use of technology, well we tied with another startup called MisHeard.me. It was a great event and I’d definitely do it again.

## Monday, January 16, 2012

I’m presenting this Wednesday (January 18) at the  North Bay Civil Users Group (Northern California) on Subassembly Composer. If you are in the area stop by and say hi.

Here are some links for information regarding Subassembly Composer.

SAC Wiki Help

Autodesk University Classes:

Create Subassemblies That Think Outside the Box with Subassembly Composer for AutoCAD® Civil 3D®

You Tube Video by Dana Probert

Autodesk Subassembly Composer Support Pack for AutoCAD Civil 3D 2011 & 2012

## Tuesday, January 03, 2012

### Vicinity Maps

Using Map makes it easy to create vicinity maps. Not quite sure how everyone else is doing it, but this is the way that I’m doing it now on when there is GIS data available.

The first step is to download the street data from where the County where the project is located. For the County of Los Angeles it is available as a Shape File. Next change the workspace to Map’s. It’s got a code name of Planning and Analysis, so it makes it obvious that it contains the Map commands.

I import the shape file into a drawing, but one could also use FDO. I then save the file with a catchy name like LAConfidential.dwg. That way I can follow Autodesk’s lead of giving it a code name so it’s contents are obvious.

When I need to create a vicinity map I attach the LAConfidential drawing using the Map Task Pane and the Map Explorer tab. To open the Task Pane type MAPWSPACE at the command line.  I then assign the correct Coordinate System to the drawing. If the survey is using State Plane Coordinates, them I’m set with knowing where the project is located at in the real world. If not, I have to find the coordinates of the site. To do this I use Google Earth or Maps to find the lat. and long. of the site and then use the Coordinate Track to find the location in the drawing.

Next I create a rectangle delineating the area I want the vicinity map for. Now I create a query to get the streets from the drawing file.

Here are the roads imported into the drawing. I imported all of the streets, but you can limit the import to major streets if the GIS data contains those classifications.

Now I’m able to label the streets using Annotation.

Then I detach the drawing from Map Explorer. I now have a vicinity map and I don’t have to trace anything or approximate anything or type any of the street names. I do have to adjust the labels or delete any of the local roads I don’t want in the drawing. I could also import the various streets based on their classifications and put them on their own layers.