<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: flatten feature line elevations by single command in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/7345290#M12230</link>
    <description>&lt;P&gt;You bet. Happy I could help.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Sep 2017 14:33:12 GMT</pubDate>
    <dc:creator>hippe013</dc:creator>
    <dc:date>2017-09-01T14:33:12Z</dc:date>
    <item>
      <title>flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/7342433#M12227</link>
      <description>&lt;P&gt;How could I&amp;nbsp;flatten feature line elevations by single command?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Natively it can be achieved:&lt;/P&gt;
&lt;P&gt;a) setting a point of a feature line to the elevation and running 'set feature grade'&lt;/P&gt;
&lt;P&gt;b) changing 0+00 point in 'grading elevation editor' plus running 'flatten grade or elevations' from the button after selecting all the points in the list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The options available are rough for a simple operation like that, is there a lisp available?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 14:44:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/7342433#M12227</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2017-08-31T14:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/7343681#M12228</link>
      <description>&lt;P&gt;This should get you started.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:flatfl ()
  (setq sel (entsel "\nSelect Featureline: "))
  (setq elev (getreal "\nEnter Elevation: "))
  (if (and sel elev)
    (progn
      (setq obj (vlax-ename-&amp;gt;vla-object (car sel)))
      (setq pnts (vlax-safearray-&amp;gt;list (vlax-variant-value (vlax-invoke-method obj 'GetPoints  3))))
      (setq i 0)
      (repeat (/ (length pnts) 3)
	(setq x (nth i pnts))
	(setq y (nth (+ i 1) pnts))
	(vlax-invoke-method obj 'SetPointElevation (vlax-3d-point x y elev))
	(setq i (+ i 3))
	)
      )
    )
  (princ)
  )&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Aug 2017 21:33:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/7343681#M12228</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2017-08-31T21:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/7344362#M12229</link>
      <description>&lt;P&gt;Excellent!&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 07:17:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/7344362#M12229</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2017-09-01T07:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/7345290#M12230</link>
      <description>&lt;P&gt;You bet. Happy I could help.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 14:33:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/7345290#M12230</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2017-09-01T14:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8318843#M12231</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Can you also flatten the grade between feature line endpoints?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 06:59:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8318843#M12231</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2018-10-08T06:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8320039#M12232</link>
      <description>&lt;P&gt;StraightGrade - Hold Start and End Elevations - Create a Straight Grade In-between&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:StraightGrade ()
  ;Prompt for Featureline
  (princ "\nSelect Featureline: ")
  (setq ss (ssget ":s" '((0 . "AECC_FEATURE_LINE"))))

  ;If we have a Selection Set then proceed
  (if ss
    (progn
      ;Get Object from SelectionSet
      (setq obj (vlax-ename-&amp;gt;vla-object (ssname ss 0)))
      
      ;Get All Points (3)   |  (1)=PI Points (2)=Elevation Points
      (setq pnts (vlax-safearray-&amp;gt;list (vlax-variant-value (vlax-invoke-method obj 'GetPoints  3))))
      
      ;Get the Point Count - ;(setq pCount (vlax-get-property obj 'PointsCount))
      (setq pCount (/ (length pnts) 3))

      ;Compute
      (setq sp (list (nth 0 pnts)(nth 1 pnts)(nth 2 pnts)))
      (setq ep (list (nth (- (length pnts) 3) pnts)(nth (- (length pnts) 2) pnts)(nth (- (length pnts) 1) pnts)))
      (setq zDiff (- (caddr ep) (caddr sp) ))
      (setq len (vlax-get-property obj 'Length2D))
      (setq slope (/ zDiff len))

      ;Report
      (princ (strcat "\nStart Point Elev: " (rtos (caddr sp) 2 2)))
      (princ (strcat "\nEnd Point Elev: " (rtos (caddr ep) 2 2)))
      (princ (strcat "\nElevation Difference: " (rtos zDiff 2 2)))
      (princ (strcat "\nTotal 2D Length: " (rtos len 2 2)))
      (princ (strcat "\nUsing Slope of: " (rtos (* slope 100.00) 2 2) "%"))

      ;Set increment to Beginning of Second Point
      (setq i 3)

      ;Repeat for each point except the first and last
      (repeat (- pCount 2)
	
	;Get Current Point
	(setq p (list (nth i pnts) (nth (+ i 1) pnts) (nth (+ i 2) pnts)))
	
	;Get its 2D Distance along the Featureline
	(setq dist (vlax-curve-getDistAtPoint obj p))
	
	;Compute
	(setq newZ (+ (* dist slope) (caddr sp)))
	(setq newP (list (car p)(cadr p) newZ))

	;Set the Elevation
	(vlax-invoke-method obj 'SetPointElevation (vlax-3d-point newp))

	;Increment
	(setq i (+ i 3))
	)
      )
    )
  (princ)
  )&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Oct 2018 15:01:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8320039#M12232</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2018-10-08T15:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8320177#M12233</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Greatly appreciated, thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A closed feature line is flattened to&amp;nbsp;the starting station elevation just like it mathematically logical is.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Only thing comparing your lisps&amp;nbsp;to Civil's native feature line editing commands is that the grading surface is not automatically updated, automatic&amp;nbsp;surface rebuilding is not "awakened".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What's the&amp;nbsp;command in Civil to rebuild a surface?&amp;nbsp; Rebuild is accessed through Toolspace + right click on the surface name, but command name is hidden.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 15:44:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8320177#M12233</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2018-10-08T15:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8320338#M12234</link>
      <description>&lt;P&gt;I added '(Command "REGENALL")' to the code to trigger the rebuild of the surface. I believe that the surface still needs to be set to Automatic Re-Build.&lt;/P&gt;&lt;PRE&gt;(defun c:StraightGrade ()
  ;Prompt for Featureline
  (princ "\nSelect Featureline: ")
  (setq ss (ssget ":s" '((0 . "AECC_FEATURE_LINE"))))

  ;If we have a Selection Set then proceed
  (if ss
    (progn
      ;Get Object from SelectionSet
      (setq obj (vlax-ename-&amp;gt;vla-object (ssname ss 0)))
      
      ;Get All Points (3)   |  (1)=PI Points (2)=Elevation Points
      (setq pnts (vlax-safearray-&amp;gt;list (vlax-variant-value (vlax-invoke-method obj 'GetPoints  3))))
      
      ;Get the Point Count - ;(setq pCount (vlax-get-property obj 'PointsCount))
      (setq pCount (/ (length pnts) 3))

      ;Compute
      (setq sp (list (nth 0 pnts)(nth 1 pnts)(nth 2 pnts)))
      (setq ep (list (nth (- (length pnts) 3) pnts)(nth (- (length pnts) 2) pnts)(nth (- (length pnts) 1) pnts)))
      (setq zDiff (- (caddr ep) (caddr sp) ))
      (setq len (vlax-get-property obj 'Length2D))
      (setq slope (/ zDiff len))

      ;Report
      (princ (strcat "\nStart Point Elev: " (rtos (caddr sp) 2 2)))
      (princ (strcat "\nEnd Point Elev: " (rtos (caddr ep) 2 2)))
      (princ (strcat "\nElevation Difference: " (rtos zDiff 2 2)))
      (princ (strcat "\nTotal 2D Length: " (rtos len 2 2)))
      (princ (strcat "\nUsing Slope of: " (rtos (* slope 100.00) 2 2) "%"))

      ;Set increment to Beginning of Second Point
      (setq i 3)

      ;Repeat for each point except the first and last
      (repeat (- pCount 2)
	
	;Get Current Point
	(setq p (list (nth i pnts) (nth (+ i 1) pnts) (nth (+ i 2) pnts)))
	
	;Get its 2D Distance along the Featureline
	(setq dist (vlax-curve-getDistAtPoint obj p))
	
	;Compute
	(setq newZ (+ (* dist slope) (caddr sp)))
	(setq newP (list (car p)(cadr p) newZ))

	;Set the Elevation
	(vlax-invoke-method obj 'SetPointElevation (vlax-3d-point newp))

	;Increment
	(setq i (+ i 3))
	)
      )
    )
  &lt;FONT color="#FF0000"&gt;(command "REGENALL")&lt;/FONT&gt;
  (princ)
  )&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Oct 2018 17:02:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8320338#M12234</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2018-10-08T17:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8320583#M12235</link>
      <description>&lt;P&gt;Regen doesn't rebuild surfaces even if they are set to rebuild automatically.&amp;nbsp;&lt;/P&gt;&lt;P&gt;With referral to Jeff_M&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/civil-3d-forum/rebuild-all/td-p/3361321" target="_blank"&gt;https://forums.autodesk.com/t5/civil-3d-forum/rebuild-all/td-p/3361321&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I added:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(initget "Yes No")&lt;BR /&gt;(setq yorn (cond ((getkword "\n Rebuild surface(s)? [Yes/No] &amp;lt;Yes&amp;gt;: ")) ("Yes")))&lt;BR /&gt;(cond ((and (= yorn "Yes") (ssget '((0 . "AECC_*SURFACE")))) ;;rebuild selected surfaces&lt;BR /&gt;(vlax-for ent (vla-get-activeselectionset&lt;BR /&gt;(vla-get-activedocument&lt;BR /&gt;(vlax-get-acad-object)))&lt;BR /&gt;(vlax-invoke ent 'rebuild)&lt;BR /&gt;)&lt;BR /&gt;))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 18:48:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8320583#M12235</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2018-10-08T18:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8333948#M12236</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Still, maybe there is a way to trigger Civil to notice that a feature line part of a grading or surface has changed to rebuild the surface automatically? There probably is a call for that as native Civil&amp;nbsp;feature line elevation editing commands do this. It would give&amp;nbsp;&lt;/SPAN&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1633394"&gt;@hippe013&lt;/a&gt;&lt;SPAN&gt;&amp;nbsp;'s excellent lisps the full functionality.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 08:06:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8333948#M12236</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2018-10-15T08:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8334919#M12237</link>
      <description>&lt;P&gt;I do realize that I misspoke when I stated "&lt;SPAN&gt;&lt;EM&gt;'(Command "REGENALL")' to the code to trigger the rebuild of the surface&lt;/EM&gt;".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I urge you to do the following test. Create a simple surface that contains a featureline as a breakline in the surface. Set the surface rebuild to automatic. Now using a the above command that DOES NOT contain regenall and see if you get the the surface react to the command. Now with the same surface use the above command that does contain regenall. I am certain you will see why I added the simple (Command "REGENALL") to the end of the code.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 14:41:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8334919#M12237</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2018-10-15T14:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: flatten feature line elevations by single command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8339568#M12238</link>
      <description>&lt;P&gt;Ok, I did not test 'regenall' through the lisp as I did not expect that it works differently if featured in the lisp.&lt;/P&gt;&lt;P&gt;The affected surfaces are rebuilt then indeed, thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 05:59:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/flatten-feature-line-elevations-by-single-command/m-p/8339568#M12238</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2018-10-17T05:59:38Z</dc:date>
    </item>
  </channel>
</rss>

