<?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: Updating block attributes in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331038#M43403</link>
    <description>Ahh, well then you're in luck &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
What are your data integrity rules? Say for example, you have 10 blocks in a dwg, and you number them 1-10.  I open your dwg the next day and accidently erase #10.  Should the numbering be aware that a "10" really does exist, even though it's not int he dwg, or should the next number be '10'?</description>
    <pubDate>Thu, 19 May 2005 19:22:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-05-19T19:22:06Z</dc:date>
    <item>
      <title>Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331031#M43396</link>
      <description>I want to update a certain attribute of a block to hold an additional number. &lt;BR /&gt;
&lt;BR /&gt;
Example&lt;BR /&gt;
Tag XX: 1&lt;BR /&gt;
I want to make this TagXX: 1, n&lt;BR /&gt;
where n is a number I provide&lt;BR /&gt;
&lt;BR /&gt;
For another block in the same operation &lt;BR /&gt;
Tag XX: 1,2,6&lt;BR /&gt;
I want to make this Tag XX:1,2,6,n&lt;BR /&gt;
&lt;BR /&gt;
Any ideas?</description>
      <pubDate>Thu, 19 May 2005 17:22:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331031#M43396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T17:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331032#M43397</link>
      <description>Would you mind telling us a bit more about how many blocks you want to update, or what you're after?&lt;BR /&gt;
&lt;BR /&gt;
[code]&lt;BR /&gt;
Public Sub UPDATE_TB_of_sheet()&lt;BR /&gt;
    Dim oSS As AcadSelectionSet&lt;BR /&gt;
    Dim oBlkRef As AcadBlockReference&lt;BR /&gt;
    Dim vTB_Attribues As Variant&lt;BR /&gt;
    Dim i As Integer&lt;BR /&gt;
    Dim grpCode(0 To 1) As Integer&lt;BR /&gt;
    Dim dataVal(0 To 1) As Variant&lt;BR /&gt;
    &lt;BR /&gt;
    &lt;BR /&gt;
   ' Build a selection set of group codes and values to filter for: Text or Mtext.&lt;BR /&gt;
   grpCode(0) = 0&lt;BR /&gt;
   dataVal(0) = "INSERT" '&amp;lt;- object type = blocks&lt;BR /&gt;
   grpCode(1) = 2&lt;BR /&gt;
   dataVal(1) = "prof"   '&amp;lt;- the specific name of the block to search for&lt;BR /&gt;
    &lt;BR /&gt;
    'find all blocks&lt;BR /&gt;
    Set oSS = BuildSelectionSet("get 'em", grpCode, dataVal, True)&lt;BR /&gt;
    &lt;BR /&gt;
    'for each block found&lt;BR /&gt;
    For Each oBlkRef In oSS&lt;BR /&gt;
        If oBlkRef.HasAttributes = True Then&lt;BR /&gt;
            'get the blocks attributes&lt;BR /&gt;
            vTB_Attribues = oBlkRef.GetAttributes&lt;BR /&gt;
            'cycle thru each attribute until you find the one you want to modify..&lt;BR /&gt;
            For i = LBound(vTB_Attribues) To UBound(vTB_Attribues)&lt;BR /&gt;
                If vTB_Attribues(i).TagString = "DWG_NO" Then&lt;BR /&gt;
                    vTB_Attribues(i).TextString = "1050-05 ""T-1"""&lt;BR /&gt;
                End If&lt;BR /&gt;
            Next&lt;BR /&gt;
        End If&lt;BR /&gt;
    Next&lt;BR /&gt;
    &lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
EDIT:&lt;BR /&gt;
from another post you had:&lt;BR /&gt;
"i am trying to setup a situation where when i click on a button (custom) i can select multiple blocks (but not all the blocks) and then alter their attributes. I cant figure out how to let the user select some but not all blocks"&lt;BR /&gt;
&lt;BR /&gt;
Do you understand the selection set filters shown above? they allow the user to select ONLY what you specify.  In the above example, the user could only select blocks named prof.

Message was edited by: Oberer</description>
      <pubDate>Thu, 19 May 2005 17:59:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331032#M43397</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T17:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331033#M43398</link>
      <description>i would need to update as many blocks as the user selected &lt;BR /&gt;
i want the user to be able to select certain blocks and then assign them a number (which i will generate). since blocks could be selected in any combination there is a possibility one would already have a number assigned and others might not. i dont want to loose the previous values (numbers) just add to the list&lt;BR /&gt;
&lt;BR /&gt;
thus the question</description>
      <pubDate>Thu, 19 May 2005 18:58:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331033#M43398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T18:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331034#M43399</link>
      <description>"thus the question..."&lt;BR /&gt;
&lt;BR /&gt;
Ok.  Is there any chance the same block could be assigned a different number in a different drawing?&lt;BR /&gt;
In other words, could we both be working on the same project assigning these numbers to a block in different drawings?&lt;BR /&gt;
&lt;BR /&gt;
How are you planning on generating the values to assign?</description>
      <pubDate>Thu, 19 May 2005 19:05:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331034#M43399</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T19:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331035#M43400</link>
      <description>The numbers will just be sequential. The block could be in multiple drawings. But I dont want the attributes to change across them all. only in the drawing i am working on. &lt;BR /&gt;
&lt;BR /&gt;
is blocks not the right way to go then?</description>
      <pubDate>Thu, 19 May 2005 19:10:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331035#M43400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T19:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331036#M43401</link>
      <description>"is blocks not the right way to go then? "&lt;BR /&gt;
I'm hoping you'll be able to tell us &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
"The block could be in multiple drawings"&lt;BR /&gt;
So, I'll ask again. Is it possible that we both want to update block "a" in our own dwg, but you'd assign #1 and i'd assign #2 to the same block?&lt;BR /&gt;
&lt;BR /&gt;
If you need to maintain this number with the block, regardless of the drawing, then yes, i think you'll need to seek an alternate solution (like storing the values in a database)</description>
      <pubDate>Thu, 19 May 2005 19:13:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331036#M43401</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T19:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331037#M43402</link>
      <description>"Is it possible that we both want to update block "a" in our own dwg, but you'd assign #1 and i'd assign #2 to the same block?"&lt;BR /&gt;
&lt;BR /&gt;
yes it is possible&lt;BR /&gt;
&lt;BR /&gt;
What I want is that the numbers in one dwg be independent of those in another. the nos should be drawing specific</description>
      <pubDate>Thu, 19 May 2005 19:16:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331037#M43402</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T19:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331038#M43403</link>
      <description>Ahh, well then you're in luck &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
What are your data integrity rules? Say for example, you have 10 blocks in a dwg, and you number them 1-10.  I open your dwg the next day and accidently erase #10.  Should the numbering be aware that a "10" really does exist, even though it's not int he dwg, or should the next number be '10'?</description>
      <pubDate>Thu, 19 May 2005 19:22:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331038#M43403</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T19:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331039#M43404</link>
      <description>I am not numbering the blocks. Instead I am trying to create subsets which are identified with numbers and the subsets can overlap. So in you assigned #10 and then came back and deleted all the blocks in that subset, no, 10 should not be repeated</description>
      <pubDate>Thu, 19 May 2005 19:27:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331039#M43404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T19:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331040#M43405</link>
      <description>"So in you assigned #10 and then came back and deleted all the blocks in that subset, no, 10 should not be repeated "&lt;BR /&gt;
&lt;BR /&gt;
Then you can imagine the confusion we could create by having blocks erased.  So attributes may not the way to go...&lt;BR /&gt;
&lt;BR /&gt;
Secondly, since you're attempting to create this 'subset', are you going to want to group them, report on them?</description>
      <pubDate>Thu, 19 May 2005 19:33:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331040#M43405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T19:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331041#M43406</link>
      <description>"So attributes may not the way to go..."&lt;BR /&gt;
&lt;BR /&gt;
What elsE?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Secondly, since you're attempting to create this 'subset', are "you going to want to group them, report on them? "&lt;BR /&gt;
&lt;BR /&gt;
yes</description>
      <pubDate>Thu, 19 May 2005 19:51:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331041#M43406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T19:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block attributes</title>
      <link>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331042#M43407</link>
      <description>"What elsE?"&lt;BR /&gt;
writing records to a database, and many other options i don't know anything about &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; (xrecords?)&lt;BR /&gt;
&lt;BR /&gt;
RE: reporting - how are you planning on doing this?&lt;BR /&gt;
what would the report consist of?</description>
      <pubDate>Thu, 19 May 2005 19:53:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/updating-block-attributes/m-p/1331042#M43407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T19:53:49Z</dc:date>
    </item>
  </channel>
</rss>

