Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

select point by window

17 REPLIES 17
Reply
Message 1 of 18
Anonymous
505 Views, 17 Replies

select point by window

Can anyone see why I'd get an overflow error selecting points. I've used
this same basic selection type in Land and never got and error when
selecting 100 thousand points.
how should I iterate thru points in civil 3D?


John

Private Sub CommandButton1_Click()
hide
If (GetBaseCivilObjects() = False) Then
Exit Sub
End If

Dim oPoint As Variant
Dim ssetObj As AcadSelectionSet
Dim i As Integer
Dim icount As Integer

Dim ftype(0 To 3) As Integer
Dim fdata(0 To 3) As Variant
ftype(0) = -4: fdata(0) = " ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
ftype(2) = 0: fdata(2) = "INSERT"
ftype(3) = -4: fdata(3) = "or>"

Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
ssetObj.SelectOnScreen ftype, fdata
MsgBox "count is " & ssetObj.Count & vbCrLf

'i is the number of items in the selection set of aec points
For i = 0 To ssetObj.Count - 1
Set oPoint = ssetObj.Item(i)

On Error Resume Next
ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number & "
N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
oPoint.Description

Next i
ssetObj.Delete
UserForm1.Show
End Sub


'module
Function GetBaseCivilObjects() As Boolean
Dim oApp As AcadApplication
Set oApp = ThisDrawing.Application
' NOTE - Always specify the version number.
Const sAppName = "AeccXUiLand.AeccApplication.7.0"
Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
If (g_oCivilApp Is Nothing) Then
MsgBox "Error creating " & sAppName & ", exit."
GetBaseCivilObjects = False
Exit Function
End If
Set g_oDocument = g_oCivilApp.ActiveDocument
Set g_oAeccDatabase = g_oDocument.Database
GetBaseCivilObjects = True
End Function
17 REPLIES 17
Message 2 of 18
Civil3DReminders_com
in reply to: Anonymous

I'm code works for me. It may be an error from another part of the code or Civil 3D needs to be repaired. I ran it both with the error catching and without.

Christopher
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 3 of 18
Anonymous
in reply to: Anonymous

Christopher,

I'll test again but what I posted is all that is in the routine. I'll check
the drawing and test on another machine at work to see if I get the same
error. When I test with 10-20 points it seems to work but if I select 4500
punts I get the error.

Thanks for you help

John
"Civil3DReminders.com" wrote in message
news:6319591@discussion.autodesk.com...
I'm code works for me. It may be an error from another part of the code or
Civil 3D needs to be repaired. I ran it both with the error catching and
without.

Christopher
Message 4 of 18
Anonymous
in reply to: Anonymous

Hi John,

A couple of comments.

Why are you selecting blocks as well as AEC Points?

The filter command you need for AEC Points is:
{code}

Dim ftype(0) As Integer
Dim fdata(0) As Variant
ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"

{code}
I presume this is test code, but I simply can't picture why a drawing
would have 100,000 points in it. Assuming they were regularly spaced at
minimum spacing to suit the label display size and there was no other
data you would need about 50 A1 drawing sheets just to plot them legibly

{code}
" Elev= " & oPoint.Description
{code}
seems a bit weird. I would have expected:
{code}
" Elev= " & oPoint.Elevation
{code}

In the posted code you do not use the Civil 3D objects oCivilApp,
oDocument and oAeccDatabase

The following still works
{code}

'module
Function GetBaseCivilObjects() As Boolean
Dim oApp As AcadApplication
Set oApp = ThisDrawing.Application
' NOTE - Always specify the version number.
Const sAppName = "AeccXUiLand.AeccApplication.7.0"
' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
' If (g_oCivilApp Is Nothing) Then
MsgBox "Error creating Civil 3D environment, program will exit"
GetBaseCivilObjects = False
Exit Function
End If
' Set g_oDocument = g_oCivilApp.ActiveDocument
' Set g_oAeccDatabase = g_oDocument.Database
GetBaseCivilObjects = True
End Function

{code}

For purposes of testing I put 10,000 points in a drawing and the code
ran OK for me, taking about 3.7 seconds

By redefining the filter, I was guaranteed not to include anything in
the selection set but Civil 3D points, but for safety added:

{code}
If TypeOf oPoint Is AeccPoint Then
ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
& " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
oPoint.Elevation & vbCrLf
End If
{code}

Curiously the code then ran about 2% faster even though it had to
evaluate the If statement

I tried redefining oPoint as an AeccPoint instead of a variant, - code
ran marginally faster, perhaps 1%



Regards,


Laurie Comerford
jcoon wrote:
> Can anyone see why I'd get an overflow error selecting points. I've used
> this same basic selection type in Land and never got and error when
> selecting 100 thousand points.
> how should I iterate thru points in civil 3D?
>
>
> John
>
> Private Sub CommandButton1_Click()
> hide
> If (GetBaseCivilObjects() = False) Then
> Exit Sub
> End If
>
> Dim oPoint As Variant
> Dim ssetObj As AcadSelectionSet
> Dim i As Integer
> Dim icount As Integer
>
> Dim ftype(0 To 3) As Integer
> Dim fdata(0 To 3) As Variant
> ftype(0) = -4: fdata(0) = " > ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
> ftype(2) = 0: fdata(2) = "INSERT"
> ftype(3) = -4: fdata(3) = "or>"
>
> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
> ssetObj.SelectOnScreen ftype, fdata
> MsgBox "count is " & ssetObj.Count & vbCrLf
>
> 'i is the number of items in the selection set of aec points
> For i = 0 To ssetObj.Count - 1
> Set oPoint = ssetObj.Item(i)
>
> On Error Resume Next
> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number & "
> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
> oPoint.Description
>
> Next i
> ssetObj.Delete
> UserForm1.Show
> End Sub
>
>
> 'module
> Function GetBaseCivilObjects() As Boolean
> Dim oApp As AcadApplication
> Set oApp = ThisDrawing.Application
> ' NOTE - Always specify the version number.
> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
> If (g_oCivilApp Is Nothing) Then
> MsgBox "Error creating " & sAppName & ", exit."
> GetBaseCivilObjects = False
> Exit Function
> End If
> Set g_oDocument = g_oCivilApp.ActiveDocument
> Set g_oAeccDatabase = g_oDocument.Database
> GetBaseCivilObjects = True
> End Function
>
Message 5 of 18
Civil3DReminders_com
in reply to: Anonymous

Sorry I missed the 100,000 point part. Change the Integer to Double or Long and it should work. Integers only go up to 32,767.

Christopher
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 6 of 18
Anonymous
in reply to: Anonymous

Laurie, Christopher

Thank you for helping me with this point selection test. I'm trying to
covert some old Land routines to C3D until I can eventually move these to
dot net.

Laurie, The reason for the test is to confirm that the approach path (
highway) to a runway is clear of obstructions, that includes sampling 2-10
miles of ground points, trees and any other objects like cell phone towers
to that approach. Because of that I routinely need to sample over 100k of
points against control surfaces to identify penetration to those surfaces.

With the modified filter and changing the count to long I now get the
expected results. Only thing remaining is to see if I can add a progress
bar. I normally push the selection to the command line so the user can see
that the routine has not halted becuase it takes a short amount of time to
sample these points against the control surfaces. if the point is a
penetration I collect the point number,
northing,easting,elevation,description and what surface name it penetrates.

Thanks for all your help.
John

"Laurie" wrote in message
news:6319608@discussion.autodesk.com...
Hi John,

A couple of comments.

Why are you selecting blocks as well as AEC Points?

The filter command you need for AEC Points is:
{code}

Dim ftype(0) As Integer
Dim fdata(0) As Variant
ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"

{code}
I presume this is test code, but I simply can't picture why a drawing
would have 100,000 points in it. Assuming they were regularly spaced at
minimum spacing to suit the label display size and there was no other
data you would need about 50 A1 drawing sheets just to plot them legibly

{code}
" Elev= " & oPoint.Description
{code}
seems a bit weird. I would have expected:
{code}
" Elev= " & oPoint.Elevation
{code}

In the posted code you do not use the Civil 3D objects oCivilApp,
oDocument and oAeccDatabase

The following still works
{code}

'module
Function GetBaseCivilObjects() As Boolean
Dim oApp As AcadApplication
Set oApp = ThisDrawing.Application
' NOTE - Always specify the version number.
Const sAppName = "AeccXUiLand.AeccApplication.7.0"
' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
' If (g_oCivilApp Is Nothing) Then
MsgBox "Error creating Civil 3D environment, program will exit"
GetBaseCivilObjects = False
Exit Function
End If
' Set g_oDocument = g_oCivilApp.ActiveDocument
' Set g_oAeccDatabase = g_oDocument.Database
GetBaseCivilObjects = True
End Function

{code}

For purposes of testing I put 10,000 points in a drawing and the code
ran OK for me, taking about 3.7 seconds

By redefining the filter, I was guaranteed not to include anything in
the selection set but Civil 3D points, but for safety added:

{code}
If TypeOf oPoint Is AeccPoint Then
ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
& " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
oPoint.Elevation & vbCrLf
End If
{code}

Curiously the code then ran about 2% faster even though it had to
evaluate the If statement

I tried redefining oPoint as an AeccPoint instead of a variant, - code
ran marginally faster, perhaps 1%



Regards,


Laurie Comerford
jcoon wrote:
> Can anyone see why I'd get an overflow error selecting points. I've used
> this same basic selection type in Land and never got and error when
> selecting 100 thousand points.
> how should I iterate thru points in civil 3D?
>
>
> John
>
> Private Sub CommandButton1_Click()
> hide
> If (GetBaseCivilObjects() = False) Then
> Exit Sub
> End If
>
> Dim oPoint As Variant
> Dim ssetObj As AcadSelectionSet
> Dim i As Integer
> Dim icount As Integer
>
> Dim ftype(0 To 3) As Integer
> Dim fdata(0 To 3) As Variant
> ftype(0) = -4: fdata(0) = " > ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
> ftype(2) = 0: fdata(2) = "INSERT"
> ftype(3) = -4: fdata(3) = "or>"
>
> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
> ssetObj.SelectOnScreen ftype, fdata
> MsgBox "count is " & ssetObj.Count & vbCrLf
>
> 'i is the number of items in the selection set of aec points
> For i = 0 To ssetObj.Count - 1
> Set oPoint = ssetObj.Item(i)
>
> On Error Resume Next
> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number &
> "
> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
> oPoint.Description
>
> Next i
> ssetObj.Delete
> UserForm1.Show
> End Sub
>
>
> 'module
> Function GetBaseCivilObjects() As Boolean
> Dim oApp As AcadApplication
> Set oApp = ThisDrawing.Application
> ' NOTE - Always specify the version number.
> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
> If (g_oCivilApp Is Nothing) Then
> MsgBox "Error creating " & sAppName & ", exit."
> GetBaseCivilObjects = False
> Exit Function
> End If
> Set g_oDocument = g_oCivilApp.ActiveDocument
> Set g_oAeccDatabase = g_oDocument.Database
> GetBaseCivilObjects = True
> End Function
>
Message 7 of 18
Anonymous
in reply to: Anonymous

I'm a little late, John, but here's my input. Since you are specifically
getting AeccPoints, you can dispense with the Item # and just use a For
Each...

Public Sub pointtest()
Dim oPoint As AeccPoint
Dim ssetObj As AcadSelectionSet
Dim ftype(0) As Integer
Dim fdata(0) As Variant

ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"

Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
ssetObj.SelectOnScreen ftype, fdata
MsgBox "count is " & ssetObj.Count & vbCrLf

For Each oPoint In ssetObj
ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
& _
" N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
oPoint.Elevation
Next
ssetObj.Delete
End Sub


"jcoon" wrote in message
news:6319691@discussion.autodesk.com...
> Laurie, Christopher
>
> Thank you for helping me with this point selection test. I'm trying to
> covert some old Land routines to C3D until I can eventually move these to
> dot net.
>
> Laurie, The reason for the test is to confirm that the approach path (
> highway) to a runway is clear of obstructions, that includes sampling 2-10
> miles of ground points, trees and any other objects like cell phone towers
> to that approach. Because of that I routinely need to sample over 100k of
> points against control surfaces to identify penetration to those surfaces.
>
> With the modified filter and changing the count to long I now get the
> expected results. Only thing remaining is to see if I can add a progress
> bar. I normally push the selection to the command line so the user can see
> that the routine has not halted becuase it takes a short amount of time to
> sample these points against the control surfaces. if the point is a
> penetration I collect the point number,
> northing,easting,elevation,description and what surface name it
> penetrates.
>
> Thanks for all your help.
> John
>
> "Laurie" wrote in message
> news:6319608@discussion.autodesk.com...
> Hi John,
>
> A couple of comments.
>
> Why are you selecting blocks as well as AEC Points?
>
> The filter command you need for AEC Points is:
> {code}
>
> Dim ftype(0) As Integer
> Dim fdata(0) As Variant
> ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"
>
> {code}
> I presume this is test code, but I simply can't picture why a drawing
> would have 100,000 points in it. Assuming they were regularly spaced at
> minimum spacing to suit the label display size and there was no other
> data you would need about 50 A1 drawing sheets just to plot them legibly
>
> {code}
> " Elev= " & oPoint.Description
> {code}
> seems a bit weird. I would have expected:
> {code}
> " Elev= " & oPoint.Elevation
> {code}
>
> In the posted code you do not use the Civil 3D objects oCivilApp,
> oDocument and oAeccDatabase
>
> The following still works
> {code}
>
> 'module
> Function GetBaseCivilObjects() As Boolean
> Dim oApp As AcadApplication
> Set oApp = ThisDrawing.Application
> ' NOTE - Always specify the version number.
> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
> ' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
> If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
> ' If (g_oCivilApp Is Nothing) Then
> MsgBox "Error creating Civil 3D environment, program will exit"
> GetBaseCivilObjects = False
> Exit Function
> End If
> ' Set g_oDocument = g_oCivilApp.ActiveDocument
> ' Set g_oAeccDatabase = g_oDocument.Database
> GetBaseCivilObjects = True
> End Function
>
> {code}
>
> For purposes of testing I put 10,000 points in a drawing and the code
> ran OK for me, taking about 3.7 seconds
>
> By redefining the filter, I was guaranteed not to include anything in
> the selection set but Civil 3D points, but for safety added:
>
> {code}
> If TypeOf oPoint Is AeccPoint Then
> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
> & " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
> oPoint.Elevation & vbCrLf
> End If
> {code}
>
> Curiously the code then ran about 2% faster even though it had to
> evaluate the If statement
>
> I tried redefining oPoint as an AeccPoint instead of a variant, - code
> ran marginally faster, perhaps 1%
>
>
>
> Regards,
>
>
> Laurie Comerford
> jcoon wrote:
>> Can anyone see why I'd get an overflow error selecting points. I've used
>> this same basic selection type in Land and never got and error when
>> selecting 100 thousand points.
>> how should I iterate thru points in civil 3D?
>>
>>
>> John
>>
>> Private Sub CommandButton1_Click()
>> hide
>> If (GetBaseCivilObjects() = False) Then
>> Exit Sub
>> End If
>>
>> Dim oPoint As Variant
>> Dim ssetObj As AcadSelectionSet
>> Dim i As Integer
>> Dim icount As Integer
>>
>> Dim ftype(0 To 3) As Integer
>> Dim fdata(0 To 3) As Variant
>> ftype(0) = -4: fdata(0) = " >> ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
>> ftype(2) = 0: fdata(2) = "INSERT"
>> ftype(3) = -4: fdata(3) = "or>"
>>
>> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
>> ssetObj.SelectOnScreen ftype, fdata
>> MsgBox "count is " & ssetObj.Count & vbCrLf
>>
>> 'i is the number of items in the selection set of aec points
>> For i = 0 To ssetObj.Count - 1
>> Set oPoint = ssetObj.Item(i)
>>
>> On Error Resume Next
>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number &
>> "
>> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>> oPoint.Description
>>
>> Next i
>> ssetObj.Delete
>> UserForm1.Show
>> End Sub
>>
>>
>> 'module
>> Function GetBaseCivilObjects() As Boolean
>> Dim oApp As AcadApplication
>> Set oApp = ThisDrawing.Application
>> ' NOTE - Always specify the version number.
>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>> If (g_oCivilApp Is Nothing) Then
>> MsgBox "Error creating " & sAppName & ", exit."
>> GetBaseCivilObjects = False
>> Exit Function
>> End If
>> Set g_oDocument = g_oCivilApp.ActiveDocument
>> Set g_oAeccDatabase = g_oDocument.Database
>> GetBaseCivilObjects = True
>> End Function
>>
Message 8 of 18
Anonymous
in reply to: Anonymous

Jeff,

Thanks for your input. Sample runs pretty fast. I like for each it appears
cleaner. I'm just getting back to civil 3d after a layoff because of
workload.

Have a great day
John



"Jeff Mishler" wrote in message
news:6319726@discussion.autodesk.com...
I'm a little late, John, but here's my input. Since you are specifically
getting AeccPoints, you can dispense with the Item # and just use a For
Each...

Public Sub pointtest()
Dim oPoint As AeccPoint
Dim ssetObj As AcadSelectionSet
Dim ftype(0) As Integer
Dim fdata(0) As Variant

ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"

Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
ssetObj.SelectOnScreen ftype, fdata
MsgBox "count is " & ssetObj.Count & vbCrLf

For Each oPoint In ssetObj
ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
& _
" N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
oPoint.Elevation
Next
ssetObj.Delete
End Sub


"jcoon" wrote in message
news:6319691@discussion.autodesk.com...
> Laurie, Christopher
>
> Thank you for helping me with this point selection test. I'm trying to
> covert some old Land routines to C3D until I can eventually move these to
> dot net.
>
> Laurie, The reason for the test is to confirm that the approach path (
> highway) to a runway is clear of obstructions, that includes sampling 2-10
> miles of ground points, trees and any other objects like cell phone towers
> to that approach. Because of that I routinely need to sample over 100k of
> points against control surfaces to identify penetration to those surfaces.
>
> With the modified filter and changing the count to long I now get the
> expected results. Only thing remaining is to see if I can add a progress
> bar. I normally push the selection to the command line so the user can see
> that the routine has not halted becuase it takes a short amount of time to
> sample these points against the control surfaces. if the point is a
> penetration I collect the point number,
> northing,easting,elevation,description and what surface name it
> penetrates.
>
> Thanks for all your help.
> John
>
> "Laurie" wrote in message
> news:6319608@discussion.autodesk.com...
> Hi John,
>
> A couple of comments.
>
> Why are you selecting blocks as well as AEC Points?
>
> The filter command you need for AEC Points is:
> {code}
>
> Dim ftype(0) As Integer
> Dim fdata(0) As Variant
> ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"
>
> {code}
> I presume this is test code, but I simply can't picture why a drawing
> would have 100,000 points in it. Assuming they were regularly spaced at
> minimum spacing to suit the label display size and there was no other
> data you would need about 50 A1 drawing sheets just to plot them legibly
>
> {code}
> " Elev= " & oPoint.Description
> {code}
> seems a bit weird. I would have expected:
> {code}
> " Elev= " & oPoint.Elevation
> {code}
>
> In the posted code you do not use the Civil 3D objects oCivilApp,
> oDocument and oAeccDatabase
>
> The following still works
> {code}
>
> 'module
> Function GetBaseCivilObjects() As Boolean
> Dim oApp As AcadApplication
> Set oApp = ThisDrawing.Application
> ' NOTE - Always specify the version number.
> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
> ' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
> If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
> ' If (g_oCivilApp Is Nothing) Then
> MsgBox "Error creating Civil 3D environment, program will exit"
> GetBaseCivilObjects = False
> Exit Function
> End If
> ' Set g_oDocument = g_oCivilApp.ActiveDocument
> ' Set g_oAeccDatabase = g_oDocument.Database
> GetBaseCivilObjects = True
> End Function
>
> {code}
>
> For purposes of testing I put 10,000 points in a drawing and the code
> ran OK for me, taking about 3.7 seconds
>
> By redefining the filter, I was guaranteed not to include anything in
> the selection set but Civil 3D points, but for safety added:
>
> {code}
> If TypeOf oPoint Is AeccPoint Then
> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
> & " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
> oPoint.Elevation & vbCrLf
> End If
> {code}
>
> Curiously the code then ran about 2% faster even though it had to
> evaluate the If statement
>
> I tried redefining oPoint as an AeccPoint instead of a variant, - code
> ran marginally faster, perhaps 1%
>
>
>
> Regards,
>
>
> Laurie Comerford
> jcoon wrote:
>> Can anyone see why I'd get an overflow error selecting points. I've used
>> this same basic selection type in Land and never got and error when
>> selecting 100 thousand points.
>> how should I iterate thru points in civil 3D?
>>
>>
>> John
>>
>> Private Sub CommandButton1_Click()
>> hide
>> If (GetBaseCivilObjects() = False) Then
>> Exit Sub
>> End If
>>
>> Dim oPoint As Variant
>> Dim ssetObj As AcadSelectionSet
>> Dim i As Integer
>> Dim icount As Integer
>>
>> Dim ftype(0 To 3) As Integer
>> Dim fdata(0 To 3) As Variant
>> ftype(0) = -4: fdata(0) = " >> ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
>> ftype(2) = 0: fdata(2) = "INSERT"
>> ftype(3) = -4: fdata(3) = "or>"
>>
>> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
>> ssetObj.SelectOnScreen ftype, fdata
>> MsgBox "count is " & ssetObj.Count & vbCrLf
>>
>> 'i is the number of items in the selection set of aec points
>> For i = 0 To ssetObj.Count - 1
>> Set oPoint = ssetObj.Item(i)
>>
>> On Error Resume Next
>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number &
>> "
>> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>> oPoint.Description
>>
>> Next i
>> ssetObj.Delete
>> UserForm1.Show
>> End Sub
>>
>>
>> 'module
>> Function GetBaseCivilObjects() As Boolean
>> Dim oApp As AcadApplication
>> Set oApp = ThisDrawing.Application
>> ' NOTE - Always specify the version number.
>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>> If (g_oCivilApp Is Nothing) Then
>> MsgBox "Error creating " & sAppName & ", exit."
>> GetBaseCivilObjects = False
>> Exit Function
>> End If
>> Set g_oDocument = g_oCivilApp.ActiveDocument
>> Set g_oAeccDatabase = g_oDocument.Database
>> GetBaseCivilObjects = True
>> End Function
>>
Message 9 of 18
Anonymous
in reply to: Anonymous

Hi John,

Surely virtually all of these points started off in an external file(s).

I would not put them in the drawing, but process the source files.

By having them in the drawing, you are creating an enormous useless
overhead. Surely you notice moving around and doing anything in the
drawing is slow.

Here's a couple of alternative approaches to your design analysis.

Allowing that points on tower tops etc in your surface model will create
"an envelope" in the surface by linking to the nearest ground points
this would lead to a conservative analysis method.

1 Build a surface model, then the surface model has can be used to
"Intersectwith" a set of flight path bounding polylines. (I guess you
have already used these polylines (or the logical equivalent) to build
the flight control surfaces - so the second method becomes much more
attractive.

Programming very simple as you only need a selection set of the
polylines and do an "intersectwith" for each polyline

2 Create a volume surface between the surface built from the points and
the flight control surfaces.

This would give an immediate and readily visible analysis.

Programming required "Nil"


Regards,


Laurie Comerford

jcoon wrote:
> Laurie, Christopher
>
> Thank you for helping me with this point selection test. I'm trying to
> covert some old Land routines to C3D until I can eventually move these to
> dot net.
>
> Laurie, The reason for the test is to confirm that the approach path (
> highway) to a runway is clear of obstructions, that includes sampling 2-10
> miles of ground points, trees and any other objects like cell phone towers
> to that approach. Because of that I routinely need to sample over 100k of
> points against control surfaces to identify penetration to those surfaces.
>
> With the modified filter and changing the count to long I now get the
> expected results. Only thing remaining is to see if I can add a progress
> bar. I normally push the selection to the command line so the user can see
> that the routine has not halted becuase it takes a short amount of time to
> sample these points against the control surfaces. if the point is a
> penetration I collect the point number,
> northing,easting,elevation,description and what surface name it penetrates.
>
> Thanks for all your help.
> John
>
> "Laurie" wrote in message
> news:6319608@discussion.autodesk.com...
> Hi John,
>
> A couple of comments.
>
> Why are you selecting blocks as well as AEC Points?
>
> The filter command you need for AEC Points is:
> {code}
>
> Dim ftype(0) As Integer
> Dim fdata(0) As Variant
> ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"
>
> {code}
> I presume this is test code, but I simply can't picture why a drawing
> would have 100,000 points in it. Assuming they were regularly spaced at
> minimum spacing to suit the label display size and there was no other
> data you would need about 50 A1 drawing sheets just to plot them legibly
>
> {code}
> " Elev= " & oPoint.Description
> {code}
> seems a bit weird. I would have expected:
> {code}
> " Elev= " & oPoint.Elevation
> {code}
>
> In the posted code you do not use the Civil 3D objects oCivilApp,
> oDocument and oAeccDatabase
>
> The following still works
> {code}
>
> 'module
> Function GetBaseCivilObjects() As Boolean
> Dim oApp As AcadApplication
> Set oApp = ThisDrawing.Application
> ' NOTE - Always specify the version number.
> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
> ' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
> If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
> ' If (g_oCivilApp Is Nothing) Then
> MsgBox "Error creating Civil 3D environment, program will exit"
> GetBaseCivilObjects = False
> Exit Function
> End If
> ' Set g_oDocument = g_oCivilApp.ActiveDocument
> ' Set g_oAeccDatabase = g_oDocument.Database
> GetBaseCivilObjects = True
> End Function
>
> {code}
>
> For purposes of testing I put 10,000 points in a drawing and the code
> ran OK for me, taking about 3.7 seconds
>
> By redefining the filter, I was guaranteed not to include anything in
> the selection set but Civil 3D points, but for safety added:
>
> {code}
> If TypeOf oPoint Is AeccPoint Then
> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
> & " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
> oPoint.Elevation & vbCrLf
> End If
> {code}
>
> Curiously the code then ran about 2% faster even though it had to
> evaluate the If statement
>
> I tried redefining oPoint as an AeccPoint instead of a variant, - code
> ran marginally faster, perhaps 1%
>
>
>
> Regards,
>
>
> Laurie Comerford
> jcoon wrote:
>
>> Can anyone see why I'd get an overflow error selecting points. I've used
>> this same basic selection type in Land and never got and error when
>> selecting 100 thousand points.
>> how should I iterate thru points in civil 3D?
>>
>>
>> John
>>
>> Private Sub CommandButton1_Click()
>> hide
>> If (GetBaseCivilObjects() = False) Then
>> Exit Sub
>> End If
>>
>> Dim oPoint As Variant
>> Dim ssetObj As AcadSelectionSet
>> Dim i As Integer
>> Dim icount As Integer
>>
>> Dim ftype(0 To 3) As Integer
>> Dim fdata(0 To 3) As Variant
>> ftype(0) = -4: fdata(0) = " >> ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
>> ftype(2) = 0: fdata(2) = "INSERT"
>> ftype(3) = -4: fdata(3) = "or>"
>>
>> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
>> ssetObj.SelectOnScreen ftype, fdata
>> MsgBox "count is " & ssetObj.Count & vbCrLf
>>
>> 'i is the number of items in the selection set of aec points
>> For i = 0 To ssetObj.Count - 1
>> Set oPoint = ssetObj.Item(i)
>>
>> On Error Resume Next
>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number &
>> "
>> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>> oPoint.Description
>>
>> Next i
>> ssetObj.Delete
>> UserForm1.Show
>> End Sub
>>
>>
>> 'module
>> Function GetBaseCivilObjects() As Boolean
>> Dim oApp As AcadApplication
>> Set oApp = ThisDrawing.Application
>> ' NOTE - Always specify the version number.
>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>> If (g_oCivilApp Is Nothing) Then
>> MsgBox "Error creating " & sAppName & ", exit."
>> GetBaseCivilObjects = False
>> Exit Function
>> End If
>> Set g_oDocument = g_oCivilApp.ActiveDocument
>> Set g_oAeccDatabase = g_oDocument.Database
>> GetBaseCivilObjects = True
>> End Function
>>
>>
Message 10 of 18
Anonymous
in reply to: Anonymous

Laurie,

The routines I have reads each point and sample a selected surface. It
determines if the point elevation is above the surface and if it is is
places a block, it also checks to see if the object is within ten feet of
the surface.
if the object is within ten feet below it places a different block. it also
writes out the station and offset of each tagged object.

Laurie, I normally get a drawing that contains AutoCAD points at elevation
or a text file with the northing, easting, elevation & desc. I convert the
AutoCAD points to aecpoints or I write the points into a drawing so I can
identify the objects later by the point number from the excel file output.
any ideas of how to do that from an external file. would I just read the
point number from the text file?

How would check the surface elevation from a text file?

Have a great day,
John

Set objSurf.name by selection onscreen or by listbox

Dim dblNorth As Double
Dim dblEast As Double
Dim dblElev As Double
Dim dblDesc As String
Dim dblInsPnt(3) As Double
Dim intInputFile As Integer
Open "C:\temp\pointsin.csv" For Output As 1# 'Open file for output

Do While Not EOF(intInputFile)
'read sequential, delimited values from the input file and store them as
Input #intInputFile, dblNorth, dblEast,dblElev, dblDesc

'the following lines store the insertion point obtained above in an
array
dblInsPnt(0) = dblNorth
dblInsPnt(1) = dblEast
dblInsPnt(2) = dblElev
dblInsPnt(3) = dblDesc

'get surface elevation at location from array obtained from text file

'check if above or withing ten feet of surface test
Loop







"Laurie" wrote in message
news:6319781@discussion.autodesk.com...
Hi John,

Surely virtually all of these points started off in an external file(s).

I would not put them in the drawing, but process the source files.

By having them in the drawing, you are creating an enormous useless
overhead. Surely you notice moving around and doing anything in the
drawing is slow.

Here's a couple of alternative approaches to your design analysis.

Allowing that points on tower tops etc in your surface model will create
"an envelope" in the surface by linking to the nearest ground points
this would lead to a conservative analysis method.

1 Build a surface model, then the surface model has can be used to
"Intersectwith" a set of flight path bounding polylines. (I guess you
have already used these polylines (or the logical equivalent) to build
the flight control surfaces - so the second method becomes much more
attractive.

Programming very simple as you only need a selection set of the
polylines and do an "intersectwith" for each polyline

2 Create a volume surface between the surface built from the points and
the flight control surfaces.

This would give an immediate and readily visible analysis.

Programming required "Nil"


Regards,


Laurie Comerford

jcoon wrote:
> Laurie, Christopher
>
> Thank you for helping me with this point selection test. I'm trying to
> covert some old Land routines to C3D until I can eventually move these to
> dot net.
>
> Laurie, The reason for the test is to confirm that the approach path (
> highway) to a runway is clear of obstructions, that includes sampling 2-10
> miles of ground points, trees and any other objects like cell phone towers
> to that approach. Because of that I routinely need to sample over 100k of
> points against control surfaces to identify penetration to those surfaces.
>
> With the modified filter and changing the count to long I now get the
> expected results. Only thing remaining is to see if I can add a progress
> bar. I normally push the selection to the command line so the user can see
> that the routine has not halted becuase it takes a short amount of time to
> sample these points against the control surfaces. if the point is a
> penetration I collect the point number,
> northing,easting,elevation,description and what surface name it
> penetrates.
>
> Thanks for all your help.
> John
>
> "Laurie" wrote in message
> news:6319608@discussion.autodesk.com...
> Hi John,
>
> A couple of comments.
>
> Why are you selecting blocks as well as AEC Points?
>
> The filter command you need for AEC Points is:
> {code}
>
> Dim ftype(0) As Integer
> Dim fdata(0) As Variant
> ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"
>
> {code}
> I presume this is test code, but I simply can't picture why a drawing
> would have 100,000 points in it. Assuming they were regularly spaced at
> minimum spacing to suit the label display size and there was no other
> data you would need about 50 A1 drawing sheets just to plot them legibly
>
> {code}
> " Elev= " & oPoint.Description
> {code}
> seems a bit weird. I would have expected:
> {code}
> " Elev= " & oPoint.Elevation
> {code}
>
> In the posted code you do not use the Civil 3D objects oCivilApp,
> oDocument and oAeccDatabase
>
> The following still works
> {code}
>
> 'module
> Function GetBaseCivilObjects() As Boolean
> Dim oApp As AcadApplication
> Set oApp = ThisDrawing.Application
> ' NOTE - Always specify the version number.
> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
> ' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
> If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
> ' If (g_oCivilApp Is Nothing) Then
> MsgBox "Error creating Civil 3D environment, program will exit"
> GetBaseCivilObjects = False
> Exit Function
> End If
> ' Set g_oDocument = g_oCivilApp.ActiveDocument
> ' Set g_oAeccDatabase = g_oDocument.Database
> GetBaseCivilObjects = True
> End Function
>
> {code}
>
> For purposes of testing I put 10,000 points in a drawing and the code
> ran OK for me, taking about 3.7 seconds
>
> By redefining the filter, I was guaranteed not to include anything in
> the selection set but Civil 3D points, but for safety added:
>
> {code}
> If TypeOf oPoint Is AeccPoint Then
> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
> & " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
> oPoint.Elevation & vbCrLf
> End If
> {code}
>
> Curiously the code then ran about 2% faster even though it had to
> evaluate the If statement
>
> I tried redefining oPoint as an AeccPoint instead of a variant, - code
> ran marginally faster, perhaps 1%
>
>
>
> Regards,
>
>
> Laurie Comerford
> jcoon wrote:
>
>> Can anyone see why I'd get an overflow error selecting points. I've used
>> this same basic selection type in Land and never got and error when
>> selecting 100 thousand points.
>> how should I iterate thru points in civil 3D?
>>
>>
>> John
>>
>> Private Sub CommandButton1_Click()
>> hide
>> If (GetBaseCivilObjects() = False) Then
>> Exit Sub
>> End If
>>
>> Dim oPoint As Variant
>> Dim ssetObj As AcadSelectionSet
>> Dim i As Integer
>> Dim icount As Integer
>>
>> Dim ftype(0 To 3) As Integer
>> Dim fdata(0 To 3) As Variant
>> ftype(0) = -4: fdata(0) = " >> ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
>> ftype(2) = 0: fdata(2) = "INSERT"
>> ftype(3) = -4: fdata(3) = "or>"
>>
>> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
>> ssetObj.SelectOnScreen ftype, fdata
>> MsgBox "count is " & ssetObj.Count & vbCrLf
>>
>> 'i is the number of items in the selection set of aec points
>> For i = 0 To ssetObj.Count - 1
>> Set oPoint = ssetObj.Item(i)
>>
>> On Error Resume Next
>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number &
>> "
>> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>> oPoint.Description
>>
>> Next i
>> ssetObj.Delete
>> UserForm1.Show
>> End Sub
>>
>>
>> 'module
>> Function GetBaseCivilObjects() As Boolean
>> Dim oApp As AcadApplication
>> Set oApp = ThisDrawing.Application
>> ' NOTE - Always specify the version number.
>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>> If (g_oCivilApp Is Nothing) Then
>> MsgBox "Error creating " & sAppName & ", exit."
>> GetBaseCivilObjects = False
>> Exit Function
>> End If
>> Set g_oDocument = g_oCivilApp.ActiveDocument
>> Set g_oAeccDatabase = g_oDocument.Database
>> GetBaseCivilObjects = True
>> End Function
>>
>>
Message 11 of 18
Anonymous
in reply to: Anonymous

Hi John,

I'm sort of tied up for the next couple of days, so won't have time to
think this through thoughoughly.

Could you send me a stripped down drawing containing a sample surface
model you use for the air craft clearance

Also a stripped down drawing as supplied to you containing AutoCAD
points and lastly a stripped down point file of the type you get from
the client.

I'll put something together to show possibilities.

laurie
dot
comerford
at
westnet
dot
com
dot
au

Regards,


Laurie Comerford
jcoon wrote:
> Laurie,
>
> The routines I have reads each point and sample a selected surface. It
> determines if the point elevation is above the surface and if it is is
> places a block, it also checks to see if the object is within ten feet of
> the surface.
> if the object is within ten feet below it places a different block. it also
> writes out the station and offset of each tagged object.
>
> Laurie, I normally get a drawing that contains AutoCAD points at elevation
> or a text file with the northing, easting, elevation & desc. I convert the
> AutoCAD points to aecpoints or I write the points into a drawing so I can
> identify the objects later by the point number from the excel file output.
> any ideas of how to do that from an external file. would I just read the
> point number from the text file?
>
> How would check the surface elevation from a text file?
>
> Have a great day,
> John
>
> Set objSurf.name by selection onscreen or by listbox
>
> Dim dblNorth As Double
> Dim dblEast As Double
> Dim dblElev As Double
> Dim dblDesc As String
> Dim dblInsPnt(3) As Double
> Dim intInputFile As Integer
> Open "C:\temp\pointsin.csv" For Output As 1# 'Open file for output
>
> Do While Not EOF(intInputFile)
> 'read sequential, delimited values from the input file and store them as
> Input #intInputFile, dblNorth, dblEast,dblElev, dblDesc
>
> 'the following lines store the insertion point obtained above in an
> array
> dblInsPnt(0) = dblNorth
> dblInsPnt(1) = dblEast
> dblInsPnt(2) = dblElev
> dblInsPnt(3) = dblDesc
>
> 'get surface elevation at location from array obtained from text file
>
> 'check if above or withing ten feet of surface test
> Loop
>
>
>
>
>
>
>
> "Laurie" wrote in message
> news:6319781@discussion.autodesk.com...
> Hi John,
>
> Surely virtually all of these points started off in an external file(s).
>
> I would not put them in the drawing, but process the source files.
>
> By having them in the drawing, you are creating an enormous useless
> overhead. Surely you notice moving around and doing anything in the
> drawing is slow.
>
> Here's a couple of alternative approaches to your design analysis.
>
> Allowing that points on tower tops etc in your surface model will create
> "an envelope" in the surface by linking to the nearest ground points
> this would lead to a conservative analysis method.
>
> 1 Build a surface model, then the surface model has can be used to
> "Intersectwith" a set of flight path bounding polylines. (I guess you
> have already used these polylines (or the logical equivalent) to build
> the flight control surfaces - so the second method becomes much more
> attractive.
>
> Programming very simple as you only need a selection set of the
> polylines and do an "intersectwith" for each polyline
>
> 2 Create a volume surface between the surface built from the points and
> the flight control surfaces.
>
> This would give an immediate and readily visible analysis.
>
> Programming required "Nil"
>
>
> Regards,
>
>
> Laurie Comerford
>
> jcoon wrote:
>
>> Laurie, Christopher
>>
>> Thank you for helping me with this point selection test. I'm trying to
>> covert some old Land routines to C3D until I can eventually move these to
>> dot net.
>>
>> Laurie, The reason for the test is to confirm that the approach path (
>> highway) to a runway is clear of obstructions, that includes sampling 2-10
>> miles of ground points, trees and any other objects like cell phone towers
>> to that approach. Because of that I routinely need to sample over 100k of
>> points against control surfaces to identify penetration to those surfaces..
>>
>> With the modified filter and changing the count to long I now get the
>> expected results. Only thing remaining is to see if I can add a progress
>> bar. I normally push the selection to the command line so the user can see
>> that the routine has not halted becuase it takes a short amount of time to
>> sample these points against the control surfaces. if the point is a
>> penetration I collect the point number,
>> northing,easting,elevation,description and what surface name it
>> penetrates.
>>
>> Thanks for all your help.
>> John
>>
>> "Laurie" wrote in message
>> news:6319608@discussion.autodesk.com...
>> Hi John,
>>
>> A couple of comments.
>>
>> Why are you selecting blocks as well as AEC Points?
>>
>> The filter command you need for AEC Points is:
>> {code}
>>
>> Dim ftype(0) As Integer
>> Dim fdata(0) As Variant
>> ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"
>>
>> {code}
>> I presume this is test code, but I simply can't picture why a drawing
>> would have 100,000 points in it. Assuming they were regularly spaced at
>> minimum spacing to suit the label display size and there was no other
>> data you would need about 50 A1 drawing sheets just to plot them legibly
>>
>> {code}
>> " Elev= " & oPoint.Description
>> {code}
>> seems a bit weird. I would have expected:
>> {code}
>> " Elev= " & oPoint.Elevation
>> {code}
>>
>> In the posted code you do not use the Civil 3D objects oCivilApp,
>> oDocument and oAeccDatabase
>>
>> The following still works
>> {code}
>>
>> 'module
>> Function GetBaseCivilObjects() As Boolean
>> Dim oApp As AcadApplication
>> Set oApp = ThisDrawing.Application
>> ' NOTE - Always specify the version number.
>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>> ' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>> If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
>> ' If (g_oCivilApp Is Nothing) Then
>> MsgBox "Error creating Civil 3D environment, program will exit"
>> GetBaseCivilObjects = False
>> Exit Function
>> End If
>> ' Set g_oDocument = g_oCivilApp.ActiveDocument
>> ' Set g_oAeccDatabase = g_oDocument.Database
>> GetBaseCivilObjects = True
>> End Function
>>
>> {code}
>>
>> For purposes of testing I put 10,000 points in a drawing and the code
>> ran OK for me, taking about 3.7 seconds
>>
>> By redefining the filter, I was guaranteed not to include anything in
>> the selection set but Civil 3D points, but for safety added:
>>
>> {code}
>> If TypeOf oPoint Is AeccPoint Then
>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
>> & " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>> oPoint.Elevation & vbCrLf
>> End If
>> {code}
>>
>> Curiously the code then ran about 2% faster even though it had to
>> evaluate the If statement
>>
>> I tried redefining oPoint as an AeccPoint instead of a variant, - code
>> ran marginally faster, perhaps 1%
>>
>>
>>
>> Regards,
>>
>>
>> Laurie Comerford
>> jcoon wrote:
>>
>>
>>> Can anyone see why I'd get an overflow error selecting points. I've used
>>> this same basic selection type in Land and never got and error when
>>> selecting 100 thousand points.
>>> how should I iterate thru points in civil 3D?
>>>
>>>
>>> John
>>>
>>> Private Sub CommandButton1_Click()
>>> hide
>>> If (GetBaseCivilObjects() = False) Then
>>> Exit Sub
>>> End If
>>>
>>> Dim oPoint As Variant
>>> Dim ssetObj As AcadSelectionSet
>>> Dim i As Integer
>>> Dim icount As Integer
>>>
>>> Dim ftype(0 To 3) As Integer
>>> Dim fdata(0 To 3) As Variant
>>> ftype(0) = -4: fdata(0) = " >>> ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
>>> ftype(2) = 0: fdata(2) = "INSERT"
>>> ftype(3) = -4: fdata(3) = "or>"
>>>
>>> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
>>> ssetObj.SelectOnScreen ftype, fdata
>>> MsgBox "count is " & ssetObj.Count & vbCrLf
>>>
>>> 'i is the number of items in the selection set of aec points
>>> For i = 0 To ssetObj.Count - 1
>>> Set oPoint = ssetObj.Item(i)
>>>
>>> On Error Resume Next
>>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number &
>>> "
>>> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>>> oPoint.Description
>>>
>>> Next i
>>> ssetObj.Delete
>>> UserForm1.Show
>>> End Sub
>>>
>>>
>>> 'module
>>> Function GetBaseCivilObjects() As Boolean
>>> Dim oApp As AcadApplication
>>> Set oApp = ThisDrawing.Application
>>> ' NOTE - Always specify the version number.
>>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>>> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>>> If (g_oCivilApp Is Nothing) Then
>>> MsgBox "Error creating " & sAppName & ", exit."
>>> GetBaseCivilObjects = False
>>> Exit Function
>>> End If
>>> Set g_oDocument = g_oCivilApp.ActiveDocument
>>> Set g_oAeccDatabase = g_oDocument.Database
>>> GetBaseCivilObjects = True
>>> End Function
>>>
>>>
>>>
Message 12 of 18
Civil3DReminders_com
in reply to: Anonymous

Here's how to find the elevation at a point.
{code}
Dim dElev As Double
dElev = objSurf.FindElevationAtXY(dblEast, dblNorth)
{code}
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 13 of 18
Anonymous
in reply to: Anonymous

Christopher,

So in Civil 3D I'd change my old Land

'gets Surf elevation
dblelev = objSurf.GetElevation(objPoint.EASTING, objPoint.NORTHING)
to
dElev = objSurf.FindElevationAtXY(dblEast, dblNorth)

'Gets alignmant station offsert values
Old land
objAlign.StationOffset objPoint.EASTING, objPoint.NORTHING, dblSta, dblOff,
dblDir

to
'Get or set site, style and then get alignment by name or select onscreen
have not done this yet but I have some sample code from your vbook
to try tonight

Dim oSites As AeccSites
Dim oSite As AeccSite
Dim oAlignments As AeccAlignments
Dim oAlignment As AeccAlignment
Dim oAlignStyle As AeccAlignmentStyle
Dim sName As String
sName = oAlignment.Name

get station value from current alignment at dblEast, dblNorth

Thanks for the help.

John




wrote in message
news:6320702@discussion.autodesk.com...
Here's how to find the elevation at a point.
{code}
Dim dElev As Double
dElev = objSurf.FindElevationAtXY(dblEast, dblNorth)
{code}
Message 14 of 18
Civil3DReminders_com
in reply to: Anonymous

That sounds about right.
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 15 of 18
Anonymous
in reply to: Anonymous

Laurie

what e-mail do I use? zip is about 2 meg

john

"Laurie" wrote in message
news:6320480@discussion.autodesk.com...
Hi John,

I'm sort of tied up for the next couple of days, so won't have time to
think this through thoughoughly.

Could you send me a stripped down drawing containing a sample surface
model you use for the air craft clearance

Also a stripped down drawing as supplied to you containing AutoCAD
points and lastly a stripped down point file of the type you get from
the client.

I'll put something together to show possibilities.

laurie
dot
comerford
at
westnet
dot
com
dot
au

Regards,


Laurie Comerford
jcoon wrote:
> Laurie,
>
> The routines I have reads each point and sample a selected surface. It
> determines if the point elevation is above the surface and if it is is
> places a block, it also checks to see if the object is within ten feet of
> the surface.
> if the object is within ten feet below it places a different block. it
> also
> writes out the station and offset of each tagged object.
>
> Laurie, I normally get a drawing that contains AutoCAD points at elevation
> or a text file with the northing, easting, elevation & desc. I convert the
> AutoCAD points to aecpoints or I write the points into a drawing so I can
> identify the objects later by the point number from the excel file output.
> any ideas of how to do that from an external file. would I just read the
> point number from the text file?
>
> How would check the surface elevation from a text file?
>
> Have a great day,
> John
>
> Set objSurf.name by selection onscreen or by listbox
>
> Dim dblNorth As Double
> Dim dblEast As Double
> Dim dblElev As Double
> Dim dblDesc As String
> Dim dblInsPnt(3) As Double
> Dim intInputFile As Integer
> Open "C:\temp\pointsin.csv" For Output As 1# 'Open file for output
>
> Do While Not EOF(intInputFile)
> 'read sequential, delimited values from the input file and store them
> as
> Input #intInputFile, dblNorth, dblEast,dblElev, dblDesc
>
> 'the following lines store the insertion point obtained above in an
> array
> dblInsPnt(0) = dblNorth
> dblInsPnt(1) = dblEast
> dblInsPnt(2) = dblElev
> dblInsPnt(3) = dblDesc
>
> 'get surface elevation at location from array obtained from text file
>
> 'check if above or withing ten feet of surface test
> Loop
>
>
>
>
>
>
>
> "Laurie" wrote in message
> news:6319781@discussion.autodesk.com...
> Hi John,
>
> Surely virtually all of these points started off in an external file(s).
>
> I would not put them in the drawing, but process the source files.
>
> By having them in the drawing, you are creating an enormous useless
> overhead. Surely you notice moving around and doing anything in the
> drawing is slow.
>
> Here's a couple of alternative approaches to your design analysis.
>
> Allowing that points on tower tops etc in your surface model will create
> "an envelope" in the surface by linking to the nearest ground points
> this would lead to a conservative analysis method.
>
> 1 Build a surface model, then the surface model has can be used to
> "Intersectwith" a set of flight path bounding polylines. (I guess you
> have already used these polylines (or the logical equivalent) to build
> the flight control surfaces - so the second method becomes much more
> attractive.
>
> Programming very simple as you only need a selection set of the
> polylines and do an "intersectwith" for each polyline
>
> 2 Create a volume surface between the surface built from the points and
> the flight control surfaces.
>
> This would give an immediate and readily visible analysis.
>
> Programming required "Nil"
>
>
> Regards,
>
>
> Laurie Comerford
>
> jcoon wrote:
>
>> Laurie, Christopher
>>
>> Thank you for helping me with this point selection test. I'm trying to
>> covert some old Land routines to C3D until I can eventually move these to
>> dot net.
>>
>> Laurie, The reason for the test is to confirm that the approach path (
>> highway) to a runway is clear of obstructions, that includes sampling
>> 2-10
>> miles of ground points, trees and any other objects like cell phone
>> towers
>> to that approach. Because of that I routinely need to sample over 100k of
>> points against control surfaces to identify penetration to those
>> surfaces..
>>
>> With the modified filter and changing the count to long I now get the
>> expected results. Only thing remaining is to see if I can add a progress
>> bar. I normally push the selection to the command line so the user can
>> see
>> that the routine has not halted becuase it takes a short amount of time
>> to
>> sample these points against the control surfaces. if the point is a
>> penetration I collect the point number,
>> northing,easting,elevation,description and what surface name it
>> penetrates.
>>
>> Thanks for all your help.
>> John
>>
>> "Laurie" wrote in message
>> news:6319608@discussion.autodesk.com...
>> Hi John,
>>
>> A couple of comments.
>>
>> Why are you selecting blocks as well as AEC Points?
>>
>> The filter command you need for AEC Points is:
>> {code}
>>
>> Dim ftype(0) As Integer
>> Dim fdata(0) As Variant
>> ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"
>>
>> {code}
>> I presume this is test code, but I simply can't picture why a drawing
>> would have 100,000 points in it. Assuming they were regularly spaced at
>> minimum spacing to suit the label display size and there was no other
>> data you would need about 50 A1 drawing sheets just to plot them legibly
>>
>> {code}
>> " Elev= " & oPoint.Description
>> {code}
>> seems a bit weird. I would have expected:
>> {code}
>> " Elev= " & oPoint.Elevation
>> {code}
>>
>> In the posted code you do not use the Civil 3D objects oCivilApp,
>> oDocument and oAeccDatabase
>>
>> The following still works
>> {code}
>>
>> 'module
>> Function GetBaseCivilObjects() As Boolean
>> Dim oApp As AcadApplication
>> Set oApp = ThisDrawing.Application
>> ' NOTE - Always specify the version number.
>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>> ' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>> If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
>> ' If (g_oCivilApp Is Nothing) Then
>> MsgBox "Error creating Civil 3D environment, program will exit"
>> GetBaseCivilObjects = False
>> Exit Function
>> End If
>> ' Set g_oDocument = g_oCivilApp.ActiveDocument
>> ' Set g_oAeccDatabase = g_oDocument.Database
>> GetBaseCivilObjects = True
>> End Function
>>
>> {code}
>>
>> For purposes of testing I put 10,000 points in a drawing and the code
>> ran OK for me, taking about 3.7 seconds
>>
>> By redefining the filter, I was guaranteed not to include anything in
>> the selection set but Civil 3D points, but for safety added:
>>
>> {code}
>> If TypeOf oPoint Is AeccPoint Then
>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
>> & " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>> oPoint.Elevation & vbCrLf
>> End If
>> {code}
>>
>> Curiously the code then ran about 2% faster even though it had to
>> evaluate the If statement
>>
>> I tried redefining oPoint as an AeccPoint instead of a variant, - code
>> ran marginally faster, perhaps 1%
>>
>>
>>
>> Regards,
>>
>>
>> Laurie Comerford
>> jcoon wrote:
>>
>>
>>> Can anyone see why I'd get an overflow error selecting points. I've used
>>> this same basic selection type in Land and never got and error when
>>> selecting 100 thousand points.
>>> how should I iterate thru points in civil 3D?
>>>
>>>
>>> John
>>>
>>> Private Sub CommandButton1_Click()
>>> hide
>>> If (GetBaseCivilObjects() = False) Then
>>> Exit Sub
>>> End If
>>>
>>> Dim oPoint As Variant
>>> Dim ssetObj As AcadSelectionSet
>>> Dim i As Integer
>>> Dim icount As Integer
>>>
>>> Dim ftype(0 To 3) As Integer
>>> Dim fdata(0 To 3) As Variant
>>> ftype(0) = -4: fdata(0) = " >>> ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
>>> ftype(2) = 0: fdata(2) = "INSERT"
>>> ftype(3) = -4: fdata(3) = "or>"
>>>
>>> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
>>> ssetObj.SelectOnScreen ftype, fdata
>>> MsgBox "count is " & ssetObj.Count & vbCrLf
>>>
>>> 'i is the number of items in the selection set of aec points
>>> For i = 0 To ssetObj.Count - 1
>>> Set oPoint = ssetObj.Item(i)
>>>
>>> On Error Resume Next
>>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
>>> &
>>> "
>>> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>>> oPoint.Description
>>>
>>> Next i
>>> ssetObj.Delete
>>> UserForm1.Show
>>> End Sub
>>>
>>>
>>> 'module
>>> Function GetBaseCivilObjects() As Boolean
>>> Dim oApp As AcadApplication
>>> Set oApp = ThisDrawing.Application
>>> ' NOTE - Always specify the version number.
>>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>>> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>>> If (g_oCivilApp Is Nothing) Then
>>> MsgBox "Error creating " & sAppName & ", exit."
>>> GetBaseCivilObjects = False
>>> Exit Function
>>> End If
>>> Set g_oDocument = g_oCivilApp.ActiveDocument
>>> Set g_oAeccDatabase = g_oDocument.Database
>>> GetBaseCivilObjects = True
>>> End Function
>>>
>>>
>>>
Message 16 of 18
Anonymous
in reply to: Anonymous

Hi John,

Assemble the one I put in the post into the correct format. Due to spam
issues I'm not prepared to post a directly usable Email address here.

2Mb on a direct email is not an issue.


Regards,


Laurie Comerford

jcoon wrote:
> Laurie
>
> what e-mail do I use? zip is about 2 meg
>
> john
>
> "Laurie" wrote in message
> news:6320480@discussion.autodesk.com...
> Hi John,
>
> I'm sort of tied up for the next couple of days, so won't have time to
> think this through thoughoughly.
>
> Could you send me a stripped down drawing containing a sample surface
> model you use for the air craft clearance
>
> Also a stripped down drawing as supplied to you containing AutoCAD
> points and lastly a stripped down point file of the type you get from
> the client.
>
> I'll put something together to show possibilities.
>
> laurie
> dot
> comerford
> at
> westnet
> dot
> com
> dot
> au
>
> Regards,
>
>
> Laurie Comerford
> jcoon wrote:
>
>> Laurie,
>>
>> The routines I have reads each point and sample a selected surface. It
>> determines if the point elevation is above the surface and if it is is
>> places a block, it also checks to see if the object is within ten feet of
>> the surface.
>> if the object is within ten feet below it places a different block. it
>> also
>> writes out the station and offset of each tagged object.
>>
>> Laurie, I normally get a drawing that contains AutoCAD points at elevation
>> or a text file with the northing, easting, elevation & desc. I convert the
>> AutoCAD points to aecpoints or I write the points into a drawing so I can
>> identify the objects later by the point number from the excel file output..
>> any ideas of how to do that from an external file. would I just read the
>> point number from the text file?
>>
>> How would check the surface elevation from a text file?
>>
>> Have a great day,
>> John
>>
>> Set objSurf.name by selection onscreen or by listbox
>>
>> Dim dblNorth As Double
>> Dim dblEast As Double
>> Dim dblElev As Double
>> Dim dblDesc As String
>> Dim dblInsPnt(3) As Double
>> Dim intInputFile As Integer
>> Open "C:\temp\pointsin.csv" For Output As 1# 'Open file for output
>>
>> Do While Not EOF(intInputFile)
>> 'read sequential, delimited values from the input file and store them
>> as
>> Input #intInputFile, dblNorth, dblEast,dblElev, dblDesc
>>
>> 'the following lines store the insertion point obtained above in an
>> array
>> dblInsPnt(0) = dblNorth
>> dblInsPnt(1) = dblEast
>> dblInsPnt(2) = dblElev
>> dblInsPnt(3) = dblDesc
>>
>> 'get surface elevation at location from array obtained from text file
>>
>> 'check if above or withing ten feet of surface test
>> Loop
>>
>>
>>
>>
>>
>>
>>
>> "Laurie" wrote in message
>> news:6319781@discussion.autodesk.com...
>> Hi John,
>>
>> Surely virtually all of these points started off in an external file(s).
>>
>> I would not put them in the drawing, but process the source files.
>>
>> By having them in the drawing, you are creating an enormous useless
>> overhead. Surely you notice moving around and doing anything in the
>> drawing is slow.
>>
>> Here's a couple of alternative approaches to your design analysis.
>>
>> Allowing that points on tower tops etc in your surface model will create
>> "an envelope" in the surface by linking to the nearest ground points
>> this would lead to a conservative analysis method.
>>
>> 1 Build a surface model, then the surface model has can be used to
>> "Intersectwith" a set of flight path bounding polylines. (I guess you
>> have already used these polylines (or the logical equivalent) to build
>> the flight control surfaces - so the second method becomes much more
>> attractive.
>>
>> Programming very simple as you only need a selection set of the
>> polylines and do an "intersectwith" for each polyline
>>
>> 2 Create a volume surface between the surface built from the points and
>> the flight control surfaces.
>>
>> This would give an immediate and readily visible analysis.
>>
>> Programming required "Nil"
>>
>>
>> Regards,
>>
>>
>> Laurie Comerford
>>
>> jcoon wrote:
>>
>>
>>> Laurie, Christopher
>>>
>>> Thank you for helping me with this point selection test. I'm trying to
>>> covert some old Land routines to C3D until I can eventually move these to
>>> dot net.
>>>
>>> Laurie, The reason for the test is to confirm that the approach path (
>>> highway) to a runway is clear of obstructions, that includes sampling
>>> 2-10
>>> miles of ground points, trees and any other objects like cell phone
>>> towers
>>> to that approach. Because of that I routinely need to sample over 100k of
>>> points against control surfaces to identify penetration to those
>>> surfaces..
>>>
>>> With the modified filter and changing the count to long I now get the
>>> expected results. Only thing remaining is to see if I can add a progress
>>> bar. I normally push the selection to the command line so the user can
>>> see
>>> that the routine has not halted becuase it takes a short amount of time
>>> to
>>> sample these points against the control surfaces. if the point is a
>>> penetration I collect the point number,
>>> northing,easting,elevation,description and what surface name it
>>> penetrates.
>>>
>>> Thanks for all your help.
>>> John
>>>
>>> "Laurie" wrote in message
>>> news:6319608@discussion.autodesk.com...
>>> Hi John,
>>>
>>> A couple of comments.
>>>
>>> Why are you selecting blocks as well as AEC Points?
>>>
>>> The filter command you need for AEC Points is:
>>> {code}
>>>
>>> Dim ftype(0) As Integer
>>> Dim fdata(0) As Variant
>>> ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"
>>>
>>> {code}
>>> I presume this is test code, but I simply can't picture why a drawing
>>> would have 100,000 points in it. Assuming they were regularly spaced at
>>> minimum spacing to suit the label display size and there was no other
>>> data you would need about 50 A1 drawing sheets just to plot them legibly
>>>
>>> {code}
>>> " Elev= " & oPoint.Description
>>> {code}
>>> seems a bit weird. I would have expected:
>>> {code}
>>> " Elev= " & oPoint.Elevation
>>> {code}
>>>
>>> In the posted code you do not use the Civil 3D objects oCivilApp,
>>> oDocument and oAeccDatabase
>>>
>>> The following still works
>>> {code}
>>>
>>> 'module
>>> Function GetBaseCivilObjects() As Boolean
>>> Dim oApp As AcadApplication
>>> Set oApp = ThisDrawing.Application
>>> ' NOTE - Always specify the version number.
>>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>>> ' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>>> If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
>>> ' If (g_oCivilApp Is Nothing) Then
>>> MsgBox "Error creating Civil 3D environment, program will exit"
>>> GetBaseCivilObjects = False
>>> Exit Function
>>> End If
>>> ' Set g_oDocument = g_oCivilApp.ActiveDocument
>>> ' Set g_oAeccDatabase = g_oDocument.Database
>>> GetBaseCivilObjects = True
>>> End Function
>>>
>>> {code}
>>>
>>> For purposes of testing I put 10,000 points in a drawing and the code
>>> ran OK for me, taking about 3.7 seconds
>>>
>>> By redefining the filter, I was guaranteed not to include anything in
>>> the selection set but Civil 3D points, but for safety added:
>>>
>>> {code}
>>> If TypeOf oPoint Is AeccPoint Then
>>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
>>> & " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>>> oPoint.Elevation & vbCrLf
>>> End If
>>> {code}
>>>
>>> Curiously the code then ran about 2% faster even though it had to
>>> evaluate the If statement
>>>
>>> I tried redefining oPoint as an AeccPoint instead of a variant, - code
>>> ran marginally faster, perhaps 1%
>>>
>>>
>>>
>>> Regards,
>>>
>>>
>>> Laurie Comerford
>>> jcoon wrote:
>>>
>>>
>>>
>>>> Can anyone see why I'd get an overflow error selecting points. I've used
>>>> this same basic selection type in Land and never got and error when
>>>> selecting 100 thousand points.
>>>> how should I iterate thru points in civil 3D?
>>>>
>>>>
>>>> John
>>>>
>>>> Private Sub CommandButton1_Click()
>>>> hide
>>>> If (GetBaseCivilObjects() = False) Then
>>>> Exit Sub
>>>> End If
>>>>
>>>> Dim oPoint As Variant
>>>> Dim ssetObj As AcadSelectionSet
>>>> Dim i As Integer
>>>> Dim icount As Integer
>>>>
>>>> Dim ftype(0 To 3) As Integer
>>>> Dim fdata(0 To 3) As Variant
>>>> ftype(0) = -4: fdata(0) = " >>>> ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
>>>> ftype(2) = 0: fdata(2) = "INSERT"
>>>> ftype(3) = -4: fdata(3) = "or>"
>>>>
>>>> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
>>>> ssetObj.SelectOnScreen ftype, fdata
>>>> MsgBox "count is " & ssetObj.Count & vbCrLf
>>>>
>>>> 'i is the number of items in the selection set of aec points
>>>> For i = 0 To ssetObj.Count - 1
>>>> Set oPoint = ssetObj.Item(i)
>>>>
>>>> On Error Resume Next
>>>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
>>>> &
>>>> "
>>>> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>>>> oPoint.Description
>>>>
>>>> Next i
>>>> ssetObj.Delete
>>>> UserForm1.Show
>>>> End Sub
>>>>
>>>>
>>>> 'module
>>>> Function GetBaseCivilObjects() As Boolean
>>>> Dim oApp As AcadApplication
>>>> Set oApp = ThisDrawing.Application
>>>> ' NOTE - Always specify the version number.
>>>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>>>> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>>>> If (g_oCivilApp Is Nothing) Then
>>>> MsgBox "Error creating " & sAppName & ", exit."
>>>> GetBaseCivilObjects = False
>>>> Exit Function
>>>> End If
>>>> Set g_oDocument = g_oCivilApp.ActiveDocument
>>>> Set g_oAeccDatabase = g_oDocument.Database
>>>> GetBaseCivilObjects = True
>>>> End Function
>>>>
>>>>
>>>>
>>>>
Message 17 of 18
Anonymous
in reply to: Anonymous

Laurie
what e-mail should I use?
zip file is about 2 meg

john
"Laurie" wrote in message
news:6321937@discussion.autodesk.com...
Hi John,

Assemble the one I put in the post into the correct format. Due to spam
issues I'm not prepared to post a directly usable Email address here.

2Mb on a direct email is not an issue.


Regards,


Laurie Comerford

jcoon wrote:
> Laurie
>
> what e-mail do I use? zip is about 2 meg
>
> john
>
> "Laurie" wrote in message
> news:6320480@discussion.autodesk.com...
> Hi John,
>
> I'm sort of tied up for the next couple of days, so won't have time to
> think this through thoughoughly.
>
> Could you send me a stripped down drawing containing a sample surface
> model you use for the air craft clearance
>
> Also a stripped down drawing as supplied to you containing AutoCAD
> points and lastly a stripped down point file of the type you get from
> the client.
>
> I'll put something together to show possibilities.
>
> laurie
> dot
> comerford
> at
> westnet
> dot
> com
> dot
> au
>
> Regards,
>
>
> Laurie Comerford
> jcoon wrote:
>
>> Laurie,
>>
>> The routines I have reads each point and sample a selected surface. It
>> determines if the point elevation is above the surface and if it is is
>> places a block, it also checks to see if the object is within ten feet of
>> the surface.
>> if the object is within ten feet below it places a different block. it
>> also
>> writes out the station and offset of each tagged object.
>>
>> Laurie, I normally get a drawing that contains AutoCAD points at
>> elevation
>> or a text file with the northing, easting, elevation & desc. I convert
>> the
>> AutoCAD points to aecpoints or I write the points into a drawing so I can
>> identify the objects later by the point number from the excel file
>> output..
>> any ideas of how to do that from an external file. would I just read the
>> point number from the text file?
>>
>> How would check the surface elevation from a text file?
>>
>> Have a great day,
>> John
>>
>> Set objSurf.name by selection onscreen or by listbox
>>
>> Dim dblNorth As Double
>> Dim dblEast As Double
>> Dim dblElev As Double
>> Dim dblDesc As String
>> Dim dblInsPnt(3) As Double
>> Dim intInputFile As Integer
>> Open "C:\temp\pointsin.csv" For Output As 1# 'Open file for output
>>
>> Do While Not EOF(intInputFile)
>> 'read sequential, delimited values from the input file and store them
>> as
>> Input #intInputFile, dblNorth, dblEast,dblElev, dblDesc
>>
>> 'the following lines store the insertion point obtained above in an
>> array
>> dblInsPnt(0) = dblNorth
>> dblInsPnt(1) = dblEast
>> dblInsPnt(2) = dblElev
>> dblInsPnt(3) = dblDesc
>>
>> 'get surface elevation at location from array obtained from text file
>>
>> 'check if above or withing ten feet of surface test
>> Loop
>>
>>
>>
>>
>>
>>
>>
>> "Laurie" wrote in message
>> news:6319781@discussion.autodesk.com...
>> Hi John,
>>
>> Surely virtually all of these points started off in an external file(s).
>>
>> I would not put them in the drawing, but process the source files.
>>
>> By having them in the drawing, you are creating an enormous useless
>> overhead. Surely you notice moving around and doing anything in the
>> drawing is slow.
>>
>> Here's a couple of alternative approaches to your design analysis.
>>
>> Allowing that points on tower tops etc in your surface model will create
>> "an envelope" in the surface by linking to the nearest ground points
>> this would lead to a conservative analysis method.
>>
>> 1 Build a surface model, then the surface model has can be used to
>> "Intersectwith" a set of flight path bounding polylines. (I guess you
>> have already used these polylines (or the logical equivalent) to build
>> the flight control surfaces - so the second method becomes much more
>> attractive.
>>
>> Programming very simple as you only need a selection set of the
>> polylines and do an "intersectwith" for each polyline
>>
>> 2 Create a volume surface between the surface built from the points and
>> the flight control surfaces.
>>
>> This would give an immediate and readily visible analysis.
>>
>> Programming required "Nil"
>>
>>
>> Regards,
>>
>>
>> Laurie Comerford
>>
>> jcoon wrote:
>>
>>
>>> Laurie, Christopher
>>>
>>> Thank you for helping me with this point selection test. I'm trying to
>>> covert some old Land routines to C3D until I can eventually move these
>>> to
>>> dot net.
>>>
>>> Laurie, The reason for the test is to confirm that the approach path (
>>> highway) to a runway is clear of obstructions, that includes sampling
>>> 2-10
>>> miles of ground points, trees and any other objects like cell phone
>>> towers
>>> to that approach. Because of that I routinely need to sample over 100k
>>> of
>>> points against control surfaces to identify penetration to those
>>> surfaces..
>>>
>>> With the modified filter and changing the count to long I now get the
>>> expected results. Only thing remaining is to see if I can add a progress
>>> bar. I normally push the selection to the command line so the user can
>>> see
>>> that the routine has not halted becuase it takes a short amount of time
>>> to
>>> sample these points against the control surfaces. if the point is a
>>> penetration I collect the point number,
>>> northing,easting,elevation,description and what surface name it
>>> penetrates.
>>>
>>> Thanks for all your help.
>>> John
>>>
>>> "Laurie" wrote in message
>>> news:6319608@discussion.autodesk.com...
>>> Hi John,
>>>
>>> A couple of comments.
>>>
>>> Why are you selecting blocks as well as AEC Points?
>>>
>>> The filter command you need for AEC Points is:
>>> {code}
>>>
>>> Dim ftype(0) As Integer
>>> Dim fdata(0) As Variant
>>> ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"
>>>
>>> {code}
>>> I presume this is test code, but I simply can't picture why a drawing
>>> would have 100,000 points in it. Assuming they were regularly spaced at
>>> minimum spacing to suit the label display size and there was no other
>>> data you would need about 50 A1 drawing sheets just to plot them legibly
>>>
>>> {code}
>>> " Elev= " & oPoint.Description
>>> {code}
>>> seems a bit weird. I would have expected:
>>> {code}
>>> " Elev= " & oPoint.Elevation
>>> {code}
>>>
>>> In the posted code you do not use the Civil 3D objects oCivilApp,
>>> oDocument and oAeccDatabase
>>>
>>> The following still works
>>> {code}
>>>
>>> 'module
>>> Function GetBaseCivilObjects() As Boolean
>>> Dim oApp As AcadApplication
>>> Set oApp = ThisDrawing.Application
>>> ' NOTE - Always specify the version number.
>>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>>> ' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>>> If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
>>> ' If (g_oCivilApp Is Nothing) Then
>>> MsgBox "Error creating Civil 3D environment, program will exit"
>>> GetBaseCivilObjects = False
>>> Exit Function
>>> End If
>>> ' Set g_oDocument = g_oCivilApp.ActiveDocument
>>> ' Set g_oAeccDatabase = g_oDocument.Database
>>> GetBaseCivilObjects = True
>>> End Function
>>>
>>> {code}
>>>
>>> For purposes of testing I put 10,000 points in a drawing and the code
>>> ran OK for me, taking about 3.7 seconds
>>>
>>> By redefining the filter, I was guaranteed not to include anything in
>>> the selection set but Civil 3D points, but for safety added:
>>>
>>> {code}
>>> If TypeOf oPoint Is AeccPoint Then
>>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
>>> & " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>>> oPoint.Elevation & vbCrLf
>>> End If
>>> {code}
>>>
>>> Curiously the code then ran about 2% faster even though it had to
>>> evaluate the If statement
>>>
>>> I tried redefining oPoint as an AeccPoint instead of a variant, - code
>>> ran marginally faster, perhaps 1%
>>>
>>>
>>>
>>> Regards,
>>>
>>>
>>> Laurie Comerford
>>> jcoon wrote:
>>>
>>>
>>>
>>>> Can anyone see why I'd get an overflow error selecting points. I've
>>>> used
>>>> this same basic selection type in Land and never got and error when
>>>> selecting 100 thousand points.
>>>> how should I iterate thru points in civil 3D?
>>>>
>>>>
>>>> John
>>>>
>>>> Private Sub CommandButton1_Click()
>>>> hide
>>>> If (GetBaseCivilObjects() = False) Then
>>>> Exit Sub
>>>> End If
>>>>
>>>> Dim oPoint As Variant
>>>> Dim ssetObj As AcadSelectionSet
>>>> Dim i As Integer
>>>> Dim icount As Integer
>>>>
>>>> Dim ftype(0 To 3) As Integer
>>>> Dim fdata(0 To 3) As Variant
>>>> ftype(0) = -4: fdata(0) = " >>>> ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
>>>> ftype(2) = 0: fdata(2) = "INSERT"
>>>> ftype(3) = -4: fdata(3) = "or>"
>>>>
>>>> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
>>>> ssetObj.SelectOnScreen ftype, fdata
>>>> MsgBox "count is " & ssetObj.Count & vbCrLf
>>>>
>>>> 'i is the number of items in the selection set of aec points
>>>> For i = 0 To ssetObj.Count - 1
>>>> Set oPoint = ssetObj.Item(i)
>>>>
>>>> On Error Resume Next
>>>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
>>>> &
>>>> "
>>>> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>>>> oPoint.Description
>>>>
>>>> Next i
>>>> ssetObj.Delete
>>>> UserForm1.Show
>>>> End Sub
>>>>
>>>>
>>>> 'module
>>>> Function GetBaseCivilObjects() As Boolean
>>>> Dim oApp As AcadApplication
>>>> Set oApp = ThisDrawing.Application
>>>> ' NOTE - Always specify the version number.
>>>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>>>> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>>>> If (g_oCivilApp Is Nothing) Then
>>>> MsgBox "Error creating " & sAppName & ", exit."
>>>> GetBaseCivilObjects = False
>>>> Exit Function
>>>> End If
>>>> Set g_oDocument = g_oCivilApp.ActiveDocument
>>>> Set g_oAeccDatabase = g_oDocument.Database
>>>> GetBaseCivilObjects = True
>>>> End Function
>>>>
>>>>
>>>>
>>>>
Message 18 of 18
Anonymous
in reply to: Anonymous

Hi John,

Unzip the attached file and read it with "Paint"


Regards,


Laurie Comerford

jcoon wrote:
> Laurie
> what e-mail should I use?
> zip file is about 2 meg
>
> john
> "Laurie" wrote in message
> news:6321937@discussion.autodesk.com...
> Hi John,
>
> Assemble the one I put in the post into the correct format. Due to spam
> issues I'm not prepared to post a directly usable Email address here.
>
> 2Mb on a direct email is not an issue.
>
>
> Regards,
>
>
> Laurie Comerford
>
> jcoon wrote:
>
>> Laurie
>>
>> what e-mail do I use? zip is about 2 meg
>>
>> john
>>
>> "Laurie" wrote in message
>> news:6320480@discussion.autodesk.com...
>> Hi John,
>>
>> I'm sort of tied up for the next couple of days, so won't have time to
>> think this through thoughoughly.
>>
>> Could you send me a stripped down drawing containing a sample surface
>> model you use for the air craft clearance
>>
>> Also a stripped down drawing as supplied to you containing AutoCAD
>> points and lastly a stripped down point file of the type you get from
>> the client.
>>
>> I'll put something together to show possibilities.
>>
>> laurie
>> dot
>> comerford
>> at
>> westnet
>> dot
>> com
>> dot
>> au
>>
>> Regards,
>>
>>
>> Laurie Comerford
>> jcoon wrote:
>>
>>
>>> Laurie,
>>>
>>> The routines I have reads each point and sample a selected surface. It
>>> determines if the point elevation is above the surface and if it is is
>>> places a block, it also checks to see if the object is within ten feet of
>>> the surface.
>>> if the object is within ten feet below it places a different block. it
>>> also
>>> writes out the station and offset of each tagged object.
>>>
>>> Laurie, I normally get a drawing that contains AutoCAD points at
>>> elevation
>>> or a text file with the northing, easting, elevation & desc. I convert
>>> the
>>> AutoCAD points to aecpoints or I write the points into a drawing so I can
>>> identify the objects later by the point number from the excel file
>>> output..
>>> any ideas of how to do that from an external file. would I just read the
>>> point number from the text file?
>>>
>>> How would check the surface elevation from a text file?
>>>
>>> Have a great day,
>>> John
>>>
>>> Set objSurf.name by selection onscreen or by listbox
>>>
>>> Dim dblNorth As Double
>>> Dim dblEast As Double
>>> Dim dblElev As Double
>>> Dim dblDesc As String
>>> Dim dblInsPnt(3) As Double
>>> Dim intInputFile As Integer
>>> Open "C:\temp\pointsin.csv" For Output As 1# 'Open file for output
>>>
>>> Do While Not EOF(intInputFile)
>>> 'read sequential, delimited values from the input file and store them
>>> as
>>> Input #intInputFile, dblNorth, dblEast,dblElev, dblDesc
>>>
>>> 'the following lines store the insertion point obtained above in an
>>> array
>>> dblInsPnt(0) = dblNorth
>>> dblInsPnt(1) = dblEast
>>> dblInsPnt(2) = dblElev
>>> dblInsPnt(3) = dblDesc
>>>
>>> 'get surface elevation at location from array obtained from text file
>>>
>>> 'check if above or withing ten feet of surface test
>>> Loop
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> "Laurie" wrote in message
>>> news:6319781@discussion.autodesk.com...
>>> Hi John,
>>>
>>> Surely virtually all of these points started off in an external file(s).
>>>
>>> I would not put them in the drawing, but process the source files.
>>>
>>> By having them in the drawing, you are creating an enormous useless
>>> overhead. Surely you notice moving around and doing anything in the
>>> drawing is slow.
>>>
>>> Here's a couple of alternative approaches to your design analysis.
>>>
>>> Allowing that points on tower tops etc in your surface model will create
>>> "an envelope" in the surface by linking to the nearest ground points
>>> this would lead to a conservative analysis method.
>>>
>>> 1 Build a surface model, then the surface model has can be used to
>>> "Intersectwith" a set of flight path bounding polylines. (I guess you
>>> have already used these polylines (or the logical equivalent) to build
>>> the flight control surfaces - so the second method becomes much more
>>> attractive.
>>>
>>> Programming very simple as you only need a selection set of the
>>> polylines and do an "intersectwith" for each polyline
>>>
>>> 2 Create a volume surface between the surface built from the points and
>>> the flight control surfaces.
>>>
>>> This would give an immediate and readily visible analysis.
>>>
>>> Programming required "Nil"
>>>
>>>
>>> Regards,
>>>
>>>
>>> Laurie Comerford
>>>
>>> jcoon wrote:
>>>
>>>
>>>
>>>> Laurie, Christopher
>>>>
>>>> Thank you for helping me with this point selection test. I'm trying to
>>>> covert some old Land routines to C3D until I can eventually move these
>>>> to
>>>> dot net.
>>>>
>>>> Laurie, The reason for the test is to confirm that the approach path (
>>>> highway) to a runway is clear of obstructions, that includes sampling
>>>> 2-10
>>>> miles of ground points, trees and any other objects like cell phone
>>>> towers
>>>> to that approach. Because of that I routinely need to sample over 100k
>>>> of
>>>> points against control surfaces to identify penetration to those
>>>> surfaces..
>>>>
>>>> With the modified filter and changing the count to long I now get the
>>>> expected results. Only thing remaining is to see if I can add a progress
>>>> bar. I normally push the selection to the command line so the user can
>>>> see
>>>> that the routine has not halted becuase it takes a short amount of time
>>>> to
>>>> sample these points against the control surfaces. if the point is a
>>>> penetration I collect the point number,
>>>> northing,easting,elevation,description and what surface name it
>>>> penetrates.
>>>>
>>>> Thanks for all your help.
>>>> John
>>>>
>>>> "Laurie" wrote in message
>>>> news:6319608@discussion.autodesk.com...
>>>> Hi John,
>>>>
>>>> A couple of comments.
>>>>
>>>> Why are you selecting blocks as well as AEC Points?
>>>>
>>>> The filter command you need for AEC Points is:
>>>> {code}
>>>>
>>>> Dim ftype(0) As Integer
>>>> Dim fdata(0) As Variant
>>>> ftype(0) = 0: fdata(0) = "AECC_COGO_POINT"
>>>>
>>>> {code}
>>>> I presume this is test code, but I simply can't picture why a drawing
>>>> would have 100,000 points in it. Assuming they were regularly spaced at
>>>> minimum spacing to suit the label display size and there was no other
>>>> data you would need about 50 A1 drawing sheets just to plot them legibly
>>>>
>>>> {code}
>>>> " Elev= " & oPoint.Description
>>>> {code}
>>>> seems a bit weird. I would have expected:
>>>> {code}
>>>> " Elev= " & oPoint.Elevation
>>>> {code}
>>>>
>>>> In the posted code you do not use the Civil 3D objects oCivilApp,
>>>> oDocument and oAeccDatabase
>>>>
>>>> The following still works
>>>> {code}
>>>>
>>>> 'module
>>>> Function GetBaseCivilObjects() As Boolean
>>>> Dim oApp As AcadApplication
>>>> Set oApp = ThisDrawing.Application
>>>> ' NOTE - Always specify the version number.
>>>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>>>> ' Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>>>> If (oApp.GetInterfaceObject(sAppName) Is Nothing) Then
>>>> ' If (g_oCivilApp Is Nothing) Then
>>>> MsgBox "Error creating Civil 3D environment, program will exit"
>>>> GetBaseCivilObjects = False
>>>> Exit Function
>>>> End If
>>>> ' Set g_oDocument = g_oCivilApp.ActiveDocument
>>>> ' Set g_oAeccDatabase = g_oDocument.Database
>>>> GetBaseCivilObjects = True
>>>> End Function
>>>>
>>>> {code}
>>>>
>>>> For purposes of testing I put 10,000 points in a drawing and the code
>>>> ran OK for me, taking about 3.7 seconds
>>>>
>>>> By redefining the filter, I was guaranteed not to include anything in
>>>> the selection set but Civil 3D points, but for safety added:
>>>>
>>>> {code}
>>>> If TypeOf oPoint Is AeccPoint Then
>>>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
>>>> & " N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>>>> oPoint.Elevation & vbCrLf
>>>> End If
>>>> {code}
>>>>
>>>> Curiously the code then ran about 2% faster even though it had to
>>>> evaluate the If statement
>>>>
>>>> I tried redefining oPoint as an AeccPoint instead of a variant, - code
>>>> ran marginally faster, perhaps 1%
>>>>
>>>>
>>>>
>>>> Regards,
>>>>
>>>>
>>>> Laurie Comerford
>>>> jcoon wrote:
>>>>
>>>>
>>>>
>>>>
>>>>> Can anyone see why I'd get an overflow error selecting points. I've
>>>>> used
>>>>> this same basic selection type in Land and never got and error when
>>>>> selecting 100 thousand points.
>>>>> how should I iterate thru points in civil 3D?
>>>>>
>>>>>
>>>>> John
>>>>>
>>>>> Private Sub CommandButton1_Click()
>>>>> hide
>>>>> If (GetBaseCivilObjects() = False) Then
>>>>> Exit Sub
>>>>> End If
>>>>>
>>>>> Dim oPoint As Variant
>>>>> Dim ssetObj As AcadSelectionSet
>>>>> Dim i As Integer
>>>>> Dim icount As Integer
>>>>>
>>>>> Dim ftype(0 To 3) As Integer
>>>>> Dim fdata(0 To 3) As Variant
>>>>> ftype(0) = -4: fdata(0) = " >>>>> ftype(1) = 0: fdata(1) = "AECC_COGO_POINT"
>>>>> ftype(2) = 0: fdata(2) = "INSERT"
>>>>> ftype(3) = -4: fdata(3) = "or>"
>>>>>
>>>>> Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
>>>>> ssetObj.SelectOnScreen ftype, fdata
>>>>> MsgBox "count is " & ssetObj.Count & vbCrLf
>>>>>
>>>>> 'i is the number of items in the selection set of aec points
>>>>> For i = 0 To ssetObj.Count - 1
>>>>> Set oPoint = ssetObj.Item(i)
>>>>>
>>>>> On Error Resume Next
>>>>> ThisDrawing.Utility.Prompt vbCrLf & "Command: PT= " & oPoint.Number
>>>>> &
>>>>> "
>>>>> N= " & oPoint.NORTHING & " E= " & oPoint.EASTING & " Elev= " &
>>>>> oPoint.Description
>>>>>
>>>>> Next i
>>>>> ssetObj.Delete
>>>>> UserForm1.Show
>>>>> End Sub
>>>>>
>>>>>
>>>>> 'module
>>>>> Function GetBaseCivilObjects() As Boolean
>>>>> Dim oApp As AcadApplication
>>>>> Set oApp = ThisDrawing.Application
>>>>> ' NOTE - Always specify the version number.
>>>>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>>>>> Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
>>>>> If (g_oCivilApp Is Nothing) Then
>>>>> MsgBox "Error creating " & sAppName & ", exit."
>>>>> GetBaseCivilObjects = False
>>>>> Exit Function
>>>>> End If
>>>>> Set g_oDocument = g_oCivilApp.ActiveDocument
>>>>> Set g_oAeccDatabase = g_oDocument.Database
>>>>> GetBaseCivilObjects = True
>>>>> End Function
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report