<?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: How can I get Direct xref of a Particular Drawing using C# Code? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3485286#M55430</link>
    <description>A few days later... Finding all XREFs in the current database using C#.NET: &lt;A href="http://adndevblog.typepad.com/autocad/2012/06/finding-all-xrefs-in-the-current-database-using-cnet.html" target="_blank"&gt;http://adndevblog.typepad.com/autocad/2012/06/finding-all-xrefs-in-the-current-database-using-cnet.html&lt;/A&gt;</description>
    <pubDate>Tue, 05 Jun 2012 12:15:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-06-05T12:15:11Z</dc:date>
    <item>
      <title>How can I get Direct xref of a Particular Drawing using C# Code?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3472456#M55424</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose I have a Drawing Structure like:&lt;BR /&gt;MasterRoot&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Root1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MasterChild1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Child&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MasterChild2&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Child&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Root2&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MasterChild1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Child&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MasterChild2&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Child&lt;BR /&gt;&lt;BR /&gt;When I use XrefGraph xg = mainDb.GetHostDwgXrefGraph(true); in Code then I get all the Files as a node including MasterRoot (say count=6).&lt;BR /&gt;If I want to get Only direct Children (here, Root1 and Root2)(means count=2 only), then wha i have to do?&lt;BR /&gt;Is it Possible?&lt;BR /&gt;Any help will be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance..&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Vasant Padhiyar&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2012 13:10:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3472456#M55424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-25T13:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Direct xref of a Particular Drawing using C# Code?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3472570#M55425</link>
      <description>&lt;P&gt;Have you tried the XrefGraphNode.IsNested property?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the ObjectARX docs for this property:&lt;/P&gt;&lt;P&gt;"&lt;EM&gt;Returns &lt;SPAN&gt;True&lt;/SPAN&gt; if this node represents a nested xref that is not directly referenced in the host drawing.&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in code you could check for this property to be false, i.e.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;XrefGraph graph = db.GetHostDwgXrefGraph(true);
for (int i = 0; i &amp;lt; graph.NumNodes; i++)
{
	XrefGraphNode node = graph.GetXrefNode(i);
	if (!node.IsNested)
	{
		// &amp;lt; Insert your code for non-nested xref here &amp;gt;
	}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Haven't tried this myself but hopefully this will help you out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2012 13:47:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3472570#M55425</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-25T13:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Direct xref of a Particular Drawing using C# Code?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3473416#M55426</link>
      <description>&lt;P&gt;Thanks a lot...&lt;/P&gt;&lt;P&gt;It is really helpful for me...&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2012 06:38:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3473416#M55426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-26T06:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Direct xref of a Particular Drawing using C# Code?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3474174#M55427</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now Actually I wants the xRef Structure in a Tree Structure as it is in AutoCAD Drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to traverse recursively to generate a Tree Structure same as xRef Structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vasant Padhiyar&lt;/P&gt;</description>
      <pubDate>Mon, 28 May 2012 05:02:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3474174#M55427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-28T05:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Direct xref of a Particular Drawing using C# Code?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3478106#M55428</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ObjectARX docs say something like this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Each reference (between databases) is represented by an edge in the graph, and can be queried by calling GraphNode.In(int index) for what is referencing this node...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't tried to do this, but looking at the ObjectARX documentation I would try the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Get the root node (which is effectively the host drawing), i.e.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XrefGraph graph = db.GetHostDwgXrefGraph(true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XrefGraphNode rootNode = graph.RootNode;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Then use the XrefGraphNode.NumIn property and XrefGraphNode.In(int i) method to iterate child nodes recursively.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might need to experiment and step through in debug mode to see what's happening under the hood. I've never looked closely at it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck, Art&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2012 18:44:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3478106#M55428</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-30T18:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Direct xref of a Particular Drawing using C# Code?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3478824#M55429</link>
      <description>&lt;P&gt;Thanks Art,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have done it using the same Concept and it works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Get the root node (which is effectively the host drawing), i.e.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XrefGraph graph = db.GetHostDwgXrefGraph(true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XrefGraphNode rootNode = graph.RootNode;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Then use the XrefGraphNode.NumIn property and XrefGraphNode.In(int i) method to iterate child nodes recursively.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2012 05:59:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3478824#M55429</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-31T05:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Direct xref of a Particular Drawing using C# Code?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3485286#M55430</link>
      <description>A few days later... Finding all XREFs in the current database using C#.NET: &lt;A href="http://adndevblog.typepad.com/autocad/2012/06/finding-all-xrefs-in-the-current-database-using-cnet.html" target="_blank"&gt;http://adndevblog.typepad.com/autocad/2012/06/finding-all-xrefs-in-the-current-database-using-cnet.html&lt;/A&gt;</description>
      <pubDate>Tue, 05 Jun 2012 12:15:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-can-i-get-direct-xref-of-a-particular-drawing-using-c-code/m-p/3485286#M55430</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-05T12:15:11Z</dc:date>
    </item>
  </channel>
</rss>

