rcb007 Posted May 23 Share Posted May 23 I stumbled upon this code at theswamp.org. The user would pick a point on the profile view, then it would zoom to the alignment location and high light the alignment. Would there be any way to have it just select the alignment? I was playing around with possibly swapping the " (vla-highlight align :vlax-true)" to be one for selecting it; but no luck. (defun c:PV2AL (/ ss ent align profview endstation midstation pnt startstaion x y) ;;Profile view to zoom to alignment (command "undo" "begin") (vl-load-com) (setq ss (ssget ":S+." '((0 . "AECC_PROFILE_VIEW")))) (if ss (progn (setq ent (ssname ss 0)) (setq pickpt (last (last (car (ssnamex ss 0))))) (setq profview (vlax-ename->vla-object ent)) (vlax-invoke-method profview 'findstationandelevationatxy (car pickpt)(cadr pickpt) 'sta 'elev) (setq startstation (vlax-get profview 'stationstart) endstation (vlax-get profview 'stationend) midstation (/ (+ startstation endstation) 2) ) (setq align (vlax-get profview 'parent)) (vla-highlight align :vlax-true) (if (and (> sta (vlax-get align 'startingstation)) (< sta (vlax-get align 'endingstation)) ) (setq midstation sta) ) (vlax-invoke-method align 'pointlocation midstation 0 'x 'y) (setq pnt (list x y)) (command "zoom" "c" pnt 200) (princ "Zoomed to Alignment.") ) ) (princ) ) Thanks for the help. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 24 Share Posted May 24 Have a look at Civil Site Design its built in, when in a design profile a matching plan view will show where you are on a profile a moving little bar. Works with CIV3D or Bricscad. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.