Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting the station and elevation from a profile view

5 REPLIES 5
Reply
Message 1 of 6
ssm-jt
1233 Views, 5 Replies

Getting the station and elevation from a profile view

can i use  the "methods supported"   " FindXYAtStationAndElevation" to retrieve a elevation and station from a profile view?

5 REPLIES 5
Message 2 of 6
ssm-jt
in reply to: ssm-jt

found it thanks

 

Message 3 of 6
devitg
in reply to: ssm-jt

Where, how....

Message 4 of 6
ssm-jt
in reply to: ssm-jt

 

someone had posted this ...... i tried and it doesnt work

 

so my search continues

 

anyone?

 

(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))
  (vlax-invoke profview 'FindStationandElevationatXY pt1x pt1y 'pstation 'pelevation 'inbounds)
)

Message 5 of 6
hmsilva
in reply to: ssm-jt

ssm-jt,

if you attach a sample dwg, with your profile view and some notes about what you need, is easiest somebody could help you.

 

Henrique

EESignature

Message 6 of 6
eBoesenberg
in reply to: ssm-jt

I found the answer at 

https://www.theswamp.org/index.php?topic=49878.0

 

The correct code is below.

 

(defun c:get_prof_elev (/)

    (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 staoff (vlax-invoke-method profview 'FindStationAndElevationAtXY pt1x pt1y 'sta 'elev))
    (print sta)
    (print elev)

    (princ)
)
(princ)

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

Post to forums  

Autodesk Design & Make Report

”Boost