<?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: Lisp to set waterdrop width in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9715423#M7904</link>
    <description>Yes, I noticed that as well. I'm looking into it now.</description>
    <pubDate>Thu, 27 Aug 2020 15:08:20 GMT</pubDate>
    <dc:creator>Jeff_M</dc:creator>
    <dc:date>2020-08-27T15:08:20Z</dc:date>
    <item>
      <title>Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711316#M7894</link>
      <description>&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to amend the waterdrop command to set the layer and width of the 2d polyline it creates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The layer changes ok, but the plinewid variabe doesnt apply to the polyline created.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any ideas?&amp;nbsp;&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;&lt;FONT color="#FF0000"&gt;(command "_.undefine" "AeccCreateSurfaceWaterDrop")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(defun C:AeccCreateSurfaceWaterDrop () (setvar 'clayer "Surface Water Flow Path") (setvar 'plinewid 0.1) (command "_.AeccCreateSurfaceWaterDrop"))&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Aug 2020 18:14:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711316#M7894</guid>
      <dc:creator>M_c3d</dc:creator>
      <dc:date>2020-08-25T18:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711376#M7895</link>
      <description>&lt;P&gt;This should do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(defun C:AeccCreateSurfaceWaterDrop (/ PLINE plines lastent)
  (setq lastent (entlast))
  (command "_.AeccCreateSurfaceWaterDrop")
  (while (= 1 (getvar 'cmdactive))
    (command PAUSE)
    (if (/= (entlast) lastent)
      (setq plines (cons (entlast) plines))
      )
    )
  (foreach ent plines
    (setq pline (vlax-ename-&amp;gt;vla-object ent))
    (vla-put-constantwidth pline 0.1)
    (vla-put-layer pline "Surface Water Flow Path")
    )
  (princ)
  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 22:27:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711376#M7895</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2020-08-25T22:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711675#M7896</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help, it comes up with the error noted below.&amp;nbsp; The layer for the polyline created hasn't changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;Command: AECCCREATESURFACEWATERDROP&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;_.AeccCreateSurfaceWaterDrop&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;Surface: Surface1 (1)&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;Select point:&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;Select point:&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;Command: ; error: ActiveX Server returned the error: unknown name: ConstantWidth&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 21:50:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711675#M7896</guid>
      <dc:creator>M_c3d</dc:creator>
      <dc:date>2020-08-25T21:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711705#M7897</link>
      <description>What C3D version are you using? I tested this in C3D 2018 and it worked well.</description>
      <pubDate>Tue, 25 Aug 2020 22:18:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711705#M7897</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2020-08-25T22:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711707#M7898</link>
      <description>&lt;P&gt;r2021&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 22:19:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711707#M7898</guid>
      <dc:creator>M_c3d</dc:creator>
      <dc:date>2020-08-25T22:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711723#M7899</link>
      <description>Add the line (vl-load-com) to the start of the lisp. Also, I changed the code I posted above to add the plines and lastent variables to the locals list.</description>
      <pubDate>Tue, 25 Aug 2020 22:33:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711723#M7899</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2020-08-25T22:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711741#M7900</link>
      <description>&lt;P&gt;It still comes up with the error;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Command: ; error: ActiveX Server returned the error: unknown name: ConstantWidth&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to check, current lisp below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;(vl-load-com)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(defun C:AeccCreateSurfaceWaterDrop (/ PLINE)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(setq lastent (entlast))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(command "_.AeccCreateSurfaceWaterDrop")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(while (= 1 (getvar 'cmdactive))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(command PAUSE)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(if (/= (entlast) lastent)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(setq plines (cons (entlast) plines))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(foreach ent plines&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(setq pline (vlax-ename-&amp;gt;vla-object ent))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(vla-put-constantwidth pline 0.1)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(vla-put-layer pline "Surface Water Flow Path")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(princ)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 22:48:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711741#M7900</guid>
      <dc:creator>M_c3d</dc:creator>
      <dc:date>2020-08-25T22:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711780#M7901</link>
      <description>&lt;P&gt;Strange. I just tested it in C3D 2021 and it works fine. Wait, looks like you have the Waterdrop tool creating 3d polylines. The default is 2d. 3dPolys do not have a width property. This accounts for either a 2d or 3d poly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(command "_.undefine" "AeccCreateSurfaceWaterDrop")
(defun C:AeccCreateSurfaceWaterDrop (/ PLINE LASTENT PLINES)
  (setq lastent (entlast))
  (command "_.AeccCreateSurfaceWaterDrop")
  (while (= 1 (getvar 'cmdactive))
    (command PAUSE)
    (if (/= (entlast) lastent)
      (setq plines (cons (entlast) plines))
      )
    )
  (foreach ent plines
    (setq pline (vlax-ename-&amp;gt;vla-object ent))
    (if (/= "AcDb3dPolyline" (vla-get-objectname pline))
      (vla-put-constantwidth pline 0.1)
      )
    (vla-put-layer pline "Surface Water Flow Path")
    )
  (princ)
  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 23:15:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9711780#M7901</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2020-08-25T23:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9713672#M7902</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;I still couldn't get it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did a reset of civil 3d and then added the lisp to the&amp;nbsp;acaddoc.lsp file and suddenly it now works brilliantly! Not sure why it needed a reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, appreciate your help&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 19:42:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9713672#M7902</guid>
      <dc:creator>M_c3d</dc:creator>
      <dc:date>2020-08-26T19:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9715347#M7903</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/32637"&gt;@Jeff_M&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've noticed that it sometimes leaves some of the flow paths as they were rather than changing the layer and width.&amp;nbsp; Any ideas?&amp;nbsp; I've attached a gif of it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Flow path.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/812098iAE9A75DCA577F88A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Flow path.gif" alt="Flow path.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 14:32:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9715347#M7903</guid>
      <dc:creator>M_c3d</dc:creator>
      <dc:date>2020-08-27T14:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9715423#M7904</link>
      <description>Yes, I noticed that as well. I'm looking into it now.</description>
      <pubDate>Thu, 27 Aug 2020 15:08:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9715423#M7904</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2020-08-27T15:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to set waterdrop width</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9715471#M7905</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3783615"&gt;@M_c3d&lt;/a&gt;&amp;nbsp;here is a version that checks for the existence of the desired layer, creates it if needed, sets the C3D command setting for the waterdrop layer, creates the plines, then correctly changes the width of the plines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(command "_.undefine" "AeccCreateSurfaceWaterDrop")
(vl-load-com)
(defun C:AeccCreateSurfaceWaterDrop (/ PLINE LASTENT c3d c3ddoc surfsetting dwg layer layername)
  (setq layername "Surface Water Flow Path")
  (if (not (tblsearch "Layer" layername))
    (progn
      (setq dwg (vla-get-activedocument (vlax-get-acad-object)))
      (setq layer (vla-add (vla-get-layers dwg) layername))
      (vla-put-color layer 4)
      ;;here you can set the layer color and linetype
      )
    )
  
  (setq C3D (strcat "HKEY_LOCAL_MACHINE\\"
			     (if vlax-user-product-key
			       (vlax-user-product-key)
			       (vlax-product-key)
			     )
		     )
		 C3D (vl-registry-read C3D "Release")
		 C3D (substr C3D
			     1
			     (vl-string-search
			       "."
			       C3D
			       (+ (vl-string-search "." C3D) 1)
			     )
		     )
		 C3D (vla-getinterfaceobject
		       (vlax-get-acad-object)
		       (strcat "AeccXUiLand.AeccApplication." C3D)
		     )
	   )
  (setq C3Ddoc (vla-get-activedocument C3D))
  (setq surfsetting (vlax-get (vlax-get (vlax-get c3ddoc 'settings) 'surfacecommandssettings) 'createsurfacewaterdropsettings))
  (vlax-put (vlax-get surfsetting 'pathlayer) 'value layername)
  (setq lastent (entlast))
  (command "_.AeccCreateSurfaceWaterDrop")
  (while (= 1 (getvar 'cmdactive))
    (command PAUSE)
    )
  (while (setq lastent (entnext lastent))
    (setq pline (vlax-ename-&amp;gt;vla-object lastent))
    (if (/= "AcDb3dPolyline" (vla-get-objectname pline))
      (vla-put-constantwidth pline 0.1)
      )
    )
  (princ)
  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 15:25:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/lisp-to-set-waterdrop-width/m-p/9715471#M7905</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2020-08-27T15:25:15Z</dc:date>
    </item>
  </channel>
</rss>

