Ad

Thursday, August 13, 2009

Civil 3D 2010 Swap Parts – Part 1

I’m underemployed this week and was looking for something to post on to fill my time. It took me a bit, but someone in the Discussion Group asked if you could swap multiple parts in 2010. I was pretty sure you couldn’t do it out of the box, but was thinking it may have been added to the API in 2010. To my surprise the ability to swap parts was added to Civil 3D 2010. This addition will allow us to swap multiple parts within one command.

The first step was to make sure it worked. To do this I created a quick VBA routine that made sure it worked.

image

The first part makes sure Civil 3D is running. Next I prompted to get a pipe. If it is a pipe I then went through and got the Settings for the drawing, which contains the collection of Part Lists. Once I got the parts list I went ahead and got the first on in the list. Next I got went through each Part Family in the Part List to get the Pipe type. Once I got the Part Family I could get a Part Size Filter. In this case I just got the first one. Finally I had all of the information to swap the pipe. In this case I swapped an 18” concrete pipe with a 24” x 24” Concrete Box culvert. Now that I know it works I can create some dialogs that let the user select the swapped pipe size. That will be for a future post though.

No comments:

LinkWithin

Blog Widget by LinkWithin

Ad