<?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: Project a line to a surface command in Civil 3D Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6765903#M192943</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I may not understand your program correctly but from the video it looks like you only solve for a single point along a vector.&amp;nbsp;The&amp;nbsp;task is to find any point in any direction from the origin, with visual feedback for&amp;nbsp;the solutions.&amp;nbsp;Are you able to do that?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2016 16:13:34 GMT</pubDate>
    <dc:creator>Neilw_05</dc:creator>
    <dc:date>2016-12-22T16:13:34Z</dc:date>
    <item>
      <title>Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6759816#M192932</link>
      <description>&lt;P&gt;Hi Everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm relative new to Civil 3d, previously a Inroads users.. and i'm found what i use Civil 3d for to be very handy and easier than Inroads there are a few commands in Inroads i wish (i hope someone can tell me otherwise) were in Civil 3d.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main on is a command in Inroads called 'project a line to a surface', i have searched the internet and some ppl have asked the question but have been shown the 'elevations from surface' in Civil 3d which is essentially 'drape to surface'&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what i'm looking for is to project a single line at a grade (say 1:10) from a crest level of my design to an existing surface. when i move my mouse the line will get longer or shorter depending where i intersects with the selected surface.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm hoping someone with inroads background has tried to find this, knows it does or doesn't exist so i can move on with my life haha&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 06:41:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6759816#M192932</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-20T06:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6759890#M192933</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;welcome on forum.&lt;/P&gt;&lt;P&gt;Not sure what exactly you mean but I can suggest you to play with Future Lines modifications (Ribbon Modify - Tab Edit Elevations).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See this thread:&lt;/P&gt;&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/autocad-civil-3d-forum/how-to-project-lines-and-curves-to-a-surface-with-elevations/td-p/3893787" target="_self"&gt;http://forums.autodesk.com/t5/autocad-civil-3d-forum/how-to-project-lines-and-curves-to-a-surface-with-elevations/td-p/3893787&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 07:42:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6759890#M192933</guid>
      <dc:creator>krzysztof.psujek</dc:creator>
      <dc:date>2016-12-20T07:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6761751#M192934</link>
      <description>&lt;P&gt;Is this what you are looking for in Civil 3D? I do not think there is a menu/button&amp;nbsp;to do this, but can be accomplished using feature line(s) at the desired grade, creating temporary TIN surface from them and then by comparing the temp TIN and existing ground TIN (or using the minimum distance between surfaces command).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SURF.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/304342iC56907C1EF821D03/image-size/large?v=v2&amp;amp;px=999" role="button" title="SURF.png" alt="SURF.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 21:35:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6761751#M192934</guid>
      <dc:creator>Hidden_Brain</dc:creator>
      <dc:date>2016-12-20T21:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6761935#M192935</link>
      <description>&lt;P&gt;That is the command I'm looking for. Sucks that it doesn't exist. Handy for ramps from crest of an embankment to toe.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 23:12:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6761935#M192935</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-20T23:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6762005#M192936</link>
      <description>&lt;P&gt;Though C3D does not have an identical tool that I know of, you can achieve your task with a grading. To do this you draw a very small circle around the point you want to start from. Convert it to a featureline and set the elevation&amp;nbsp;to match the elevation of the starting point. Next apply a grading that targets your surface at the desired slope. The resulting daylight line will be all the locations&amp;nbsp;for a solution. Then strike a line&amp;nbsp;at the optimal solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;circle you start with should be very small to keep the&amp;nbsp;grading as close as possible to the true starting point location.&amp;nbsp;I haven't tested this so I am not sure how well the grading will work from such a small circle.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 23:57:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6762005#M192936</guid>
      <dc:creator>Neilw_05</dc:creator>
      <dc:date>2016-12-20T23:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6762022#M192937</link>
      <description>&lt;P&gt;Cheers, that would work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks guys&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 00:03:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6762022#M192937</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-21T00:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6763830#M192938</link>
      <description>&lt;P&gt;I think you'll find the grading will not be suitable using&amp;nbsp;a very small circle. The reason being the tessellation for such a small circle (the little 3D line segments that approximate the circle) does not generate enough vertices for the grading to solve. To overcome that problem you could increase the diameter of the circle and raise or lower the elevation by interpolation along the&amp;nbsp;target slope.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example if the reference point is elevation 100 and the target slope is down to the surface at 1 to 1, you can draw a circle that is 10' diameter and set the elevation to be 10'&amp;nbsp;lower than the reference point (10' x 1 to 1). This will provide&amp;nbsp;a much better solution. If the difference in elevation between the reference point and&amp;nbsp;the target surface is&amp;nbsp;small it does not limit the size of the circle. You will still get the same&amp;nbsp;solution even if the interpolated circle falls&amp;nbsp;below the&amp;nbsp;target surface.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 18:07:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6763830#M192938</guid>
      <dc:creator>Neilw_05</dc:creator>
      <dc:date>2016-12-21T18:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6763841#M192939</link>
      <description>&lt;P&gt;Disregard that last comment about the solution being the same if the circle is below the target. That is not correct. In that scenario the solution becomes more complicated. You would need to use a combination of grading and surface models. The approach would be to create a cone shaped surface with gradings and then find the line of intersection between the 2 surfaces. That idea may have been&amp;nbsp;suggested previously.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 18:12:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6763841#M192939</guid>
      <dc:creator>Neilw_05</dc:creator>
      <dc:date>2016-12-21T18:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6764070#M192940</link>
      <description>&lt;P&gt;See if the below lisp helps. It will use&amp;nbsp;2 points to determine the direction of a vector and then determine its intersection with&amp;nbsp;surface.&lt;/P&gt;
&lt;P&gt;&lt;IFRAME width="696" height="715" src="https://screencast.autodesk.com/Embed/Timeline/91afe128-29a3-4042-8455-024efd1bae08" frameborder="0" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen"&gt;&lt;/IFRAME&gt;&lt;/P&gt;
&lt;PRE&gt;;;; Get intersection point with surface
;;; created by Ranjit Singh 12/21/16
(vl-load-com)
(defun c:gip  (/ adoc curcmdecho curnomutt modelspace newss pt1 pt2 retpt vdirection1 vdirection2 vlasurf x y)
  (defun *error*  (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (setvar 'cmdecho curcmdecho)
    (setvar 'nomutt curnomutt)
    (vla-endundomark adoc)
    (princ))
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (setq curcmdecho (getvar 'cmdecho)
        curnomutt  (getvar 'nomutt)
        modelspace (vla-get-modelSpace adoc))
  (prompt "\nSelect Tin Surface: ")
  (setvar 'cmdecho 0)
  (setvar 'nomutt 1)
  (setq vlasurf (vlax-ename-&amp;gt;vla-object (car (entsel))))
  (setvar 'nomutt 0)
  (setq pt1 (vlax-3d-point (getpoint "\nSelect first point: "))
        pt2 (vlax-3d-point (getpoint "\nSelect second point: ")))
  (setvar 'nomutt 1)
  (setq vDirection1 (vla-get-DirectionVector (vla-AddRay modelspace pt1 pt2))
        vDirection2 (vla-get-DirectionVector (vla-AddRay modelspace pt2 pt1)))
  (entdel (entlast))
  (entdel (entlast))
  (setq newss (ssadd))
  (mapcar
    '(lambda (x y)
       (if
         (not
           (vl-catch-all-error-p
             (setq retpt (vl-catch-all-apply 'vlax-invoke-method (list vlaSurf 'IntersectPointWithSurface x y)))))
          (progn (vla-addpoint modelspace retpt) (ssadd (entlast) newss))))
    (list pt1 pt2)
    (list vDirection1 vDirection2))
  (if (/= (sslength newss) 0)
    (sssetfirst nil newss)
    (princ "\nNo intersection found"))
  (*error* "end"))
(prompt "Type GIP to find intersection with surface. Needs 2 points to define vector.")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 19:59:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6764070#M192940</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2016-12-21T19:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6764870#M192941</link>
      <description>&lt;P&gt;So the way i solved it was using a circle, breaking so i am able to turn it into a feature line, then grading that at 1:10 to the desired surface. Where the toe intersects the surface at desired location i drew a 3d poly line from there back up to the design crest&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.JPG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/304806iB594640F6AA4E8EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1.JPG" alt="1.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.JPG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/304807i72C8817107AFC234/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2.JPG" alt="2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 05:49:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6764870#M192941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-22T05:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6765761#M192942</link>
      <description>&lt;P&gt;Now that I see your drawing I think you can solve that scenario more directly with a single featureline, assuming all the graphics are at true elevation. Strike a featureline from your&amp;nbsp;start point to a point on the target line. Label the slope on the featureline for visual feedback. Then just move the end point along the target line until you achieve the desired slope.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 15:13:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6765761#M192942</guid>
      <dc:creator>Neilw_05</dc:creator>
      <dc:date>2016-12-22T15:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6765903#M192943</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I may not understand your program correctly but from the video it looks like you only solve for a single point along a vector.&amp;nbsp;The&amp;nbsp;task is to find any point in any direction from the origin, with visual feedback for&amp;nbsp;the solutions.&amp;nbsp;Are you able to do that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 16:13:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6765903#M192943</guid>
      <dc:creator>Neilw_05</dc:creator>
      <dc:date>2016-12-22T16:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6765934#M192944</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I may not understand your program correctly but from the video it looks like you only solve for a single point along a vector.&amp;nbsp;The&amp;nbsp;task is to find any point in any direction from the origin, with visual feedback for&amp;nbsp;the solutions.&amp;nbsp;Are you able to do that?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I misunderstood OPs original post of finding intersection of a &lt;STRONG&gt;single line&lt;/STRONG&gt;. If he needs to check every possible direction then grading is the way to go.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;............... &lt;STRONG&gt;what i'm looking for is to project a single line at a grade (say 1:10) from a crest level of my design to an existing surface&lt;/STRONG&gt;. .................&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Andrew&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 16:24:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6765934#M192944</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2016-12-22T16:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766026#M192945</link>
      <description>&lt;P&gt;&lt;A title="Video demonstration" href="http://www.dotsoft.com/demos/csFigPrjSur.htm" target="_blank"&gt;This video&lt;/A&gt; shows the way I envision what you described.&amp;nbsp; We had an existing design on the drawing &lt;EM&gt;simply as a guide&lt;/EM&gt; for the demo.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We're adding this to our &lt;A title="Low Cost Civil3D FeatureLine Tools Add-on" href="http://www.dotsoft.com/3dfeature.htm" target="_blank"&gt;C3D FeatureLine Tools&lt;/A&gt; today.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 17:04:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766026#M192945</guid>
      <dc:creator>TerryDotson</dc:creator>
      <dc:date>2016-12-22T17:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766104#M192946</link>
      <description>&lt;P&gt;Hi Terry,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is a nice functioning tool. Well done. However I don't think it solves this particular task. We need to solve from a single point, not from along a linear feature. It still might be useful as it is for some scenarios though.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 17:37:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766104#M192946</guid>
      <dc:creator>Neilw_05</dc:creator>
      <dc:date>2016-12-22T17:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766566#M192947</link>
      <description>&lt;P&gt;Hello Ranjit,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I like your program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did something similar to yours, inserted below. I am struggling to get the error checking, so anyone out there who cares to contribute has my permission to modify the code so that it traps the error that occurs when the user inputs values that don't find an intersection with the surface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The routine asks for a surface, asks for startpoint (uses this as starting elevation for the upcoming 3D poly that gets drawn), asks for direction point and then for slope. The routine draws a 3D polyline along that 3D vector until it intersects the surface. You can use Create Feature Lines from Objects to convert to feature line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this directly addresses the OP's request, no?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 21:17:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766566#M192947</guid>
      <dc:creator>tcorey</dc:creator>
      <dc:date>2016-12-22T21:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766572#M192948</link>
      <description>&lt;P&gt;Hi Tim, I think you forgot to attach the code.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 21:20:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766572#M192948</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2016-12-22T21:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766579#M192949</link>
      <description>&lt;P&gt;Yes, I did. Here it is....&lt;/P&gt;
&lt;PRE&gt;					;Needs error trapping
;Select a surface
					;Pick a start point on a feature/polyline
;Pick a direction point
;Enter a slope in percent
;routine draws a 3d polyline along the selected direction and slope until it intersects the surface
;This routine needs error trapping as it fails when you input values that don't allow the intersection to be found


(defun c:go (/ cosmode srf stpt stptz endpt endptxy0 difx slop difz newxyz rayo dirvec basep newpt)


  (vl-load-com)
  (setq cosmode (getvar "OSMODE"))
  (setvar "OSMODE" 0)

  (setq
    srf	(vlax-ename-&amp;gt;vla-object (car (entsel "\nSelect Surface: ")))
  )					;user selects the surface.
   (setq stpt (getpoint "\nSelect Start Point: "))
    (setq stptz (caddr stpt))
    (setq endpt (getpoint "\nSelect direction point: "))
    (setq endptxy0 (list (car endpt) (cadr endpt) stptz))
    (setq difx (distance stpt endptxy0))
    
     (setq slop (/ (getreal "\nEnter slope in percent: ") 100))
    (setq difz (* difx slop))
    
    (setq newxyz (list (car endpt) (cadr endpt) (+ stptz difz)))
    
    (vl-cmdf "Ray" stpt newxyz "")
    (setq rayo (vlax-ename-&amp;gt;vla-object (entlast)))
    (setq dirvec (vlax-get-property rayo 'DirectionVector))
    (setq basep (vlax-get-property rayo 'BasePoint))
    (vl-cmdf "erase" (entlast) "")

  
    
	       (setq newpt (vlax-invoke-method srf 'IntersectPointWithSurface basep dirvec))
               (setq newpt (list (vlax-safearray-get-element (vlax-variant-value newpt) 0)
				 (vlax-safearray-get-element (vlax-variant-value newpt) 1)
				 (vlax-safearray-get-element (vlax-variant-value newpt) 2)
				 )
		     )
  
	(vl-cmdf "3dpoly" stpt newpt "")
	

  (setvar "OSMODE" cosmode)
  (princ)
  ;(*error* "end")
)					;end defun







&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Dec 2016 21:22:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766579#M192949</guid>
      <dc:creator>tcorey</dc:creator>
      <dc:date>2016-12-22T21:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766595#M192950</link>
      <description>&lt;P&gt;Easy enough, we added a [Point] option that lets the user pick a 3d point location instead of a linear object.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 21:34:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766595#M192950</guid>
      <dc:creator>TerryDotson</dc:creator>
      <dc:date>2016-12-22T21:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Project a line to a surface command</title>
      <link>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766614#M192951</link>
      <description>&lt;P&gt;Nice.&amp;nbsp;I will spend time on your&amp;nbsp;error trap sometime later today (assuming no one else gets to it before that). Meanwhile, I am attaching a modification to my above LISP, give it a try. I will, time permitting, add&amp;nbsp;grade&amp;nbsp;and slope options as well.&lt;/P&gt;
&lt;PRE&gt;;;; Get intersection point with surface
;;; created by Ranjit Singh 12/21/16
(vl-load-com)
(defun c:gip  (/ adoc b curcmdecho curnomutt i modelspace newss pt1 pt2 retpt vdirection vlasurf)
  (defun *error*  (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (setvar 'cmdecho curcmdecho)
    (setvar 'nomutt curnomutt)
    (vla-endundomark adoc)
    (princ))
  (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
  (setq curcmdecho (getvar 'cmdecho)
        curnomutt  (getvar 'nomutt)
        modelspace (vla-get-modelSpace adoc))
  (prompt "\nSelect Tin Surface: ")
  (setvar 'cmdecho 0)
  (setvar 'nomutt 1)
  (setq vlasurf (vlax-ename-&amp;gt;vla-object (car (entsel))))
  (setvar 'nomutt 0)
  (setq pt1 (getpoint "\nSelect first point: ")
        pt2 (getpoint "\nSelect second point: "))
  (setvar 'nomutt 1)
  (setq b     100 ; this sets how many points needed
        i     0
        newss (ssadd))
  (repeat b
    (setq vDirection
           (vla-get-DirectionVector
             (vla-AddRay
               modelspace
               (vlax-3d-point pt1)
               (vlax-3d-point
                 (append
                   (reverse
                     (cdr (reverse
                            (polar pt1
                                   (+ (angle pt1 pt2) (* i (* (/ (/ 360.0 b) 180.0) pi)))
                                   (distance (reverse (cdr (reverse pt1))) (reverse (cdr (reverse pt2))))))))
                   (cddr pt2))))))
    (entdel (entlast))
    (if (not
          (vl-catch-all-error-p
            (setq
              retpt (vl-catch-all-apply 'vlax-invoke-method
                                        (list vlaSurf 'IntersectPointWithSurface (vlax-3d-point pt1) vDirection)))))
      (progn (vla-addpoint modelspace retpt) (ssadd (entlast) newss)))
    (setq i (1+ i)))
  (if (/= (sslength newss) 0)
    (sssetfirst nil newss)
    (princ "\nNo intersection found"))
  (*error* "end"))
(prompt "Type GIP to find intersection with surface. Needs 2 points to define vector.")&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Dec 2016 21:41:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-forum/project-a-line-to-a-surface-command/m-p/6766614#M192951</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2016-12-22T21:41:07Z</dc:date>
    </item>
  </channel>
</rss>

