<?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: in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327864#M91339</link>
    <description>this doesn't work.  is it different for autocad r14?&lt;BR /&gt;
Rob&lt;BR /&gt;
&lt;BR /&gt;
Trond Hasse Lie &lt;TROND_HASSE.LIE&gt; wrote in message&lt;BR /&gt;
news:ef344b5.0@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; This code should do the task. It does NOT however check to see if there&lt;BR /&gt;
&amp;gt; already is a block named "BlockX" before it renames one of the blocks:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Option Explicit&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Sub RenameBlocks()&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Dim oBlock As AcadBlock&lt;BR /&gt;
&amp;gt; Dim oBlocks As AcadBlocks&lt;BR /&gt;
&amp;gt; Dim intCounter As Integer&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Set oBlocks = ThisDrawing.Blocks&lt;BR /&gt;
&amp;gt; intCounter = 1&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; For Each oBlock In oBlocks&lt;BR /&gt;
&amp;gt;     If Not oBlock.IsXRef And Not oBlock.IsLayout Then&lt;BR /&gt;
&amp;gt;         If Len(oBlock.Name) &amp;gt; 31 Then&lt;BR /&gt;
&amp;gt;             oBlock.Name = "Block" &amp;amp; CStr(intCounter)&lt;BR /&gt;
&amp;gt;             intCounter = intCounter + 1&lt;BR /&gt;
&amp;gt;         End If&lt;BR /&gt;
&amp;gt;     End If&lt;BR /&gt;
&amp;gt; Next&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Trond Hasse Lie&lt;BR /&gt;
&amp;gt; Thrane Information Systems&lt;BR /&gt;
&amp;gt; Norway&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Hairball" &lt;AFOURLETTERWORD&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:ef344b5.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; &amp;gt; Using autocad14 how do I go through every block in a drawing and if the&lt;BR /&gt;
&amp;gt; &amp;gt; block name is over 31 characters I want to rename it to "block1",&lt;BR /&gt;
&amp;gt; "block2",&lt;BR /&gt;
&amp;gt; &amp;gt; etc.....  Any help is appreciated.&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; &amp;gt; Rob&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/AFOURLETTERWORD&gt;&lt;/TROND_HASSE.LIE&gt;</description>
    <pubDate>Fri, 11 Aug 2000 18:07:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2000-08-11T18:07:38Z</dc:date>
    <item>
      <title>block names</title>
      <link>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327859#M91334</link>
      <description>Using autocad14 how do I go through every block in a drawing and if the&lt;BR /&gt;
block name is over 31 characters I want to rename it to "block1", "block2",&lt;BR /&gt;
etc.....  Any help is appreciated.&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Rob</description>
      <pubDate>Fri, 11 Aug 2000 02:11:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327859#M91334</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-08-11T02:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: block names</title>
      <link>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327860#M91335</link>
      <description>This code should do the task. It does NOT however check to see if there&lt;BR /&gt;
already is a block named "BlockX" before it renames one of the blocks:&lt;BR /&gt;
&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
&lt;BR /&gt;
Sub RenameBlocks()&lt;BR /&gt;
&lt;BR /&gt;
Dim oBlock As AcadBlock&lt;BR /&gt;
Dim oBlocks As AcadBlocks&lt;BR /&gt;
Dim intCounter As Integer&lt;BR /&gt;
&lt;BR /&gt;
Set oBlocks = ThisDrawing.Blocks&lt;BR /&gt;
intCounter = 1&lt;BR /&gt;
&lt;BR /&gt;
For Each oBlock In oBlocks&lt;BR /&gt;
    If Not oBlock.IsXRef And Not oBlock.IsLayout Then&lt;BR /&gt;
        If Len(oBlock.Name) &amp;gt; 31 Then&lt;BR /&gt;
            oBlock.Name = "Block" &amp;amp; CStr(intCounter)&lt;BR /&gt;
            intCounter = intCounter + 1&lt;BR /&gt;
        End If&lt;BR /&gt;
    End If&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Trond Hasse Lie&lt;BR /&gt;
Thrane Information Systems&lt;BR /&gt;
Norway&lt;BR /&gt;
&lt;BR /&gt;
"Hairball" &lt;AFOURLETTERWORD&gt; wrote in message&lt;BR /&gt;
news:ef344b5.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; Using autocad14 how do I go through every block in a drawing and if the&lt;BR /&gt;
&amp;gt; block name is over 31 characters I want to rename it to "block1",&lt;BR /&gt;
"block2",&lt;BR /&gt;
&amp;gt; etc.....  Any help is appreciated.&lt;BR /&gt;
&amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; Rob&lt;BR /&gt;
&amp;gt;&lt;/AFOURLETTERWORD&gt;</description>
      <pubDate>Fri, 11 Aug 2000 06:48:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327860#M91335</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-08-11T06:48:26Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327861#M91336</link>
      <description>This will not do you much good since you cannot have a block name of more&lt;BR /&gt;
than 31 characters in AutoCAD R14. Not sure what you are trying to acheive.&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
&lt;BR /&gt;
"Trond Hasse Lie" &lt;TROND_HASSE.LIE&gt; wrote in message&lt;BR /&gt;
news:ef344b5.0@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; This code should do the task. It does NOT however check to see if there&lt;BR /&gt;
&amp;gt; already is a block named "BlockX" before it renames one of the blocks:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Option Explicit&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Sub RenameBlocks()&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Dim oBlock As AcadBlock&lt;BR /&gt;
&amp;gt; Dim oBlocks As AcadBlocks&lt;BR /&gt;
&amp;gt; Dim intCounter As Integer&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Set oBlocks = ThisDrawing.Blocks&lt;BR /&gt;
&amp;gt; intCounter = 1&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; For Each oBlock In oBlocks&lt;BR /&gt;
&amp;gt;     If Not oBlock.IsXRef And Not oBlock.IsLayout Then&lt;BR /&gt;
&amp;gt;         If Len(oBlock.Name) &amp;gt; 31 Then&lt;BR /&gt;
&amp;gt;             oBlock.Name = "Block" &amp;amp; CStr(intCounter)&lt;BR /&gt;
&amp;gt;             intCounter = intCounter + 1&lt;BR /&gt;
&amp;gt;         End If&lt;BR /&gt;
&amp;gt;     End If&lt;BR /&gt;
&amp;gt; Next&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Trond Hasse Lie&lt;BR /&gt;
&amp;gt; Thrane Information Systems&lt;BR /&gt;
&amp;gt; Norway&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Hairball" &lt;AFOURLETTERWORD&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:ef344b5.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; &amp;gt; Using autocad14 how do I go through every block in a drawing and if the&lt;BR /&gt;
&amp;gt; &amp;gt; block name is over 31 characters I want to rename it to "block1",&lt;BR /&gt;
&amp;gt; "block2",&lt;BR /&gt;
&amp;gt; &amp;gt; etc.....  Any help is appreciated.&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; &amp;gt; Rob&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/AFOURLETTERWORD&gt;&lt;/TROND_HASSE.LIE&gt;</description>
      <pubDate>Fri, 11 Aug 2000 12:48:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327861#M91336</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-08-11T12:48:43Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327862#M91337</link>
      <description>&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  I didn't the AutoCAD 14 bit..... but it MIGHT be a typo?&lt;BR /&gt;
&lt;BR /&gt;
Trond Hasse Lie&lt;BR /&gt;
Norway&lt;BR /&gt;
&lt;BR /&gt;
"Joe Sutphin" &lt;JOESU&gt; wrote in message&lt;BR /&gt;
news:ef344b5.1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; This will not do you much good since you cannot have a block name of more&lt;BR /&gt;
&amp;gt; than 31 characters in AutoCAD R14. Not sure what you are trying to&lt;BR /&gt;
acheive.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Joe&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Trond Hasse Lie" &lt;TROND_HASSE.LIE&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:ef344b5.0@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; &amp;gt; This code should do the task. It does NOT however check to see if there&lt;BR /&gt;
&amp;gt; &amp;gt; already is a block named "BlockX" before it renames one of the blocks:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Option Explicit&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Sub RenameBlocks()&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Dim oBlock As AcadBlock&lt;BR /&gt;
&amp;gt; &amp;gt; Dim oBlocks As AcadBlocks&lt;BR /&gt;
&amp;gt; &amp;gt; Dim intCounter As Integer&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Set oBlocks = ThisDrawing.Blocks&lt;BR /&gt;
&amp;gt; &amp;gt; intCounter = 1&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; For Each oBlock In oBlocks&lt;BR /&gt;
&amp;gt; &amp;gt;     If Not oBlock.IsXRef And Not oBlock.IsLayout Then&lt;BR /&gt;
&amp;gt; &amp;gt;         If Len(oBlock.Name) &amp;gt; 31 Then&lt;BR /&gt;
&amp;gt; &amp;gt;             oBlock.Name = "Block" &amp;amp; CStr(intCounter)&lt;BR /&gt;
&amp;gt; &amp;gt;             intCounter = intCounter + 1&lt;BR /&gt;
&amp;gt; &amp;gt;         End If&lt;BR /&gt;
&amp;gt; &amp;gt;     End If&lt;BR /&gt;
&amp;gt; &amp;gt; Next&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; End Sub&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Trond Hasse Lie&lt;BR /&gt;
&amp;gt; &amp;gt; Thrane Information Systems&lt;BR /&gt;
&amp;gt; &amp;gt; Norway&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; "Hairball" &lt;AFOURLETTERWORD&gt; wrote in message&lt;BR /&gt;
&amp;gt; &amp;gt; news:ef344b5.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Using autocad14 how do I go through every block in a drawing and if&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; block name is over 31 characters I want to rename it to "block1",&lt;BR /&gt;
&amp;gt; &amp;gt; "block2",&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; etc.....  Any help is appreciated.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Rob&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/AFOURLETTERWORD&gt;&lt;/TROND_HASSE.LIE&gt;&lt;/JOESU&gt;</description>
      <pubDate>Fri, 11 Aug 2000 13:01:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327862#M91337</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-08-11T13:01:38Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327863#M91338</link>
      <description>no, it's not a typo.  if you convert a 2000 drawing to 14 it will keep the&lt;BR /&gt;
block names too long so at work i can't xref things in.  that's why i'm&lt;BR /&gt;
making this program.&lt;BR /&gt;
Rob</description>
      <pubDate>Fri, 11 Aug 2000 15:31:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327863#M91338</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-08-11T15:31:46Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327864#M91339</link>
      <description>this doesn't work.  is it different for autocad r14?&lt;BR /&gt;
Rob&lt;BR /&gt;
&lt;BR /&gt;
Trond Hasse Lie &lt;TROND_HASSE.LIE&gt; wrote in message&lt;BR /&gt;
news:ef344b5.0@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; This code should do the task. It does NOT however check to see if there&lt;BR /&gt;
&amp;gt; already is a block named "BlockX" before it renames one of the blocks:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Option Explicit&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Sub RenameBlocks()&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Dim oBlock As AcadBlock&lt;BR /&gt;
&amp;gt; Dim oBlocks As AcadBlocks&lt;BR /&gt;
&amp;gt; Dim intCounter As Integer&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Set oBlocks = ThisDrawing.Blocks&lt;BR /&gt;
&amp;gt; intCounter = 1&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; For Each oBlock In oBlocks&lt;BR /&gt;
&amp;gt;     If Not oBlock.IsXRef And Not oBlock.IsLayout Then&lt;BR /&gt;
&amp;gt;         If Len(oBlock.Name) &amp;gt; 31 Then&lt;BR /&gt;
&amp;gt;             oBlock.Name = "Block" &amp;amp; CStr(intCounter)&lt;BR /&gt;
&amp;gt;             intCounter = intCounter + 1&lt;BR /&gt;
&amp;gt;         End If&lt;BR /&gt;
&amp;gt;     End If&lt;BR /&gt;
&amp;gt; Next&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Trond Hasse Lie&lt;BR /&gt;
&amp;gt; Thrane Information Systems&lt;BR /&gt;
&amp;gt; Norway&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Hairball" &lt;AFOURLETTERWORD&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:ef344b5.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; &amp;gt; Using autocad14 how do I go through every block in a drawing and if the&lt;BR /&gt;
&amp;gt; &amp;gt; block name is over 31 characters I want to rename it to "block1",&lt;BR /&gt;
&amp;gt; "block2",&lt;BR /&gt;
&amp;gt; &amp;gt; etc.....  Any help is appreciated.&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; &amp;gt; Rob&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/AFOURLETTERWORD&gt;&lt;/TROND_HASSE.LIE&gt;</description>
      <pubDate>Fri, 11 Aug 2000 18:07:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327864#M91339</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-08-11T18:07:38Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327865#M91340</link>
      <description>The code doesn't work in 14. As far as I can see, the BlockRenaming must be&lt;BR /&gt;
done in 2000 before saving to 14 format.&lt;BR /&gt;
&lt;BR /&gt;
And... When I tested, I made a block in 2000 with a 32 character name. When&lt;BR /&gt;
opening the drawing in 14, the blocks name consisted of only the 26 first&lt;BR /&gt;
charaters. Don't know why.....&lt;BR /&gt;
&lt;BR /&gt;
Trond Hasse Lie&lt;BR /&gt;
Norway&lt;BR /&gt;
&lt;BR /&gt;
"Rob" &lt;AFOURLETTERWORD&gt; wrote in message&lt;BR /&gt;
news:ef344b5.4@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; this doesn't work.  is it different for autocad r14?&lt;BR /&gt;
&amp;gt; Rob&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Trond Hasse Lie &lt;TROND_HASSE.LIE&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:ef344b5.0@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; &amp;gt; This code should do the task. It does NOT however check to see if there&lt;BR /&gt;
&amp;gt; &amp;gt; already is a block named "BlockX" before it renames one of the blocks:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Option Explicit&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Sub RenameBlocks()&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Dim oBlock As AcadBlock&lt;BR /&gt;
&amp;gt; &amp;gt; Dim oBlocks As AcadBlocks&lt;BR /&gt;
&amp;gt; &amp;gt; Dim intCounter As Integer&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Set oBlocks = ThisDrawing.Blocks&lt;BR /&gt;
&amp;gt; &amp;gt; intCounter = 1&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; For Each oBlock In oBlocks&lt;BR /&gt;
&amp;gt; &amp;gt;     If Not oBlock.IsXRef And Not oBlock.IsLayout Then&lt;BR /&gt;
&amp;gt; &amp;gt;         If Len(oBlock.Name) &amp;gt; 31 Then&lt;BR /&gt;
&amp;gt; &amp;gt;             oBlock.Name = "Block" &amp;amp; CStr(intCounter)&lt;BR /&gt;
&amp;gt; &amp;gt;             intCounter = intCounter + 1&lt;BR /&gt;
&amp;gt; &amp;gt;         End If&lt;BR /&gt;
&amp;gt; &amp;gt;     End If&lt;BR /&gt;
&amp;gt; &amp;gt; Next&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; End Sub&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Trond Hasse Lie&lt;BR /&gt;
&amp;gt; &amp;gt; Thrane Information Systems&lt;BR /&gt;
&amp;gt; &amp;gt; Norway&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; "Hairball" &lt;AFOURLETTERWORD&gt; wrote in message&lt;BR /&gt;
&amp;gt; &amp;gt; news:ef344b5.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Using autocad14 how do I go through every block in a drawing and if&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; block name is over 31 characters I want to rename it to "block1",&lt;BR /&gt;
&amp;gt; &amp;gt; "block2",&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; etc.....  Any help is appreciated.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Rob&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/AFOURLETTERWORD&gt;&lt;/TROND_HASSE.LIE&gt;&lt;/AFOURLETTERWORD&gt;</description>
      <pubDate>Fri, 11 Aug 2000 22:24:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327865#M91340</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-08-11T22:24:58Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327866#M91341</link>
      <description>and if you try to xref that drawing into another drawing it says the block&lt;BR /&gt;
name is too long.  so what's going on?&lt;BR /&gt;
Rob&lt;BR /&gt;
&lt;BR /&gt;
Trond Hasse Lie &lt;TROND_HASSE.LIE&gt; wrote in message&lt;BR /&gt;
news:4B8B4A7113723585ED51AF5BE6010C5A@in.WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; The code doesn't work in 14. As far as I can see, the BlockRenaming must&lt;BR /&gt;
be&lt;BR /&gt;
&amp;gt; done in 2000 before saving to 14 format.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; And... When I tested, I made a block in 2000 with a 32 character name.&lt;BR /&gt;
When&lt;BR /&gt;
&amp;gt; opening the drawing in 14, the blocks name consisted of only the 26 first&lt;BR /&gt;
&amp;gt; charaters. Don't know why.....&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Trond Hasse Lie&lt;BR /&gt;
&amp;gt; Norway&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Rob" &lt;AFOURLETTERWORD&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:ef344b5.4@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; &amp;gt; this doesn't work.  is it different for autocad r14?&lt;BR /&gt;
&amp;gt; &amp;gt; Rob&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Trond Hasse Lie &lt;TROND_HASSE.LIE&gt; wrote in message&lt;BR /&gt;
&amp;gt; &amp;gt; news:ef344b5.0@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; This code should do the task. It does NOT however check to see if&lt;BR /&gt;
there&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; already is a block named "BlockX" before it renames one of the blocks:&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Option Explicit&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Sub RenameBlocks()&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Dim oBlock As AcadBlock&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Dim oBlocks As AcadBlocks&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Dim intCounter As Integer&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Set oBlocks = ThisDrawing.Blocks&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; intCounter = 1&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; For Each oBlock In oBlocks&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;     If Not oBlock.IsXRef And Not oBlock.IsLayout Then&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;         If Len(oBlock.Name) &amp;gt; 31 Then&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;             oBlock.Name = "Block" &amp;amp; CStr(intCounter)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;             intCounter = intCounter + 1&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;         End If&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;     End If&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Next&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; End Sub&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Trond Hasse Lie&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Thrane Information Systems&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Norway&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; "Hairball" &lt;AFOURLETTERWORD&gt; wrote in message&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; news:ef344b5.-1@WebX.SaUCah8kaAW...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Using autocad14 how do I go through every block in a drawing and if&lt;BR /&gt;
&amp;gt; the&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; block name is over 31 characters I want to rename it to "block1",&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; "block2",&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; etc.....  Any help is appreciated.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Rob&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/AFOURLETTERWORD&gt;&lt;/TROND_HASSE.LIE&gt;&lt;/AFOURLETTERWORD&gt;&lt;/TROND_HASSE.LIE&gt;</description>
      <pubDate>Sat, 12 Aug 2000 02:05:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327866#M91341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-08-12T02:05:17Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327867#M91342</link>
      <description>Autodesk released a patch to R14, called BindTPtch.arx, which neatly&lt;BR /&gt;
addressed this problem.&lt;BR /&gt;
&lt;BR /&gt;
see (watch for word wrap):&lt;BR /&gt;
http://www3.autodesk.com/adsk/support/techdoc/0,,116068--273818-0_21837,00.h&lt;BR /&gt;
tml&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
R. Robert Bell, MCSE&lt;BR /&gt;
Xtending the Power&lt;BR /&gt;
www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
"Rob" &lt;AFOURLETTERWORD&gt; wrote in message&lt;BR /&gt;
news:ef344b5.3@WebX.SaUCah8kaAW...&lt;BR /&gt;
| no, it's not a typo.  if you convert a 2000 drawing to 14 it will keep the&lt;BR /&gt;
| block names too long so at work i can't xref things in.  that's why i'm&lt;BR /&gt;
| making this program.&lt;BR /&gt;
| Rob&lt;BR /&gt;
|&lt;/AFOURLETTERWORD&gt;</description>
      <pubDate>Sat, 12 Aug 2000 16:20:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/block-names/m-p/327867#M91342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-08-12T16:20:39Z</dc:date>
    </item>
  </channel>
</rss>

