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: 

Insert Elevation Point on Feature Line by Grade

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
dwcouch123
1212 Views, 3 Replies

Insert Elevation Point on Feature Line by Grade

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

3 REPLIES 3
Message 2 of 4
dwcouch123
in reply to: dwcouch123

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 

Message 3 of 4
Jeff_M
in reply to: dwcouch123

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_M, also a frequent Swamper
EESignature
Message 4 of 4
dwcouch123
in reply to: Jeff_M

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  

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report