Friday, October 30, 2009

Scale Points, Retain Elevation

Matt did a post over at Civil3D.com did a post on scaling your points and keeping the elevations. The method takes a bit of work of exporting and importing the points. It didn’t sound like much fun to do so I decided to add a more automated way of doing the task and add it to the Civil 3D Reminders Pack.

I recycled most of the code, so I’m not going to include the code in this post. The main steps in coding for this is to get the original elevation of the point. Next the point is scaled utilizing the ScaleEntity Method utilizing the base point provided by the user and the scale factor. Next the code assigns the original elevation of the point, replacing the scaled value. The last step is to Update the point. If the points aren’t updated then they won’t be selectable by the user until the file is closed and opened up again.

If you want to see the rest of the code you can download the Civil 3D Reminders Pack source code from the Civil 3D Reminders Pack Webpage.

The Civil 3D Reminders Pack only works in Civil3D 2010. If you want something that will work in an earlier version try this code in VBA:

`Option Explicit Sub TrianglesOnOff()        Dim oAcadObj As AcadObject    Dim vPnt As Variant        ' Have the user select a surface.    ThisDrawing.Utility.GetEntity oAcadObj, vPnt, "Select Point: "     If (TypeOf oAcadObj Is AeccPoint) Then        Dim oPoint As AeccPoint                Set oPoint = oAcadObj                ' Define the scale        Dim basePoint(0 To 2) As Double        Dim scalefactor As Double        basePoint(0) = 0: basePoint(1) = 0: basePoint(2) = 0        scalefactor = 1.5        Dim dElev As Double        dElev = oPoint.Elevation        oPoint.ScaleEntity basePoint, scalefactor        oPoint.Elevation = dElev            End If End Sub`

You’ll have to add a prompt for the scale factor or change the factor each time you run the program.

Wednesday, October 28, 2009

SpacePilot Pro - 3Dconnexion

I recently got a SpacePilotPro to try out. I found the functionality of the device is better than the SpaceExplorer.

The LCD screen provides extra functionality. It’s like a mini third screen to keep track of email, calendar, tasks and RSS feeds. When scrolling through items you are able to open the item to the big monitors. The item at the top of the list is a listing of the function keys. You can assign different commands assigned to the various buttons on the mouse. The function keys are different for each program and are customizable.

Once you get used to the functions assigned to the keys it makes it easy to not have your left hand on the keyboard, there’s even an ESC key on the mouse. I’ve assigned most of the commands I use with my left hand to the mouse, such as copy, paste, paste special and regen. Along with the standard ESC, CTRL, ALT & SHIFT there is 10 function keys which may be assigned values.

Since I use the mouse mostly to move through the model the buttons on the other side of the mouse come in handy.

The buttons make it easy to change the view, such as left, right, front, etc…  Additionally there is a FIT button which Zooms to Extents in AutoCAD or adjusts the view in Google Earth to be looking straight down and the north being towards the top of the screen. There is an additional three buttons that let you restrict the movement of the mouse.

The mouse is so easy to use even my four year old daughter enjoyed using it in Google Earth.

The SpacePilot Pro recently had a price drop to \$399 (down from \$499).

Disclosure: I received the SpacePilot Pro from 3Dconnexion to try out without cost.

Friday, October 23, 2009

Alignment Length Report

Here’s a quick way to create a table of alignment lengths in a drawing. I’m starting with the code found here: http://style.civil3dreminders.com/pipenetworkquantities

The first thing to do is to change the object we are looking for to Alignments.

Then change all instances of oPipe to oAlignment using find and replace and change the variable type to an AeccAlignment.

Next delete some code we don’t need and change the titles of the cells to something we do.

Next populate the data we need.

No delete a bunch of things we don’t need.

No run the program, and select the Pipe sheet at the bottom of Excel and realize that the columns are reversed. Go back and modify the code to put the data in the correct columns.

And then go back and delete the code that creates the sheets we don’t need.

Now run it and the alignment information should be populated into Excel.

Thursday, October 22, 2009

Moving Surface Labels From One To Another

Sometimes you may want to move labels from one surface to another surface. Maybe you promoted a surface and now have a new datashortcut surface to label. You can delete the information that makes up the old surface and then paste the new surface into the old. The labels in the old surface now will reflect the new surface data.

Here’s a simple Screencast of the steps: http://screencast.com/t/hwUjY3PrZdB

Wednesday, October 21, 2009

Version of Civil 3D 2010

Before Civil 3D 2010 SP2 was released it was difficult to find out what version of Civil 3D 2010 you had. You needed to know the secret handshake password to get it (AECCVERSION), and then know how to decode the file version. After installing SP2 the version shows up in the ABOUT screen, no need to remember the secret handshake.

Brian Kling also posted about it at Being Civil as an addendum to the original post telling us all the secret handshake and decoder ring.

By the way the reason I had to check my version is because the Subscription Advantage Pack is available for Civil 3D 2010 (and a bunch of other Autodesk software).

Tuesday, October 20, 2009

Subscription Advantage Pack – Zone of Visual Influence

Another item in the Subscription Advantage Pack is a tool to get the Zone of Visual Influence. The Zone of Influence takes a point, a height at the point and a radius of vision extent to see if the object may be seen in the zone of visual influence (or something like that).

In the above picture the colors indicate if the object can be seen entirely, partially or not at all. This tool would be useful in doing sitting studies for cell phone towers, windmills or other tall objects that some people find objectionable.

Subscription Advantage Pack – Divide Crop Surface

Looks like this week product promotion week. Today I’m promoting the Subscription Advantage Pack. I’m sure you saw my notes from the presentation. I didn’t want to forget where I put the notes, so I decided to put them on the blog as a reminder.

One of the cool new features is the Divide or Crop surface tool. The tool takes a surface and lets you crop or divide the surface into manageable sections. This way you can take a large surface and break it up into smaller pieces and share it into other drawings. Any changes to the original surface will show up into the divided surface. The divided surfaces may be modified and added to in the new drawings, but the changes don’t reflect back into the original surface. I could see this feature helpful in trying out alternatives for a design or having using for phased projects.

With the phasing you could have phase I of the project and then crop out the area where phase II would abut the first phase. You then could build the phase II project on the cropped surface. The benefit of this over creating a datashortcut is that the data from the portion of phase I that you don’t need in Phase II wouldn’t be part of the surface. Currently, with a datatshortcut, you’d have a bunch of surface data that you don’t really need, which causes the Phase II surface to be bigger than it needs to be. Hopefully this would create quicker rebuild times for the Phase II surfaces. Any changes to the Phase I surface would show up into the Phase II surface.

All of this is conjecture on my part since I haven’t test driven the functionality, but this is one way I expect to use the tool.

Other than hoping to get invited to future events (maybe an invite to the Civil 3D industry-specific session at Autodesk University 2010, since I won’t be an official attendee), I’m not getting compensated for this post by Autodesk. I don’t want the FTC coming down on me for not disclosing information.

Monday, October 19, 2009

Civil 3D Blogger Day – My Notes

My notes so far:

What’s covered: Subscription Advantage Pack, End of the week goal to get content out.

Point Cloud Support

“Bring site visit home with you”

French market already has this tool.

Wizard included to layout the roundabout. Has a graphical representation of the different settings in the wizard. Both internal alignments and the flares entering the roundabout. No vertical design. Drag entering flares to see if the roundabout fits to see if additional right of way is required.

Visualization and Analysis Tools

Site visibility tool. To see if a driver can see an obstruction, a green disk.

Drive, select alignment, or feature line, it follows the profile of an alignment. Goes through the design, kind of like the cross section viewer for corridors, except you get the full 3D view of the surroundings.

Green arrow can see, red you can’t see. Line from road to a surface. The dragging uses a surface elevation.

Sight Distance Along Corridor. Works on both on Design Surface and Existing Surface. Magenta shows issue, green shows the design is OK.

Zone of Vertical Influence. Wind towers and cell phone towers. Green see all of it, Red can’t see it, Yellow can see part of it.

Transportation Productivity Tools

Alignment Tools

Create Best Fit Alignment: point groups or alignments. Can have two alignments, such as left and right sides. True curve and tangent.

Create Alignment from Existing: Road rehabilitation work applications. Split an alignment up.

Survey Production Tools

Zoom to Point capability

Edit figure database while in the drawing, move points around in the autolinework creation. Join, break survey figures, reverse all or part of a survey figure, create a survey figure in the drawing. Curve break, to create a compound curves, no need for a small tangent.

Miscellaneous Feature Improvements

Divide/crop surface (create subset to share into other drawings). Making smaller surfaces. Select cropped surface. The master surface changes reflect in cropped surfaces. Cropped edits don’t get pushed back to master surface.

Create surface from GIS data, takes the SHP file and assigns the elevations. Define area of interest by polyline. View with FDO for a preview and then bring in area of interest. Assign the correct elevation field from the GIS file. No data link from the SHP file to the surface. We’re the ones changing the GIS data.

Minimum vertical distance between surfaces, to find the distance between the roadway and the bridge. The zero elevation gives a drawing object for a daylight line.

Other items.

Language versions.

To be installed on Civil 3D 2010 (SP2)

Probably to become integrated into Civil 3D from the Toolbox and maybe other tools available .

Can call commands from the Toolbox, so each one has a command. Can create a ribbon, but has a short life.

Sunday, October 18, 2009

The Mythbusters on the Discovery Channel did an episode in 2008 regarding an airplane on a treadmill/conveyor belt. The myth as stated on the official discussion board of the show was:

"A plane is standing on a runway that can move (some sort of band conveyor). The plane moves in one direction, while the conveyor moves in the opposite direction. This conveyor has a control system that tracks the plane speed and tunes the speed of the conveyor to be exactly the same (but in the opposite direction). Can the plane take off?"

I enjoy watching the show, but sometimes I wish they’d add an engineer Mythbuster to draw some free body diagrams or inform them that there is better testing equipment available then making their own contraptions for testing strengths of materials. This episode sure could have used an engineer or physics professional.

I was thinking about the episode on my way down to Southern California this weekend and figured they didn’t test the myth, but they created their own myth.  In the episode they took a long length of fabric, put an ultra light airplane on it. A truck was attached to the fabric and pulled it at the takeoff speed of the plane.

You’ll notice their goal was to have the fabric match the takeoff speed of the airplane, which they did. To satisfy the myth the fabric would have to match the speed of the plane, which it didn’t. When the Mythbusters tested the myth the plane accelerated to match the speed of the fabric and then kept accelerating until it reached the takeoff speed.

In exploring the myth they took a RC car and put it on at treadmill to show matching the speed of the car and treadmill would have the car be stationary on the treadmill.

If you take a look at the forces involved we’ll notice that the force from the engine is transferred to the tires. The main concept to look at is the what friction provides in the relationship. Friction is what allows the tire to rotate on the treadmill and match the rotation of the treadmill. If the tire and treadmill didn’t have any friction the tire would spin and not go anywhere, regardless of the force the engine of the car applied.

In this case I’m looking at the front tires, since my car is front wheel drive. The force of the tire matches the force of treadmill keeping the car stationary. Since the front tire is the driving force we need to look at the rear tire to relate it to the tire of a plane. The both the rear tire of the car and the tires on the planes see only external forces applied to it. The speed of the tire will match the speed of the treadmill because of the force of friction. If there was no friction the tire would stay stationary. If I increased the coefficient of friction of the rear tire it would make the tire go slower, causing the engine to have to apply more force to the front tires in order to stay stationary on the treadmill.

If we take a look at the free body diagram of the plane’s tire we’ll see that the tire sees the force of the treadmill and the propulsion forces of the plane. The force of the treadmill is transferred to the tire through friction. If the friction force is greater than the force of propulsion the plane will move backwards. If the friction force is less than the force of propulsion the plane will move forward.

The tire will go as fast as necessary to reflect the forces applied to it. As the mythbusters provided in their video if the speed of the treadmill matches the takeoff speed of the plane it will take off. That is because the propulsion of the plane is greater than the friction force applied to the plane’s tires.

In order to get the plane to stay on the treadmill we have to either make the plane weigh more to make the force of friction match the plane’s propulsion (which wouldn’t be preferred since the takeoff speed of the plane would be increased or the area on the wings would need to be increased to provide additional lift to keep the takeoff speed the same) or increase the friction coefficient by changing the treadmill/tire surfaces. The easiest way to test it would be to increase the coefficient of friction of the tire/treadmill interaction. Unfortunately I don’t have a plane or treadmill to test out the theory. Maybe the Mythbusters will try it out in a follow up episode.

Saturday, October 17, 2009

Adding Multiple Boundaries to a Corridor Surface

Occasionally you may want to add multiple surface boundaries to a surface. If you try to add multiple surfaces to a corridor for the corridor properties you will discover that only one boundary may be applied at a time. A way to get around this limitation is to add the boundary directly to the corridor surface outside of the corridor properties.

The first surface will be an outer boundary and each additional boundary will be a show boundary.

Here’s a short video: http://screencast.com/t/4Pg3FNLAsW3

Friday, October 16, 2009

Running .NET from a Network

Running a vb.NET dll from a network in AutoCAD doesn’t work very well on it’s own. It appears, at least from my small sample size, to work as long as the code doesn’t use Windows Presentation Foundation. If the code utilizes a routine that AutoCAD runs with WPF, AutoCAD crashes indicating that the routine isn’t supported. Unfortunately prompting the user for information such as a number or object causes this crash.

A way around this is to use the LispFunction available in .NET. The LispFunction passes a ResultBuffer between the .NET routine and a LISP command. By utilizing a LISP routine I was able to avoid the WPF issue. The LISP routine gets any objects or numbers required from the user and then passes them to the .NET routine. The first code I created worked fine on Civil 3D 2008, but crashes Civil 3D 2009 & Civil 3D 2010. I suppose the AutoCAD API was revised to use WPF after AutoCAD 2008. I then had to resort to using the LispFunction.

For more information on how to use the LispFunction check out these AU Papers:

CP211-3 VB.NET Command School

DE211-2 The Best of Both Worlds: .NET and LISP Can Coexist

Both papers may be found at AutodeskUniversity.com or AUGI.com.

Monday, October 12, 2009

Civil 3D 2010 Swap Parts Part II

In a previous post I introduced the ability to swap parts for pipe objects. It is also possible to swap structures. The structure of the code is almost exactly the same as the swapping pipes as shown below.

In the above case I’ve gone through and moved the code to vb.net. I’ve also added coded to allow the user to select multiple pipes and structures and added a dialog box to have the user select the pipe and/or structure from a dialog box (most of the code is not shown), no more having to change pipes or structures one at a time.

This short video shows it in action: http://screencast.com/t/MksgtRgeBuHS

If you want to try it on for size you may find the compiled project here: http://style.civil3dreminders.com/C3DRemindersPack2009-10-12.zip

Instructions on how to load it may be found here:

http://style.civil3dreminders.com/civil3dreminderspack

Thursday, October 08, 2009

Embedding a SWF into PowerPoint

I was embedding multiple SWF files into PowerPoint, unfortunately when I set the ScaleMode to fit to area it would reset the next time I opened the PowerPoint file. A search of the internet did not come up with a solution to my problem. Since I couldn’t find out how to fix it I created a kludge to get the SWF videos to be sized correctly. To do this I created a button on the first slide.

I then created a macro to go along with the button.

`Option ExplicitPrivate Sub CommandButton1_Click()        Dim oSlide As Slide        For Each oSlide In ActivePresentation.Slides        SlideShowWindows(1).View.Next        Dim oShape As Shape        For Each oShape In oSlide.Shapes            If oShape.Name = "ShockwaveFlash1" Then                Dim oShockwave As ShockwaveFlash                Set oShockwave = oShape.OLEFormat.Object                oShockwave.ScaleMode = 2            End If        Next    Next    SlideShowWindows(1).View.FirstEnd Sub`

The macro goes through each slide and sees if there is a SWF object named “ShockwaveFlash1”. If there is then the then the ScaleMode is set to 2, which is fit to the viewing area on the slide. If you renamed the SWF control name to something else, or have more than one SWF video on the page, then the code would need to be changed to reflect it. I noticed that the code didn’t work unless the slide was shown on the screen, which caused me to have to go through each slide. The code that moves through each slide is SlideShowWindows(1).View.Next line.

For some reason each Control on a slide is a Shape object. The SWF video is an OLE object. The last line of code before ending the Sub makes sure we go back to the first video.

This short screen cast goes over how to add a SWF to a PowerPoint slide: http://screencast.com/t/35dmmRfsdI

Wednesday, October 07, 2009

Shhh!

Apparently it’s a secret, but a doctor will see you if you don’t have insurance. It’s just like taking your car into get fixed. There’s even doctors who don’t even take insurance. I just wish TV shows would stop spreading the myth of not being able to see a doctor if you don’t have insurance. After all to see a doctor you need less money than it takes to get a 15,000 mile service at Cole Chrysler Dodge. And just like getting your car fixed you can ask for an estimate of services from the doctor before you go in.

Tuesday, October 06, 2009

Copy Pspace to Mspace

Some commands in LDT haven’t brought over to Civil 3D. Often it’s because AutoCAD has commands that are up to the task. One of the commands is Copy Pspace to Mspace and vise-versa. We can modify the cui to get the same functionality (I think I didn’t actually try the command in LDD).

1. First create a new command in the cui.
2. Add the following to the command: ^C^C_copybase;0,0;\;pasteclip;0,0;chspace;p;;
3. Add the command to a toolbar or ribbon.

Now you should have the same type of functionality you had in Land Desktop.

Friday, October 02, 2009

I put up a survey request last week regarding my free Civil 3D Reminders Pack. One of the requests was to add “A set cross-hair slope command (like LDT had for profile design). The command would ask you to select the Profile View (for vertical scale determination) and then ask the percent slope you want to set (neg or positive).”

Well I actually opened Land Desktop to see how the command worked. The command basically sets the snap angle of the cursor and turns on Ortho. I’m not good at Lisp or Diesel programming so I’m going basic and cover the steps to get the same functionality. Once the steps are outlined it shouldn’t be that difficult to add a command to the cui to perform the task in Civil 3D.

1. The first thing to do is type SnapAng at the command line.
2. Next click in an area within the profile view you want to have the crosshairs on.
3. Next type ‘PGS at the command line or select Profile Grade Station from the transparent toolbar.
4. Select the Profile View.
6. Pick any station.
7. The cursor should now match the grade put in.
8. Lastly press the Ortho button (or F8) to turn Ortho on if it’s not already on.

You should now have the same functionality as you had in Land Desktop. To get back to the starting point make snapang = 0 and turn Ortho off.

Here’s a short video: http://screencast.com/t/lxctOrTOk

Thursday, October 01, 2009

Idaho

I got a request to see how Idahoans stack up in the readership of this blog. The information is from the first of the year until today.  Here is the list of cities:

Here’s how they got to the blog: