C3D 2012
Before I go off and create a routine, I thought I would check to see if I am missing something. I want to set and Elevation Point (not a PI Point) along a feature line by entering the grade from the previous point. Currently the "Set Elevation Point" command only allows entering an elevations or getting an elevation from the surface. I know I can set an elevation point and then use the "quick elevation editor" to adjust the grade, but I don't want to go through the extra step. Am I missing something, or is there something out there readily avaialble??
Dave
Solved! Go to Solution.
Solved by dwcouch123. Go to Solution.
Solved by Jeff_M. Go to Solution.
OK, I went off and created a routine that does not work. When I execute the "command" line, it looks like it is ignoring the pt2 (or the pt2 is invalid) using the "newelev" maybe as a distance. Maybe I need to format the pt2 different. Here is the code I am using.
(defun C:getfl () (setq flobjsel (car (entsel "\nSelect Feature Line "))) (setq flobj (vlax-ename->vla-object flobjsel)) (setq pt1 (getpoint "\nSelect First point for elevation ")) (setq pt2 (getpoint "\nSelect Second Point for Elevation ")) (setq pDist (vlax-invoke-method FLObj 'Get2DDistanceBetweenPoints (vlax-3d-point pt1) (vlax-3d-point pt2))) (setq begelev (caddr pt1)) (setq newgrade (getreal "\nEnter Grade in Percent: ")) (setq newelev (+ begelev (* pdist (/ newgrade 100.00)))) (command "_AeccInsertFeatureElevPoint" flobjsel pt2 newelev) )
I am using "Endpt" to select pt1 and "Nearest" to select pt2. pt2 is the point I want to set an elevation point on.
Dave
Give this a whirl, Dave
(defun C:getfl () (setq flobjsel (car (entsel "\nSelect Feature Line "))) (setq flobj (vlax-ename->vla-object flobjsel)) (setq os (getvar 'osmode)) (setvar 'osmode 1) (setq pt1 (getpoint "\nSelect First point for elevation ")) (setvar 'osmode 512) (setq pt2 (getpoint "\nSelect Second Point for Elevation ")) (setq osmode os) (setq pDist (vlax-invoke-method FLObj 'Get2DDistanceBetweenPoints (vlax-3d-point pt1) (vlax-3d-point pt2))) (setq begelev (caddr pt1)) (setq newgrade (getreal "\nEnter Grade in Percent: ")) (setq newelev (+ begelev (* pdist (/ newgrade 100.00)))) (vlax-invoke FLObj 'insertfeaturepoint (list (car pt2) (cadr pt2) newelev) 2) ;;1 = PI, 2 = Elevation Point ;;(command "_AeccInsertFeatureElevPoint" flobjsel pt2 newelev) )
Jeff, excellent. I needed to make one change. (setq osmode os) to (setvar 'osmode os). Then worked perfectly. I added a "while" loop to continue setting points down the line. Now I need to determine when I have a PI point already in the featrue line between my pt1 and new pt2 so that I can set the elevation of that point.
Thanks, again,
Dave