Using the "Profile-2.dwg" from the tutorials as my example drawing, this
worked for me:
[code]
Option Explicit
Public ogCivilApp As AeccApplication
Public ogCivilDoc As AeccDocument
Sub test()
Dim cvSite As AeccSite
Dim cvAlign As AeccAlignment
Dim cvProf As AeccProfile
If ogCivilApp Is Nothing Then
If Not getCivilObjects Then Exit Sub
End If
Set cvSite = ogCivilDoc.Sites.Item("Site")
Set cvAlign = cvSite.Alignments.Item("Ridge Road")
Set cvProf = cvAlign.Profiles.Item(0)
'Do whatever with the profile
End Sub
''Below function was derived from code posted by Laurie Comerford
Function getCivilObjects() As Boolean
On Error GoTo ErrorHandler
Dim oApp As AcadApplication
Set oApp = ThisDrawing.Application
Const sAppName = "AeccXUiLand.AeccApplication"
Set ogCivilApp = oApp.GetInterfaceObject(sAppName)
If ogCivilApp Is Nothing Then
MsgBox "Error creating " & sAppName & ", exit."
getCivilObjects = False
Exit Function
End If
Set ogCivilDoc = ogCivilApp.ActiveDocument
getCivilObjects = True
Exit Function
ErrorHandler:
MsgBox Err.Description & " in getCivilObjects" & vbCrLf & "Hence unable to
continue ", vbCritical
End Function ' getCivilObjects
[/code]
wrote in message news:5048713@discussion.autodesk.com...
Ok, I am not using the "Set prof = ... " so that would be it
What would I set prof to?
Thanks for your help.
<> Oh, and count returns 2, so 1 should work.
Message was edited by: honeyman