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: 

Getting the station and elevation from a profile view

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
dwcouch123
600 Views, 4 Replies

Getting the station and elevation from a profile view

I am using LISP in C3D 2012.  I am trying to get the station and elevation of a point I pick in a profile view.  I found the Method that will get that info, but I can';t seem to get the syntax right.

 This is the Method;

HRESULT FindStationAndElevationAtXY(
    [in] double X,
    [in] double Y,
    [out] double * pStation,
    [out] double * pElevation,
    [out, optional] VARIANT * pInBounds
);

 

This is the routine I am trying but not having any luck working.

(defun C:getsta ()
  (setq ProfView (vlax-ename->vla-object (car (nentsel "\nSelect Profile View "))))
  (setq pt1 (getpoint "\nSelect Point "))
  (setq pt1X (car pt1))
  (setq Pt1Y (cadr pt1))
  (setq pstation 1.0)
  (setq pelevation 1.0)
  (vlax-invoke profview 'FindStationandElevationatXY (pt1x, pt1y, pstation, pelevation))
)

 

 Can someone help me get the syntax right??  Thank you,

 

Dave

 

4 REPLIES 4
Message 2 of 5
Jeff_M
in reply to: dwcouch123

(vlax-invoke profview 'FindStationandElevationatXY pt1x pt1y 'pstation 'pelevation)

On vacation and can't verify, but may need to add the optional out param as well:
(vlax-invoke profview 'FindStationandElevationatXY pt1x pt1y 'pstation 'pelevation 'inbounds)

 

 

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 5
dwcouch123
in reply to: dwcouch123

Jeff, first of all, what are you doing checking the discussion groups when you are on vacation???

 

Next, thanks for the response.  I tried both variations, and other variable names.  The line seems to run with no errors, (I just get a nil as a response).  But pstation and pelevation are nil also.  Any other ideas?  Anyone else??

 

Dave

Message 4 of 5
Jeff_M
in reply to: dwcouch123

Just killing time before heading off to the next segment of this trip. 🙂 

 

You might try (vlax-invoke-method ....) instead of the shorter version.

Jeff_M, also a frequent Swamper
EESignature
Message 5 of 5
dwcouch123
in reply to: dwcouch123

Jeff, obviously, the vacation isn't dulling your brain.  Adding the -method did the trick.  Thank you, now get back ot the vacation.

 

Dave

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

Post to forums  

Rail Community


Autodesk Design & Make Report