purchase windows xp online download windows 7 home premium cheapest price buy cs3 adobe buy windows 7 home premium full version microsoft office 2003 buy product key adobe contribute trial cheap adobe soundbooth cs4 buy adobe cs3 software cheap turbotax premier 2008 buy vista premium vmware workstation 6.5 download powerpoint pricing purchase quickbooks purchase windows xp sp2 cheap vista cay cheap microsoft office 2003 software buy streets and trips 2009 cheap xilisoft dvd ripper ultimate 5 cheap adobe creative suite 4 design premium buy photoshop cs4 turbotax discount code vista purchase upgrade to windows 7 cyberlink powerproducer 5 ultra price buy windows 7 activation key best price windows 7 64 bit purchase adobe acrobat 9 standard buy windows xp service pack 3 mudbox price download uniblue registrybooster 2009 buy windows 7 sticker adobe photoshop elements cheapest best price adobe presenter 7 best price dragon naturallyspeaking 10 purchase visual studio 2008 professional buy office 2010 download microsoft word 2003 purchase vista license buy office 2003 pro buy office 2007 student discount buy windows 7 upgrade online where to buy windows xp os buy office 2007 proofing tools buy windows 7 family pack buy cs4 web premium buy windows xp code purchase vista ultimate buy photoshop for mac best price photoshop cs4 mac discount microsoft office 2003 where to buy windows xp cd purchase microsoft office 2007 professional buy vista australia graphisoft archicad 12 price windows 7 price hong kong buy mathcad 14 download avid media composer 3.5 purchase microsoft office professional 2003 adobe dreamweaver mac os x buy access 2003 software acrobat 9 pro buy adobe creative suite 4 for mac buy pagemaker 7.0 quarkxpress 8 mac download microsoft encarta premium 2009 dvd best price corel painter x mac buy windows xp corporate download wordperfect purchase microsoft office word 2007 cubase 4 price microsoft windows 7 professional 64-bit oem can you buy windows xp anymore buy windows xp sp2 cd cheap windows vista ultimate 64 bit cheap grahl pdf annotator 2 buy office 2007 amazon microsoft mappoint 2009 cost cheap microsoft office 2008 mac buy adobe contribute cs4 windows 7 ultimate price uk purchase vista home premium cheap microsoft outlook 2007 adobe after effects cs3 price corel photoimpact 12 autodesk navisworks simulate 2009 adobe photoshop elements 8 price windows 7 pro cheapest adobe captivate sale price vista faucets how to buy windows 7 license cheap windows vista download quarkxpress 8 full windows vista buy download microsoft frontpage license archicad 11 download purchase windows 7 licence key best price adobe flash cs4 buy windows 7 price windows 7 ultimate oem best price price of windows 7 home premium microsoft office price 2007 buy windows xp microsoft microsoft office discount for students omnipage price cheap sony sound forge 9 buy windows 7 home zonealarm internet security suite 8 price download windows vista business 64 bit cheap adobe photoshop software buy autocad lt 2010 buy cyberlink powerdirector 8 download mcafee antivirus windows 7 buy product key purchase dragon naturally speaking buy microsoft office 2007 professional coreldraw x4 mac adobe captivate oem windows 7 discount for vista users purchase powerpoint only autodesk 3ds max price cheap microsoft office 2007 standard cheap i.r.i.s. readiris pro 11 buy microsoft office 2003 pro fl studio 8 xxl buy buy windows 7 upgrade key buy office 2007 license cheap acrobat 9 microsoft word 2007 price buy adobe cs3 design premium mac norton 360 discount buy windows 7 32 or 64 buy microsoft office xp purchase windows 7 cheap download guitar pro 4 buy windows 7 for 50 dollars buy autodesk lustre 2009 download ashampoo burning studio 9 buy burnaware professional download guitar pro for mac adobe framemaker 9 price buy windows xp recovery disc pinnacle studio 14 discount buy windows 7 egypt dreamweaver mac oem buy adobe cs3 for mac download autocad mechanical 2010 buy office 2003 basic cheap avanquest powerdesk pro 7 cheap windows 7 home upgrade buy windows xp home sp3 acdsee activation code buy windows xp license online adobe cs3 production premium mac buy matlab r2009a where to buy windows 7 download buy windows 7 download canada cheap microsoft visio 2007 windows 2003 enterprise license cost buy microsoft office in hong kong cheap pinnacle studio 12 windows 7 discount singapore windows xp discount for students buy microsoft office online download guitar pro 6 conceptdraw download cheap lightroom download adobe indesign cs4 windows datacenter 2008 licensing buy windows 7 product key buy access 2003 online download ashampoo burning studio 8 buy microsoft office cheap zonealarm antivirus 8 trial windows 7 price oem best price autosketch 9 after effects cs3 for mac purchase windows xp cheap buy photoshop cs3 software buy cyberlink powerdirector 8 pcanywhere buy cheap final cut express 4 download dragon naturally speaking 10 purchase windows xp full version buy photoshop filters buy windows vista ultimate online master collection cs4 student buy adobe framemaker windows 7 ultimate 64 bit cost coreldraw for mac download buy microsoft windows 7 professional download after effects cs4 cheap quicken 2010 autocad architecture download adobe suite cs3 price purchase windows xp pro license buy windows 7 oem cheap purchase windows 7 canada buy microsoft money 2007 deluxe turbotax 2009 deals buy adobe photoshop elements 8 buy adobe acrobat 9 pro buy office 2007 small business upgrade windows 7 discount military adobe illustrator cs3 direct download buy microsoft office product key buy windows 7 oem india buy windows 7 oem online buy windows 7 ultimate x64 autodesk maya 2009 download purchase photoshop elements 8 adobe contribute cs4 mac dragon naturally speaking 10 discount dragon naturally speaking 10 download buy windows 7 south africa download corel painter for mac adobe font folio price i.r.i.s. readiris pro 11 price buy windows 7 for 3 computers buy microsoft word 2007 software cheap norton 360 v3 buy visio 2003 download purchase adobe acrobat standard mappoint 2006 download buy powerpoint 2003 download purchasing powerpoint buy office enterprise 2007 adobe indesign download autocad inventor price cheap norton partitionmagic 8.0 buy symantec winfax pro 10.4 visual studio 2008 professional download buy lightroom for mac buy windows vista cd cheap adobe cs4 production premium best buy quicken 2008 microsoft onenote pricing cheap autocad software autocad architecture 2010 download paperport software download windows 7 price microsoft windows 7 price canada pinnacle studio 14 best buy windows 2008 enterprise cost microsoft autoroute 2007 download buy web page maker 3 buy norton 360 license best buy autodesk 3ds max 2009 mappoint 2009 north american maps lightroom for mac os x adobe creative suite 4 master collection download workstation 7 download buy windows 7 ultimate cd key buy dvd moviefactory 6 download windows 7 price comparison adobe cs3 master collection system requirements buy parallels 4 buy microsoft office canada best buy microsoft windows 7 ultimate buy windows 2008 datacenter quicken rental property manager download download microsoft money 2007 deluxe cheapest windows xp professional buy windows 7 with paypal buy pagemaker software windows 7 buy oem pdf converter professional 6 promotional code buy windows xp key best buy microsoft money 2007 buy windows 7 3 user license microsoft office price compare buy windows 7 ultimate price buy windows 7 nigeria buy corel draw 10 microsoft windows 7 price australia buy vista home premium 64 bit purchase adobe indesign cs4 where to buy windows xp cheap download acrobat 9 buy microsoft visual studio 2005 download nero 8 ultra edition download adobe premiere elements 7 premiere pro cs3 adobe contribute for mac buy acronis disk director suite buy adobe creative suite cs4 purchase windows vista business cheap uniblue registrybooster 2009 adobe premiere pro for mac native instruments traktor dj studio 3.4 windows 2008 standard edition cheap nero 9 adobe photoshop elements 6.0 download buy photoshop cs4 download cakewalk sonar 8 cheap windows 7 singapore purchase photoshop cs2 download adobe illustrator mac download autocad architecture 2010 buy windows xp pro 64 bit dreamweaver mac demo purchase microsoft office product key where can i buy microsoft office cheap buy access 2007 online buy vmware workstation 7 cheap native instruments traktor dj studio 3.4 download solidworks 2009 buy autosketch 9 cheap microsoft project 2007 buy office 2007 in india download nero 9 purchase windows 7 in mumbai propellerhead reason 4 buy best price steinberg nuendo 4.3 purchase windows 7 malaysia where to buy windows vista ultimate windows xp price in malaysia cheap windows xp pro oem buy vista operating system buy windows 7 from china buy photoshop new zealand imsi turbofloorplan home and landscape pro 12 buy buy microsoft mappoint 2006 europe excel 2007 price buy cs4 photoshop download premiere elements 8 buy matlab cheap pctools spyware doctor 5.5 download where can i buy powerpoint 2003 buy microsoft works 9 adobe illustrator cs3 download buy windows xp walmart buy adobe cs4 suite windows 7 price drop 2010 cheap windows 2003 enterprise download archicad 11 purchase windows 7 online australia norton 360 buy online where to buy windows xp license purchase windows 7 oem key windows 7 home premium 64 oem buy windows 7 in new zealand best price adobe photoshop elements 6 where to buy corel video studio x2 microsoft powerpoint 2007 download buy microsoft visio 2003 buy office 2007 home and student buy adobe photoshop cs3 cheap cheap office 2007 pro microsoft office discount software buy windows xp london cheap adobe dreamweaver cs4 microsoft windows xp price list

Profile Data From Points

I’m pro-customization, although I think some think it is a four letter word. Sometimes you have some work to do and Civil 3D can’t do the task out of the box. A recent poster on the discussion group has this problem. Here is quick way to make is job easier in creating a profile from points. While it could be done better, it should save him some time for the task at hand and be quicker than doing it manually.

Since I want to get the job done quickly and don’t want to spend a lot of time writing the code, I will be doing the bare minimum in creating the VBA routine. The routine will have the user select an alignment then process all of the points in the drawing, exporting the Station and Offset data to an Excel spreadsheet. The information can be processed in Excel and then imported into Civil 3D as a profile.

Since its best to start with some previously written code to reduce the work we will start with the C:\Program Files\AutoCAD Civil 3D 2008\Sample\Civil 3D API\Vba\Pipe\PipeSample.dvb file that ships with the product. Copy the file before you go further.

See my previous post on how to load a VBA file.

We are going to use the ExcelFuntions module and the ExportToExcel ModuleToUsesub. The first thing we need to do is declare some more objects that we will be using with the routine. The point object is declared as an AeccPoint and the alignment is AeccAlignmnet. We will also declare some data values to store the Northing and Easting of a point. The entbasepnt variable is to help select an alignment in the routine. Add the lines below (without the numbers and :) under the other Dim’s:

   1: Dim dPointX As Double
   2: Dim dPointY As Double
   3: Dim dOffset As Double
   4: Dim dStation As Double
   5: Dim entbasepnt As Variant

Next we will have to select an alignment to use to get the Station and Offset information. The code to select an object is below along with some coding to make sure the object is an alignment and then setting the oAlignment variable to the alignment that was selected. You will want to put this portion of code right after the Dim values you added above.

   1: ThisDrawing.Utility.GetEntity oAcadObject, entbasepnt, "Select an alignment: "
   2:
   3:     If (TypeOf oAcadObject Is AeccAlignment) Then
   4:          Set oAlignment = oAcadObject
   5:     End If

Now we will cycle through all of the points in the drawing. To do this make the changes in this picture:

PointInfo

Here is the code mentioned in the picture:

   1: dPointX = oPoint.Easting
   2: dPointY = oPoint.Northing
   3:  
   4: oAlignment.StationOffset dPointX, dPointY, dStation, dOffset
   5:  
   6: ' add the values
   7: sheetPipes.Cells(iRowPipes, 1).Value = dStation
   8: sheetPipes.Cells(iRowPipes, 2).Value = oPoint.Elevation
   9: sheetPipes.Cells(iRowPipes, 3).Value = dOffset

Now just hit the Play button in the Visual Basic Editor (or run the command using VBARUN). You will probably need to switch back into Civil 3D to select the alignment. Excel should open and populate the worksheet. Sort (to separate the left and right offsets and delete any information you don’t want (such as the points with 0 offset and 0 station and the offset column). Save the data into two separate files, one for the left and one for the right offset, in an ASCII text file with the data separated by spaces. Use the Create Profile from File command from the menu to bring the profile into the file and select the desired alignment to attach the data to.

The above sample is quick and to the point with no error catching that would make the program run problem free. For instance if you select an object that is not an alignment the debugger will come up. Just choose to End the program and try again. You could also sort the data into two separate worksheets for left and right, delete any entries with a station and offset values of 0. But these improvements would only be worth the time if you planned on doing this often.

A final copy of what I came up with may be found here. Its under the 10-21-07 date (PipeSample-Profile.dvb).

 

2 Responses to “Profile Data From Points”

  1. Antonio Llanos says:

    I could really use a routine to create a profile from points along an alignment in C3D 2009. Following this post I loaded the dvb provided by the link. However when I run it the following error comes up:

    Compile error:
    Cant find project or library

    Debugger points to

    Public Sub ExportToExcel()
    Dim oAcadObject As AcadObject
    >>>>Dim oPipe As AeccPipe

    Im not too fluent in VB, but would really like to get this running, any ideas?
    Thanks
    Antonio

  2. Antonio this post was done utilizing Civil 3D 2008 and the references need to be changed in order for it to work in 2009, to update the references to 2009 take a look at this post: http://blog.civil3dreminders.com/2008/09/updating-references.html