<?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 : Not Skipping Attribute in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6901766#M32646</link>
    <description>&lt;P&gt;Try this one (ObjId is supposed to be assign to some block reference you want to get the attribute values):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Using tr As Transaction = db.TransactionManager.StartTransaction()
    Dim bt As BlockTable = DirectCast(tr.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
    If bt.Has(blockName) Then
        Dim btr As BlockTableRecord = DirectCast(tr.GetObject(bt(blockName), OpenMode.ForRead), BlockTableRecord)
	Dim br As BlockReference = DirectCast(tr.GetObject(ObjId, OpenMode.ForRead), BlockReference)
        For Each id As ObjectId In btr
            If id.ObjectClass.DxfName = "ATTDEF" Then
                Dim attDef As AttributeDefinition = DirectCast(tr.GetObject(id, OpenMode.ForRead), AttributeDefinition)
		If System.Text.RegularExpressions.Regex.Match(attDef.Tag, "initials", RegexOptions.IgnoreCase) Then
		    MsgBox("Skipping " &amp;amp; attDef.Tag)
                Else
		    Dim attRef As AttributeReference = DirectCast(tr.GetObject(br.AttributeCollection(z), OpenMode.ForRead), AttributeReference)
                    tagList.Add(attDef.Tag)
                    textList.Add(attRef.TextString)
		    z += 1
                End If
            End If
        Next&lt;BR /&gt;    Else&lt;BR /&gt;        MsgBox("Block " &amp;amp; blockName &amp;amp; " not found.")
    End If
    tr.Commit()
End Using&lt;/PRE&gt;
&lt;P&gt;it would be easier for those who are trying to help you if provide some drawing with the block.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2017 16:49:24 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2017-02-24T16:49:24Z</dc:date>
    <item>
      <title>Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6893005#M32628</link>
      <description>&lt;P&gt;I have the below code as a means of transferring attribute values from one place to another. &amp;nbsp;Within it I'm trying to make it skip a specific attribute with a tag "INITIALS". &amp;nbsp;The message box within the code is there to test the If/Else/EndIf. &amp;nbsp;It works. &amp;nbsp;The message only pops up when it hits that attribute. &amp;nbsp;Yet the result is the attribute with the tag "INITIALS" is still added to the list. &amp;nbsp;Any ideas as to why it works but doesn't?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            Using AcTrans As Transaction = AcDb.TransactionManager.StartTransaction()
                Dim bt As BlockTable = AcTrans.GetObject(AcDb.BlockTableId, OpenMode.ForRead, False, True)
                For Each id As ObjectId In bt
                    Dim btr As BlockTableRecord = DirectCast(AcTrans.GetObject(id, OpenMode.ForRead), BlockTableRecord)
                    If btr.Name.ToUpper = BlkName.ToUpper Then
                        For Each ObjId As ObjectId In btr.GetBlockReferenceIds(False, False)
                            Dim br As BlockReference = AcTrans.GetObject(ObjId, OpenMode.ForRead)
                            If br.Name = BlkName Then
                                Dim z As Integer = 0
                                For Each obj1 As ObjectId In btr
                                    obj = AcTrans.GetObject(obj1, OpenMode.ForRead)
                                    If TypeOf obj Is AttributeDefinition Then
                                        Dim AttDef As AttributeDefinition = obj
                                        Dim AttRef As AttributeReference = CType(AcTrans.GetObject(br.AttributeCollection(z), OpenMode.ForRead), AttributeReference)
                                        If AttDef.Tag = "INITIALS" Then
                                            MsgBox("Skipping INITIALS")
                                        ElseIf AttDef.Tag = "INITIALS" = False Then
                                            taglist.Add(AttDef.Tag)
                                            txtlist.Add(AttRef.TextString)
                                            z = z + 1
                                        End If
                                    End If
                                Next
                            End If
                        Next
                    End If
                Next
                AcTrans.Commit()
            End Using&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Feb 2017 15:47:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6893005#M32628</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-21T15:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6893196#M32629</link>
      <description>&lt;P&gt;I'm not very familiar with VB.net but&amp;nbsp;two equal signs in your condition looks wonky. Try changing:&lt;/P&gt;
&lt;PRE&gt;ElseIf AttDef.Tag = "INITIALS" = False Then&lt;/PRE&gt;
&lt;P&gt;to this:&lt;/P&gt;
&lt;PRE&gt;ElseIf AttDef.Tag &amp;lt;&amp;gt; "INITIALS" Then&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/cey92b0t.aspx?f=255&amp;amp;MSPPError=-2147217396" target="_blank"&gt;https://msdn.microsoft.com/en-us/library/cey92b0t.aspx?f=255&amp;amp;MSPPError=-2147217396&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 16:56:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6893196#M32629</guid>
      <dc:creator>jabowabo</dc:creator>
      <dc:date>2017-02-21T16:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6895718#M32630</link>
      <description>&lt;P&gt;I think what you want is this (not sure about VB syntax):&lt;/P&gt;
&lt;PRE&gt;If AttDef.Tag = "INITIALS" Then
  MsgBox("Skipping INITIALS")
Else          &amp;lt;--------------  means AttDef.Tag is not = "INITIALS" - no need for "ElseIf"&lt;BR /&gt;  taglist.Add(AttDef.Tag)
  txtlist.Add(AttRef.TextString)
  z = z + 1
End If&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 15:02:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6895718#M32630</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2017-02-22T15:02:08Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6895865#M32631</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If: skip a specific attribute with a tag "INITIALS" means process all attributes which tag is not "INITIALS", instead of this ugly and verbose statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;If AttDef.Tag = "INITIALS" Then
    MsgBox("Skipping INITIALS")
ElseIf AttDef.Tag = "INITIALS" = False Then
    taglist.Add(AttDef.Tag)
    txtlist.Add(AttRef.TextString)
    z = z + 1
End If&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;simply do:&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;PRE&gt;If AttDef.Tag &amp;lt;&amp;gt; "INITIALS" Then
    taglist.Add(AttDef.Tag)
    txtlist.Add(AttRef.TextString)
    z += 1
End If&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 16:00:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6895865#M32631</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-02-22T16:00:27Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6897316#M32632</link>
      <description>&lt;P&gt;No go on all provided suggestions. &amp;nbsp;The attdef.tag of INITIALS is still brought forward. &amp;nbsp;That's what I don't understand because using the msgbox to test which IF is being run it runs as correct but it still grabs the INITIALS attribute.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 00:21:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6897316#M32632</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-23T00:21:35Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6897331#M32633</link>
      <description>&lt;P&gt;Hi Ron.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your code, I don't see the purpose of opening AttributeDefinitions at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The AttributeReference.TagString property holds the attribute's tag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 00:35:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6897331#M32633</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-02-23T00:35:10Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6897772#M32634</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's your code after some cleanup and optimization.&lt;/P&gt;
&lt;P&gt;It should work if there's no type in "INITIALS".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;C#&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;            using (var tr = db.TransactionManager.StartTransaction())
            {
                var bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
                if (bt.Has(blockName))
                {
                    var btr = (BlockTableRecord)tr.GetObject(bt[blockName], OpenMode.ForRead);
                    foreach (ObjectId id in btr)
                    {
                        if (id.ObjectClass.DxfName == "ATTDEF")
                        {
                            var attDef = (AttributeDefinition)tr.GetObject(id, OpenMode.ForRead);
                            if (attDef.Tag != "INITIALS")
                            {
                                var attRef = (AttributeReference)tr.GetObject(br.AttributeCollection[z], OpenMode.ForRead);
                                tagList.Add(attDef.Tag);
                                textList.Add(attRef.TextString);
                            }
                        }
                    }
                }
                tr.Commit();
            }&lt;/PRE&gt;
&lt;P&gt;VB automatic conversion with Telerik&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;PRE&gt;Using tr As Transaction = db.TransactionManager.StartTransaction()
    Dim bt As BlockTable = DirectCast(tr.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
    If bt.Has(blockName) Then
	Dim btr As BlockTableRecord = DirectCast(tr.GetObject(bt(blockName), OpenMode.ForRead), BlockTableRecord)
	For Each id As ObjectId In btr
	    If id.ObjectClass.DxfName = "ATTDEF" Then
		Dim attDef As AttributeDefinition = DirectCast(tr.GetObject(id, OpenMode.ForRead), AttributeDefinition)
		If attDef.Tag &amp;lt;&amp;gt; "INITIALS" Then
		    Dim attRef As AttributeReference = DirectCast(tr.GetObject(br.AttributeCollection(z), OpenMode.ForRead), AttributeReference)
		    tagList.Add(attDef.Tag)
		    textList.Add(attRef.TextString)
		End If
	    End If
	Next
    End If
    tr.Commit()
End Using

'=======================================================
'Service provided by Telerik (www.telerik.com)
'Conversion powered by NRefactory.
'Twitter: @telerik
'Facebook: facebook.com/telerik
'=======================================================&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 08:19:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6897772#M32634</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-02-23T08:19:41Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898087#M32635</link>
      <description>&lt;P&gt;Another little optimization: we do not know anything about 'br' and 'z', but it looks like you could open the attribute reference only once instead of&amp;nbsp; each loop.&lt;/P&gt;
&lt;P&gt;You can also upper case the attribute definition tag before comparing it to "INITIALS"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Using tr As Transaction = db.TransactionManager.StartTransaction()
    Dim bt As BlockTable = DirectCast(tr.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
    If bt.Has(blockName) Then
        Dim btr As BlockTableRecord = DirectCast(tr.GetObject(bt(blockName), OpenMode.ForRead), BlockTableRecord)
        Dim attRef As AttributeReference = DirectCast(tr.GetObject(br.AttributeCollection(z), OpenMode.ForRead), AttributeReference)
        For Each id As ObjectId In btr
            If id.ObjectClass.DxfName = "ATTDEF" Then
                Dim attDef As AttributeDefinition = DirectCast(tr.GetObject(id, OpenMode.ForRead), AttributeDefinition)
                If attDef.Tag.ToUpper() &amp;lt;&amp;gt; "INITIALS" Then
                    tagList.Add(attDef.Tag)
                    textList.Add(attRef.TextString)
                End If
            End If
        Next
    End If
    tr.Commit()
End Using&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Feb 2017 11:05:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898087#M32635</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-02-23T11:05:54Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898117#M32636</link>
      <description>&lt;P&gt;There are about 40 attributes that I'm iterating from one block to another minus the attribute with the tag INITIALS.&amp;nbsp; "br" is the blockreference, z is a list count used later.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 11:21:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898117#M32636</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-23T11:21:02Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898157#M32637</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;What I wanted to say is that as 'z' is not incremented in the For Each loop the attribute is the same every time, so it's more efficient to open it before the loop.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Anyway, did you try it? the attribute tagged "INITIALS" should be skipped, if not, it's a typo issue (case or non-printable characters) in the attribute tag.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 11:41:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898157#M32637</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-02-23T11:41:37Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898177#M32638</link>
      <description>&lt;P&gt;I tried it.&amp;nbsp; In it you referenced br without defining it.&amp;nbsp; Working on it now.&amp;nbsp; And thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 11:55:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898177#M32638</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-23T11:55:29Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898200#M32639</link>
      <description>&lt;P&gt;Removed reference AttRef (Attribute Reference) completely.&amp;nbsp; Works.&amp;nbsp; Thank you all for help.&amp;nbsp; Partial solution to all as&amp;nbsp;I combined some suggestions that were outside the question.&amp;nbsp; Thank you all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            Using AcTrans As Transaction = AcDb.TransactionManager.StartTransaction()
                Dim bt As BlockTable = DirectCast(AcTrans.GetObject(AcDb.BlockTableId, OpenMode.ForRead), BlockTable)
                If bt.Has(BlkName) Then
                    Dim btr As BlockTableRecord = DirectCast(AcTrans.GetObject(bt(BlkName), OpenMode.ForRead), BlockTableRecord)
                    'Dim attRef As AttributeReference = DirectCast(AcTrans.GetObject(br.AttributeCollection(z), OpenMode.ForRead), AttributeReference)
                    For Each id As ObjectId In btr
                        If id.ObjectClass.DxfName = "ATTDEF" Then
                            Dim attDef As AttributeDefinition = DirectCast(AcTrans.GetObject(id, OpenMode.ForRead), AttributeDefinition)
                            If attDef.Tag.ToUpper() &amp;lt;&amp;gt; "INITIALS" Then
                                taglist.Add(attDef.Tag)
                                txtlist.Add(attDef.TextString)
                            End If
                        End If
                    Next
                End If
                AcTrans.Commit()
            End Using&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Feb 2017 12:14:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898200#M32639</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-23T12:14:08Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898205#M32640</link>
      <description>&lt;P&gt;Oops!...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this one should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Using tr As Transaction = db.TransactionManager.StartTransaction()
    Dim bt As BlockTable = DirectCast(tr.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
    If bt.Has(blockName) Then
        Dim btr As BlockTableRecord = DirectCast(tr.GetObject(bt(blockName), OpenMode.ForRead), BlockTableRecord)
	Dim br As BlockReference = tr.GetObject(ObjId, OpenMode.ForRead)
        For Each id As ObjectId In btr
            If id.ObjectClass.DxfName = "ATTDEF" Then
                Dim attDef As AttributeDefinition = DirectCast(tr.GetObject(id, OpenMode.ForRead), AttributeDefinition)
                If attDef.Tag.ToUpper() &amp;lt;&amp;gt; "INITIALS" Then
		    Dim attRef As AttributeReference = DirectCast(tr.GetObject(br.AttributeCollection(z), OpenMode.ForRead), AttributeReference)
                    tagList.Add(attDef.Tag)
                    textList.Add(attRef.TextString)
		    z += 1
                End If
            End If
        Next
    End If
    tr.Commit()
End Using&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 12:18:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898205#M32640</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-02-23T12:18:59Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898206#M32641</link>
      <description>&lt;P&gt;**** I jumped too quick.&amp;nbsp; Without the block reference it grabs no attributes.&amp;nbsp; Back into it.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 12:16:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898206#M32641</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-23T12:16:26Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898246#M32642</link>
      <description>&lt;P&gt;Doesn't declare ObjID.&amp;nbsp; I think what might be missing from my explanation is that I have to first iterate through all blocks to find the specific one, then pull the attributes out of that one.&amp;nbsp; Starting with my original it does just that except it doesn't skip the attribute with the tag 'INITIALS'.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 12:43:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6898246#M32642</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-23T12:43:17Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6899091#M32643</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Ron_M a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;Doesn't declare ObjID. &lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I cannot know more about your code than what you posted in the original post (where ObjectId is not declared)...&lt;BR /&gt;&lt;BR /&gt;The code I provided is just to replace the code you posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 17:43:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6899091#M32643</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-02-23T17:43:10Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6900511#M32644</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Ron_M a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;I have to first iterate through all blocks to find the specific one, then pull the attributes out of that one..&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, you do not need to iterate all the block table to find a specific bloc.&lt;/P&gt;
&lt;P&gt;SymbolTable derived types (as BlockTable) have an indexor which allows to directly get a SymbolTableRecord from uts name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please, attentively compare the code of your first post with the last one I provided, it exactly does the same but in a more efficient and logical way.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 07:38:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6900511#M32644</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-02-24T07:38:52Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6901102#M32645</link>
      <description>&lt;P&gt;I directly copy/paste your code in and it shows error in that it doesn't define br or the block reference which leads to not having the object id.&amp;nbsp; We're getting way off track anyway.&amp;nbsp; I didn't and still don't have an issue with getting the block.&amp;nbsp; Your suggestions, and those of others, directly copied or modify does not skip the attribute when pulling lists of tags and text strings.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 12:52:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6901102#M32645</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-24T12:52:35Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6901766#M32646</link>
      <description>&lt;P&gt;Try this one (ObjId is supposed to be assign to some block reference you want to get the attribute values):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Using tr As Transaction = db.TransactionManager.StartTransaction()
    Dim bt As BlockTable = DirectCast(tr.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
    If bt.Has(blockName) Then
        Dim btr As BlockTableRecord = DirectCast(tr.GetObject(bt(blockName), OpenMode.ForRead), BlockTableRecord)
	Dim br As BlockReference = DirectCast(tr.GetObject(ObjId, OpenMode.ForRead), BlockReference)
        For Each id As ObjectId In btr
            If id.ObjectClass.DxfName = "ATTDEF" Then
                Dim attDef As AttributeDefinition = DirectCast(tr.GetObject(id, OpenMode.ForRead), AttributeDefinition)
		If System.Text.RegularExpressions.Regex.Match(attDef.Tag, "initials", RegexOptions.IgnoreCase) Then
		    MsgBox("Skipping " &amp;amp; attDef.Tag)
                Else
		    Dim attRef As AttributeReference = DirectCast(tr.GetObject(br.AttributeCollection(z), OpenMode.ForRead), AttributeReference)
                    tagList.Add(attDef.Tag)
                    textList.Add(attRef.TextString)
		    z += 1
                End If
            End If
        Next&lt;BR /&gt;    Else&lt;BR /&gt;        MsgBox("Block " &amp;amp; blockName &amp;amp; " not found.")
    End If
    tr.Commit()
End Using&lt;/PRE&gt;
&lt;P&gt;it would be easier for those who are trying to help you if provide some drawing with the block.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 16:49:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6901766#M32646</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-02-24T16:49:24Z</dc:date>
    </item>
    <item>
      <title>Re : Not Skipping Attribute</title>
      <link>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6906957#M32647</link>
      <description>&lt;P&gt;Attached is a test block. I need to get all text strings from the block into a list so that they can then be placed back in an updated block without the INITIALS attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your latest still takes out the ObjId which I already have. Please move past that. My original post and code works EXCEPT, and ONLY EXCEPT that it does not skip the attribute with a tag of INITIALS. That is the ONLY thing not working. The msgbox fires as it is supposed to when it hits the attribute to be skipped.&amp;nbsp; Debug shows that the msgbox fires when it is supposed to.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 19:20:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/not-skipping-attribute/m-p/6906957#M32647</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-27T19:20:06Z</dc:date>
    </item>
  </channel>
</rss>

