I've been working on surfaces lately, hence the series of Parking Lot Surface posts from last week. I've noticed the need to turn on and off triangles for a surface, either by changing the surface style or changing the style of the surface to show triangles, quite often. It takes about 3 or 4 steps to change it. I thought that was about 2 to 3 clicks too many so I decided to create a VBA routine to cut those steps down.
The first thing to do is create a new VBA file from the VBAMAN dialog box.
Once created press the SaveAs button and save it to a location of your choosing. Next open the Visual Basic Editor and a new module from the Insert Menu and set the references for the Civil 3D Land Modules.
Next add Option Explicit and name the Sub what you want it to be.
Next we need to create some variables and prompt the user to select a surface object.
Now that we have the surface we need to make sure the user selected a surface.
If the user selected a surface we need to set the surface equal to a surface type variable and then check to see if the triangles are showing. If they are the code will turn them off, and if they are showing the code will turn them off.
So now just add some error catching to it, maybe an "On Error Resume Next" at the top of the macro or have the user try again at selecting a surface. So that's how I'm going to be toggling the tin triangles for a Surface Style while doing surface design.