<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>CAD Forum discussion (EN) : VBA Coding</title>
  <link>https://www.cadforum.cz/forum_en/</link>
  <description><![CDATA[This is an XML content feed of; CAD Forum discussion (EN) : AutoCAD : VBA Coding]]></description>
  <pubDate>Sun, 31 May 2026 18:15:12 +0000</pubDate>
  <lastBuildDate>Fri, 31 Aug 2007 11:03:38 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://www.cadforum.cz/forum_en/RSS_post_feed.asp?TID=56</WebWizForums:feedURL>
  <image>
   <title><![CDATA[CAD Forum discussion (EN)]]></title>
   <url>https://www.cadforum.cz/forum_en/forum_images/web_wiz_forums.png</url>
   <link>https://www.cadforum.cz/forum_en/</link>
  </image>
  <item>
   <title><![CDATA[VBA Coding : Thanks Vladimir working cool. ...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=173&amp;title=vba-coding#173</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=371">GaryM</a><br /><strong>Subject:</strong> 56<br /><strong>Posted:</strong> 31.Aug.2007 at 11:03<br /><br /><img src="https://www.cadforum.cz/forum_en/smileys/smiley4.gif" border="0" align="absmiddle" alt="Big%20smile" />Thanks Vladimir working cool.]]>
   </description>
   <pubDate>Fri, 31 Aug 2007 11:03:38 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=173&amp;title=vba-coding#173</guid>
  </item> 
  <item>
   <title><![CDATA[VBA Coding : The code would be quite complex...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=142&amp;title=vba-coding#142</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=3">Vladimir Michl</a><br /><strong>Subject:</strong> 56<br /><strong>Posted:</strong> 28.Aug.2007 at 14:28<br /><br />The code would be quite complex - it would need to go through nested blocks, xrefs, etc.<DIV>&nbsp;</DIV><DIV>Try to use LAYDEL - with all following options on the commandline&nbsp;- e.g.:</DIV><DIV><strong>-LAYDEL Name mylayer</strong></DIV>]]>
   </description>
   <pubDate>Tue, 28 Aug 2007 14:28:57 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=142&amp;title=vba-coding#142</guid>
  </item> 
  <item>
   <title><![CDATA[VBA Coding : How would i write the code to...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=141&amp;title=vba-coding#141</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=371">GaryM</a><br /><strong>Subject:</strong> 56<br /><strong>Posted:</strong> 28.Aug.2007 at 14:16<br /><br />How would i write the code to remove all possible references.<br><br>And the Sendcommand "LAYDEL" just activates the command does not actually delete the layer,&nbsp; you still l need to do the normal steps after the laydel command is entered. <br><br>I want to delete from my delete layer form after selecting the layer from the combo box and clicking ok. <br>]]>
   </description>
   <pubDate>Tue, 28 Aug 2007 14:16:36 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=141&amp;title=vba-coding#141</guid>
  </item> 
  <item>
   <title><![CDATA[VBA Coding : You can either write the code...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=140&amp;title=vba-coding#140</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=3">Vladimir Michl</a><br /><strong>Subject:</strong> 56<br /><strong>Posted:</strong> 28.Aug.2007 at 13:47<br /><br />You can either write the code to remove all possible references to this layer or you can run LAYDEL from VBA (through SendCommand).]]>
   </description>
   <pubDate>Tue, 28 Aug 2007 13:47:15 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=140&amp;title=vba-coding#140</guid>
  </item> 
  <item>
   <title><![CDATA[VBA Coding : cool you are quite right.Autocad...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=138&amp;title=vba-coding#138</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=371">GaryM</a><br /><strong>Subject:</strong> 56<br /><strong>Posted:</strong> 28.Aug.2007 at 13:39<br /><br /><img src="https://www.cadforum.cz/forum_en/smileys/smiley1.gif" border="0" align="absmiddle" alt="Smile" /> cool you are quite right.<br><br>Autocad gives you the LAYDEL command where you can delete layers with all entities etc. Is there anything similar i could do with vba?<br><br>]]>
   </description>
   <pubDate>Tue, 28 Aug 2007 13:39:06 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=138&amp;title=vba-coding#138</guid>
  </item> 
  <item>
   <title><![CDATA[VBA Coding : The layer your are trying to delete...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=136&amp;title=vba-coding#136</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=3">Vladimir Michl</a><br /><strong>Subject:</strong> 56<br /><strong>Posted:</strong> 28.Aug.2007 at 13:27<br /><br />The layer your are trying to delete is probably not empty (contains entities,&nbsp;is referenced from a block, etc.). You can only delete empty layers in this way.]]>
   </description>
   <pubDate>Tue, 28 Aug 2007 13:27:05 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=136&amp;title=vba-coding#136</guid>
  </item> 
  <item>
   <title><![CDATA[VBA Coding : HINow i&amp;#039;m struggling to delete...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=135&amp;title=vba-coding#135</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=371">GaryM</a><br /><strong>Subject:</strong> 56<br /><strong>Posted:</strong> 28.Aug.2007 at 13:21<br /><br />HI<br><br>Now i'm struggling to delete a layer. How would i go about this...<br>Here is the code i'm using. What i'm actually trying to do is that i want to select from the combo box a layer to delete.<br><br>Here is the code i'm using;<br><br>Private Sub cmdOk_Click()<br>On Error Resume Next<br>&nbsp; Dim strLayerName As String<br>&nbsp; Dim objLayer As AcadLayer<br>&nbsp; <br>&nbsp; strLayerName = frmDelLayer.cboLayerName.Text<br>&nbsp; <br>&nbsp; Set objLayer = ThisDrawing.Layers(strLayerName)<br>&nbsp;&nbsp;&nbsp; If objLayer Is Nothing Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "Layer " &amp; strLayerName &amp; " not found"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Sub<br>&nbsp;&nbsp;&nbsp; End If<br>&nbsp; <br>&nbsp; objLayer.Delete<br>&nbsp;&nbsp;&nbsp; If Err Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "Unable to delete layer: " &amp; vbCr &amp; Err.Description<br>&nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "Layer '" &amp; strLayerName &amp; "' deleted"<br>&nbsp;&nbsp;&nbsp; End If  <br>&nbsp; End Sub<br><br>Giving me a error: "Object is referenced by other object(s)"<br><br>Any ideas on what i'm doing wrong.<br>]]>
   </description>
   <pubDate>Tue, 28 Aug 2007 13:21:02 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=135&amp;title=vba-coding#135</guid>
  </item> 
  <item>
   <title><![CDATA[VBA Coding : Yes, this is the ThisDrawing.Layers...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=134&amp;title=vba-coding#134</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=3">Vladimir Michl</a><br /><strong>Subject:</strong> 56<br /><strong>Posted:</strong> 28.Aug.2007 at 12:07<br /><br />Yes, this is the ThisDrawing.Layers iteration :-)]]>
   </description>
   <pubDate>Tue, 28 Aug 2007 12:07:20 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=134&amp;title=vba-coding#134</guid>
  </item> 
  <item>
   <title><![CDATA[VBA Coding : Thanks for the suggestion, but...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=133&amp;title=vba-coding#133</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=371">GaryM</a><br /><strong>Subject:</strong> 56<br /><strong>Posted:</strong> 28.Aug.2007 at 10:33<br /><br />Thanks for the suggestion, but came right doing it another way... check it out! <br><br>Private Sub UserForm_Activate()<br><br>&nbsp; Dim objLayers As AcadLayers<br>&nbsp; Dim objLayer As AcadLayer<br>&nbsp; <br>'search for layers in current drawing and add to combo box<br>For Each objLayer In ThisDrawing.Layers<br>&nbsp; frmDelLayer.cboLayerName.AddItem (objLayer.Name)<br>&nbsp; Next<br>End Sub<br><br><br><br>]]>
   </description>
   <pubDate>Tue, 28 Aug 2007 10:33:26 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=133&amp;title=vba-coding#133</guid>
  </item> 
  <item>
   <title><![CDATA[VBA Coding : You can look at the ThisDrawing.Layers...]]></title>
   <link>https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=125&amp;title=vba-coding#125</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.cadforum.cz/forum_en/member_profile.asp?PF=3">Vladimir Michl</a><br /><strong>Subject:</strong> 56<br /><strong>Posted:</strong> 24.Aug.2007 at 22:21<br /><br />You can look at the <EM><strong>ThisDrawing.Layers</strong></EM> collection and iterate through it.]]>
   </description>
   <pubDate>Fri, 24 Aug 2007 22:21:33 +0000</pubDate>
   <guid isPermaLink="true">https://www.cadforum.cz/forum_en/forum_posts.asp?TID=56&amp;PID=125&amp;title=vba-coding#125</guid>
  </item> 
 </channel>
</rss>