<?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: XData problem in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/xdata-problem/m-p/3259504#M58009</link>
    <description>&lt;P&gt;&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.autodesk.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;Only way to fly!&lt;/P&gt;</description>
    <pubDate>Mon, 12 Dec 2011 17:37:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-12-12T17:37:32Z</dc:date>
    <item>
      <title>XData problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/xdata-problem/m-p/3258102#M58006</link>
      <description>&lt;P&gt;I have used Kean Walmsley's article &lt;A target="_blank" href="http://through-the-interface.typepad.com/through_the_interface/2007/04/adding_xdata_to.html"&gt;http://through-the-interface.typepad.com/through_the_interface/2007/04/adding_xdata_to.html&lt;/A&gt; as a basis for trying to add xdata to a block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add the handle of another object to the block. Here is the code:-&lt;/P&gt;&lt;PRE&gt;   Private Sub Insert(ByVal tr As Transaction, ByVal Name As String, ByVal Path As String, _
                            ByVal Scale As Integer, ByVal ip As Point3d, ByVal Hwnd As Handle)
      Dim btr As BlockTableRecord = CType(tr.GetObject(CurDb.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord)
      Dim BlkId As ObjectId = CreateBlockReference(tr, Name, Path, btr)                '  insert blockreference
      Dim blk As BlockReference = New BlockReference(ip, BlkId)                        '  insert block
      blk.SetDatabaseDefaults()
      blk.ScaleFactors = New Scale3d(Scale, Scale, 1)
      blk.Rotation = 0
      btr.AppendEntity(blk)
      tr.AddNewlyCreatedDBObject(blk, True)                                            '  add it to transaction
      AddRegAppTableRecord(tr, "MYXDATA")
      Dim values() As TypedValue = {New TypedValue(1001, "MYXDATA"), New TypedValue(DxfCode.Handle, Hwnd)}
      Dim rb As New ResultBuffer(values)
      blk.XData = rb
      rb.Dispose()
   End Sub
   Private Sub AddRegAppTableRecord(ByVal tr As Transaction, ByVal regAppName As String)
      Dim rat As RegAppTable = DirectCast(tr.GetObject(CurDb.RegAppTableId, OpenMode.ForRead, False), RegAppTable)
      If Not rat.Has(regAppName) Then
         rat.UpgradeOpen()
         Dim ratr As New RegAppTableRecord()
         ratr.Name = regAppName
         rat.Add(ratr)
         tr.AddNewlyCreatedDBObject(ratr, True)
      End If
   End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I get the following error:- eInvalidInput&lt;/P&gt;&lt;P&gt;at the line blk.Xdata = rb&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2011 11:05:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/xdata-problem/m-p/3258102#M58006</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-10T11:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: XData problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/xdata-problem/m-p/3258106#M58007</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first guess:&lt;/P&gt;&lt;P&gt;don't use this: &lt;FONT color="#666699" face="lucida sans unicode,lucida sans"&gt;New TypedValue(DxfCode.Handle, Hwnd)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;instead try this: &lt;FONT color="#666699" face="lucida sans unicode,lucida sans"&gt;New TypedValue(DxfCode.ExtendedDataHandle, Hwnd)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The DxfCode.Handle can only exist once for an object, and that's the object's handle, not a referenced handle from another entity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH, - alfred -&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2011 11:15:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/xdata-problem/m-p/3258106#M58007</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2011-12-10T11:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: XData problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/xdata-problem/m-p/3259276#M58008</link>
      <description>&lt;P&gt;Let me guess - .Handle is DXF code 5, .ExtendedDataHandle is DXF code 1005?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2011 16:00:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/xdata-problem/m-p/3259276#M58008</guid>
      <dc:creator>dgorsman</dc:creator>
      <dc:date>2011-12-12T16:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: XData problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/xdata-problem/m-p/3259504#M58009</link>
      <description>&lt;P&gt;&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.autodesk.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;Only way to fly!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2011 17:37:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/xdata-problem/m-p/3259504#M58009</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-12T17:37:32Z</dc:date>
    </item>
  </channel>
</rss>

