AutoCAD Land Desktop (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with profiles and alignments....!!

4 REPLIES 4
Reply
Message 1 of 5
BigCountry
155 Views, 4 Replies

Help with profiles and alignments....!!

Hi all!
I need a little guidance on a program that I'm working on. I want to be able to pick a point on an alignment and have LDT make a point on a corresponding profile. I can set the alignment current and verify if a corresponding profile exists, but.... that's as far as I can go. I haven't dabbled too much in the LDT VBA, so any help would be greatly appreciated.
Thanks in advance!
- Matt
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: BigCountry

Take a look at the following code. It's from the vba reference:

Copyright - Autodesk
Sub Example_StationElevationToXy()

' This example returns the StationElevationToXy for the first ProfileBlock
in the collection.

Dim alignProf As AeccProfileBlock
Set alignProf = AeccApplication.ActiveDocument.ProfileBlocks.Item(0)
Dim StaElev(0 To 1) As Double
Dim XY As Variant
Dim station As Double, elevation As Double

'Get the station and the elevation
station = ThisDrawing.Utility.GetReal("Enter the station for the X value: ")
elevation = ThisDrawing.Utility.GetReal("Enter the elevation for the Y
value: ")

' Use the entered values to get the X and Y values
staElev(0) = station
staElev(1) = elevation
XY = alignProf.StationElevationToXy(staElev)

MsgBox "The X value for the StationElevation is: " & Format(XY(0), "0.00") &
vbCrLf & _
"The Y value for the StationElevation is: " & Format(XY(1), "0.00") _
, vbInformation, "StationElevationToXy Example"

End Sub

Good luck,

Drew Burgasser
CAD Masters, Inc.
www.cadmasters.com





"BigCountry" wrote in message
news:f0d4380.-1@WebX.maYIadrTaRb...
Hi all!
I need a little guidance on a program that I'm working on. I want to be able
to pick a point on an alignment and have LDT make a point on a corresponding
profile. I can set the alignment current and verify if a corresponding
profile exists, but.... that's as far as I can go. I haven't dabbled too
much in the LDT VBA, so any help would be greatly appreciated.
Thanks in advance!
- Matt
Message 3 of 5
BigCountry
in reply to: BigCountry

Thanks Drew!
But how do I draw a point or line or anything at a point (x,y) on the profile that corresponds to a point picked on the alignment?
TIA
- Matt
Message 4 of 5
Anonymous
in reply to: BigCountry

Matt,

 

You first convert the x,y to northing/easting. Look
for the Utility method XyToNorthEast in the help file.

 

The Alignment object has a StationOffset method.
You pass it the north/east values. YOu can ignore the offset and use the station
to identify the point along the profile.

 

There is a ProfileBlocks collection in the drawing.
iterate this to find the correct profile block for your alignment. The
ProfileBlock object has a SationElevationToXy method. Use this twice with your
station and 2 different elevations to get the pair of coords to create your
line. Note, this returns xy and not north/east like the other LDD method so you
don't have to convert the coordinates.

 

Look at your EgProfiles or FgProfiles
collections to determine what elevations you want to use on your
profile. You can get the elevation
 at
your station for any of the defined vertical alignments from these collections
using the ElevationAt method.

 

Glen

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Thanks
Drew!
But how do I draw a point or line or anything at a point (x,y) on
the profile that corresponds to a point picked on the alignment?
TIA

  - Matt
Message 5 of 5
Anonymous
in reply to: BigCountry

First you need a station and elevation.

With VBA, you should be able to get the station of the point that you have
chosen with...
object.StationOffset(Easting, Northing, Station, Offset, Direction)

As for the elevation, what elevation do you want?




"BigCountry" wrote in message
news:f0d4380.1@WebX.maYIadrTaRb...
Thanks Drew!
But how do I draw a point or line or anything at a point (x,y) on the
profile that corresponds to a point picked on the alignment?
TIA
- Matt

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

Post to forums  

Autodesk Design & Make Report