If you don't mind a VBA solution, I have posted one that does exactly
this....it even allows you to enter the street cross slope to calculate the
elevation at the point selected.
If you insist on lisp and writing your own, take the example I posted in the
thread back in January with the subject "Using Lisp to get strings of
station and/or Offset" and add to it. Here are some of the things you will
need to do so.....aw, heck, it's just easier to show you the basics......
[code]
(defun c:staoff (/ ACADOBJ AECCALIGN AECCALIGNS AECCAPP AECCDOC AECCPROJ
AECCUTIL CURALIGNNAME
ERR OFF PT1 PTLIST QLIST STA STASTR XY2EN)
(CD_MNL);initialize Civil Design
(and (setq pt1 (getpoint "\nSelect point for station/offset inquiry: "))
(setq acadObj (vlax-get-acad-object))
(setq aeccApp (vla-getInterfaceObject acadObj "Aecc.Application"))
;;;use "Aecc.Application.4" for versions 2004-2006
(setq aeccDoc (vla-get-activedocument aeccApp))
(setq aeccUtil (vlax-get aeccDoc "utility"))
(setq aeccProj (vlax-get aeccApp 'activeProject))
(setq aeccAligns (vlax-get aeccProj 'alignments))
(setq CurAlignName (vlax-get aeccAligns 'currentalignment))
(setq aeccAlign (vlax-invoke aeccAligns 'item curalignname))
(setq aeccFGProfiles (vlax-get aeccAlign 'FGProfiles))
(setq FGCenter (vlax-invoke aeccFGProfiles 'profilebytype 1));1 is
FGCenter
(setq xy2en (vlax-invoke aeccUtil 'xytoeastnorth pt1))
(vlax-invoke-method aeccAlign 'stationoffset (car xy2en) (cadr xy2en)
'sta 'off 'dir)
)
(if sta
(progn
(setq staStr (vlax-invoke-method aeccAligns 'doubletostaformat sta))
;;note that the following line will raise an error if the vertical
doesn't exist at this point
(setq FGCtr (vlax-invoke-method FgCenter 'elevationat sta))
(alert (strcat "\nThe selected point is at Station: " staStr " with an
offset of: " (rtos off) " and CL elevation of: " (rtos FGCtr)))
)
)
(setq qList '(ACADOBJ AECCALIGN AECCALIGNS AECCAPP AECCDOC AECCPROJ
AECCUTIL))
(foreach x qlist
(setq err (vl-catch-all-apply 'vlax-release-object (list (eval x))))
(set x nil)
)
(princ)
)
[/code]
Good Luck,
Jeff
"Boba" wrote in message
news:5101583@discussion.autodesk.com...
Hi,
I am trying to write a lisp routine that will allow a user to click a
point and to get station offset and elevation from FGProfile.
I remember that station and offset was discussed once but not the
FGProfile elevation from the correspondent station.
If some one give a right direction, Thanks in advance.
Vlad