AutoCAD Civil 3D General Discussion

AutoCAD Civil 3D General Discussion

Reply
Valued Contributor
88 Posts
0 Kudos
Registered: ‎11-15-2004
Post 1 of 5

C3D points

86 Views, 4 Replies
01-24-2005 09:57 AM
hi,

does someone have a simple VBA routine that shows how to convert a Acad point entity into a C3D point ?

thx !
*James Wedding
Post 2 of 5

Re: C3D points

01-24-2005 10:54 AM in reply to: XXL66
Get the Northing, Easting, Elevation from the point, and use the Drawing.Points.Add method. -- James Wedding, P.E. Technology Manager & Associate Jones & Boyd, Inc. Dallas, TX XP/2 on P4-3.4/1G LDT2005SP1 & C3D2005SP1
*Peter Funk - Autodesk, Inc.
Post 3 of 5

Re: C3D points

01-25-2005 06:36 AM in reply to: XXL66
Here is a simple program what will add a COGO point for every point object in the drawing file. The elevation of the COGO point will match the elevation of the AutoCAD point. Make sure that you add the refrences to the Civil type libraries before you run it. Cheers, Peter Funk Autodesk, Inc. Option Explicit Public g_oCivilApp As AeccApplication Public g_oAeccDoc As AeccDocument Public g_oAeccDb As AeccDatabase Function getCivilObjects() As Boolean Dim oApp As AcadApplication Set oApp = ThisDrawing.Application Const sAppName = "AeccXUiLand.AeccApplication" Set g_oCivilApp = oApp.GetInterfaceObject(sAppName) If g_oCivilApp Is Nothing Then MsgBox "Error creating " & sAppName & ", exit." getCivilObjects = False Exit Function End If Set g_oAeccDoc = g_oCivilApp.ActiveDocument Set g_oAeccDb = g_oAeccDoc.Database getCivilObjects = True End Function Public Sub convertPoints() getCivilObjects Dim cPoints As aeccpoints Dim point As AeccPoint Dim aPoint As AcadPoint Dim obj As AcadObject Dim coords As Variant Set cPoints = g_oAeccDb.Points For Each obj In ThisDrawing.ModelSpace If TypeOf obj Is AcadPoint Then Set aPoint = obj coords = aPoint.Coordinates cPoints.Add (coords) End If Next End Sub
Valued Contributor
88 Posts
0 Kudos
Registered: ‎11-15-2004
Post 4 of 5

Re: C3D points

01-25-2005 11:26 AM in reply to: XXL66
thx for the reply,

it did it using a slight different way.

I want to convert point which have EED attached, that EED has a number too (a unique string).

Can I use this name for number in a C3D point,
it seems it's read-only.

thx !
*James Wedding
Post 5 of 5

Re: C3D points

01-25-2005 12:38 PM in reply to: XXL66
Grab the dvb file I've attached about five posts up. I think you'll have to write a text file with your EED number in a PNEZD (or some such) format, then import it back in. That sample file above does just that process. -- James Wedding, P.E. Technology Manager & Associate Jones & Boyd, Inc. Dallas, TX XP/2 on P4-3.4/1G LDT2005SP1 & C3D2005SP1
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post