rulururu

post Copying a surface with Civil3D, a better way?

January 30th, 2008

Filed under: C3D, Customization — blogger @ 1:16 am

Reading Pete Kelsey’s post “Copying a Surface with Civil3D” I was amazed at his seven step response. My first thought was couldn’t you right-click on a surface in the prospector and select COPY. So I opened up a drawing in C3D, went to the prospector, right clicked and to my surprise, no copy command.

I am a C3D fan, but I am amazed at basic everyday functionality left out of the software. I know C3D is a new platform and not a Land Desktop clone. However, our work flow has been built around Land Desktop functionality. The right click copy surface has been with us in the LD terrain model explorer for years. Copying a surface is a typical if not daily task in 3D site modeling. Using the vanilla autocad copy command with seven steps is unacceptable. So I started looking for a ‘better way’.

We didn’t have to look too far. the API provides a copy method for the surface object. Writing the code to copy the surface would be easy. Adding the right-click functionality to the prospector isn’t as simple. We can easily add right-click functionality to the surface object in model space. The user would simply select the surface then right click and select ‘copy surface’.

Keep in mind setting this customization up does take more than 7 steps, but once it is implemented it is a nice feature.

This builds on my previous post adding right-click functionality to C3D objects. Another big thanks to David for making these available. If you haven’t downloaded and installed his custom cui, do it now. You will now have the right click functionality for C3D objects.

Open your cui by typing cui at the command prompt.

Once in the cui expand the Shortcut Menus, then expand the AECC_TIN_SURFACE shortcut menu.

Add Separator

Now right click on Check for Contour Problems and select add separator. As shown above.

create command

The next step is to define the copy surface command. Click the create new command button as shown above.

command

Add the following name Copy Surface and command ^C^Ccs; as shown above.

copy surface

Now apply and close your cui. Open a dwg with a surface. Right click on the surface, you’ll see your new right click command as shown above. We’re halfway there.

Next step is to define our command. If you aren’t interested in the details you can skip to the bottom and download the zip file.

Here’s the basic VBA code needed.

Dim AecSurface As AeccTinSurface
Dim AecSurfaceNew As AeccTinSurface
Set AecSurface = ThisDrawing.ActiveSelectionSet.Item(0)
Set AecSurfaceNew = AecSurface.Copy

Four simple lines and we’ve copies the selected surface.

The complete VBA dvb file is included in the zip file below. Code has been added to handle renaming the surface.

The last step is to create a LISP routine to call the VBA. Below is the routine, it is included in the zip file below.

(defun c:cs ()

(vl-vbarun “C:/civil3dblog.com/vba/copysurface.dvb!cs”)

(princ)
)

Download the zip file of the routines here. Save the zip file to your c:/ and right click and select extract all. It should place the files in the proper folders.

Then appload the cs.lsp located in the /lisp folder into your drawing, also add it to your startup suite so it is available in all your drawings.

Now right-click on a surface and select copy surface, your surface is duplicated. Check out the prospector.

This will give you a good starting point for adding other missing functionality to Civil 3D.

If you have any questions or feel additional information should be posted leave a comment and we will update the post.

post FILEDIA, the acaddoc.lsp solution

January 4th, 2008

Filed under: Customization, Must Have — blogger @ 1:05 pm

The FILEDIA variable has a tendency of being set to zero when Civil 3D crashes. This results in your file open options being displayed on your command line. A major annoyance. This topic has been posted on the discussion groups several times. One solution is to place the following line in an acaddoc.lsp file in you civil 3d support directory.

(setvar “filedia” 1)

If you don’t have an acaddoc.lsp file you can create your own in notepad and save it in your support directory. Or right-click and save as the file here.

The acaddoc.lsp file is run by autocad when you open a new file. The line you added will set FILEDIA to 1 preventing the dialogs from being disabled.

post Right-Click and Double-Click Civil3D Objects

December 26th, 2007

Filed under: Customization, Must Have — blogger @ 6:43 am

If you haven’t stumbled upon David Garrigues’s Double and Right-Click CUI available on the Autodesk Civil Engineering Community page you are missing out. David has customized the CUI allow the user to interact with Civil3D Objects via double-clicks and right-click menus. This falls into our Must Have Category. Once you try it you won’t be able to use C3D without it.

Here’s David’s summary of the customization:

“Did you ever wish that if you double clicked on a Civil 3D Object you would get the appropriate Properties Dialog box for that Object? Of course and what if you right clicked on a Civil 3D Object did you wish you had more appropriate options in your right click menu? Of course you did so here it is just as it was presented at AU this year in my class called Civil 3D Grading: It’s Not a Slippery Slope.”

Check out his post on the Civil Engineering Community page here. (You’ll have to login to view this page, you can use your login for the Autodesk Discussion Group)

You can also further customize the right-click/double-click functionality. We’ll build on this in our next post.

Add civil3dblog.com to your favorite RSS feeds now so you don’t miss out on any posts.

post Civil3D Missing Features?

December 13th, 2007

Filed under: Customization — blogger @ 5:45 pm

Is Civil3D missing features?

Being a long time LD user I’m finding the answer to this question to be a resounding YES!

We’re asking Civil3D users to email us any features that Civil3D is ‘missing’.

We’ll be posting routines to fill in some of the Civil3D feature gaps so get your requests in early and often.

Please email requests and ‘missing’ Civil3D features to us at missing at this domain.

post Autocad Civil3D debugging with .net express

December 1st, 2007

Filed under: Customization — blogger @ 7:16 am

If you have been using VBA to customize Autocad Civil 3D and have been wanting to check out vb.net now is a great time. Microsoft has made available express editions of their visual studio products for some time now. They can be downloaded here:

Visual Studio Express 2008

Visual Studio Express 2005

Either version should work equally well for Autocad .net customization and can be installed side by side.

The express editions have some limitations over the standard and pro versions of visual studio. The most important being that the express editions do not allow real time debugging in Autocad. This makes it very difficult to debug your code.

I came across a link to Kean’s blog through the API with a post on Debugging using Express Editions. After reading the post you’ll see it is possible to debug with the Express Editions.

To make it even easier those who attended Jerry Winter’s class at Autodesk University in 2006/2007 who received a DVD from him it includes an Autocad vb.net express template installer that works with Autocad and C3D.

The website civildev.com provides a template installer for VS Express 2005 it can be downloaded here. This installer was recommended by the AU 2007 class .net Programming for Civil Engineers and Surveyors.

Best of all this powerful programming tool is free.

ruldrurd
© 2007-2009 Civil3Dblog.com, Desinged by Stealth Settings
Entries (RSS) and Comments (RSS)