<?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: AttachXref to DWG not opened in AutoCAD in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624477#M67313</link>
    <description>As long as the xrefs are located on the same drive as the master and you &lt;BR /&gt;
recreate the same folder structure on your copy location you shouldn't need &lt;BR /&gt;
to do anything if using "relative path" when attaching the xrefs to the master.&lt;BR /&gt;
&lt;BR /&gt;
If not using "relative path" you have some work ahead. &lt;BR /&gt;
&lt;BR /&gt;
Sorry I can't be much help here but I know you'll need to detect the insertion &lt;BR /&gt;
point, scale, overlay or attachment, and orientation of each xref in the &lt;BR /&gt;
master then recreate it on the copied master when you reattach the xref.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; I have a project that is requiring a dwg to be copied, along with the&lt;BR /&gt;
&amp;gt; external references. On this new dwg file in the separate drive, I&lt;BR /&gt;
&amp;gt; need to change the external references, to the newly created external&lt;BR /&gt;
&amp;gt; reference files on the separate drive.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I save the currently opened dwg file and all external references to a&lt;BR /&gt;
&amp;gt; separate drive. That part is done.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Next, my approach was to get the new dwg file on the separate drive,&lt;BR /&gt;
&amp;gt; delete all external references, then reattach the new external&lt;BR /&gt;
&amp;gt; references on the separate drive.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I have been able to get the dwg file, delete the external references.&lt;BR /&gt;
&amp;gt; But now I'm stuck.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I can't seem to figure out a way of attaching an external reference to&lt;BR /&gt;
&amp;gt; a dwg file that isn't opened in AutoCAD. Is it possible? Do I need&lt;BR /&gt;
&amp;gt; RealDWG for this?&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I'm currently using AutoCAD 2010 and ObjectARX 2010 .Net&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Any help is greatly appreciated&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Thanks&lt;BR /&gt;
&amp;gt; Jerri</description>
    <pubDate>Fri, 29 Jan 2010 19:52:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-01-29T19:52:53Z</dc:date>
    <item>
      <title>AttachXref to DWG not opened in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624476#M67312</link>
      <description>I have a project that is requiring a dwg to be copied, along with the external references. On this new dwg file in the separate drive, I need to change the external references, to the newly created external reference files on the separate drive.&lt;BR /&gt;
&lt;BR /&gt;
I save the currently opened dwg file and all external references to a separate drive. That part is done. &lt;BR /&gt;
&lt;BR /&gt;
Next, my approach was to get the new dwg file on the separate drive, delete all external references, then reattach the new external references on the separate drive.&lt;BR /&gt;
&lt;BR /&gt;
I have been able to get the dwg file, delete the external references. But now I'm stuck.&lt;BR /&gt;
&lt;BR /&gt;
I can't seem to figure out a way of attaching an external reference to a dwg file that isn't opened in AutoCAD. Is it possible? Do I need RealDWG for this?&lt;BR /&gt;
&lt;BR /&gt;
I'm currently using AutoCAD 2010 and ObjectARX 2010 .Net&lt;BR /&gt;
&lt;BR /&gt;
Any help is greatly appreciated&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Jerri</description>
      <pubDate>Fri, 29 Jan 2010 19:05:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624476#M67312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-29T19:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: AttachXref to DWG not opened in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624477#M67313</link>
      <description>As long as the xrefs are located on the same drive as the master and you &lt;BR /&gt;
recreate the same folder structure on your copy location you shouldn't need &lt;BR /&gt;
to do anything if using "relative path" when attaching the xrefs to the master.&lt;BR /&gt;
&lt;BR /&gt;
If not using "relative path" you have some work ahead. &lt;BR /&gt;
&lt;BR /&gt;
Sorry I can't be much help here but I know you'll need to detect the insertion &lt;BR /&gt;
point, scale, overlay or attachment, and orientation of each xref in the &lt;BR /&gt;
master then recreate it on the copied master when you reattach the xref.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; I have a project that is requiring a dwg to be copied, along with the&lt;BR /&gt;
&amp;gt; external references. On this new dwg file in the separate drive, I&lt;BR /&gt;
&amp;gt; need to change the external references, to the newly created external&lt;BR /&gt;
&amp;gt; reference files on the separate drive.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I save the currently opened dwg file and all external references to a&lt;BR /&gt;
&amp;gt; separate drive. That part is done.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Next, my approach was to get the new dwg file on the separate drive,&lt;BR /&gt;
&amp;gt; delete all external references, then reattach the new external&lt;BR /&gt;
&amp;gt; references on the separate drive.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I have been able to get the dwg file, delete the external references.&lt;BR /&gt;
&amp;gt; But now I'm stuck.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I can't seem to figure out a way of attaching an external reference to&lt;BR /&gt;
&amp;gt; a dwg file that isn't opened in AutoCAD. Is it possible? Do I need&lt;BR /&gt;
&amp;gt; RealDWG for this?&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I'm currently using AutoCAD 2010 and ObjectARX 2010 .Net&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Any help is greatly appreciated&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Thanks&lt;BR /&gt;
&amp;gt; Jerri</description>
      <pubDate>Fri, 29 Jan 2010 19:52:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624477#M67313</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-29T19:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: AttachXref to DWG not opened in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624478#M67314</link>
      <description>Can you just change the path of the existing XREF?</description>
      <pubDate>Sat, 30 Jan 2010 03:44:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624478#M67314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-30T03:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: AttachXref to DWG not opened in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624479#M67315</link>
      <description>Have you tried just setting the PathName property of the&lt;BR /&gt;
XRef's BlockTableRecord to the new path, or are you&lt;BR /&gt;
taking the scenic route for another reason?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;J_DEGNER&gt; wrote in message news:6327128@discussion.autodesk.com...&lt;BR /&gt;
I have a project that is requiring a dwg to be copied, along with the external &lt;BR /&gt;
references. On this new dwg file in the separate drive, I need to change the &lt;BR /&gt;
external references, to the newly created external reference files on the &lt;BR /&gt;
separate drive.&lt;BR /&gt;
&lt;BR /&gt;
I save the currently opened dwg file and all external references to a separate &lt;BR /&gt;
drive. That part is done.&lt;BR /&gt;
&lt;BR /&gt;
Next, my approach was to get the new dwg file on the separate drive, delete all &lt;BR /&gt;
external references, then reattach the new external references on the separate &lt;BR /&gt;
drive.&lt;BR /&gt;
&lt;BR /&gt;
I have been able to get the dwg file, delete the external references. But now &lt;BR /&gt;
I'm stuck.&lt;BR /&gt;
&lt;BR /&gt;
I can't seem to figure out a way of attaching an external reference to a dwg &lt;BR /&gt;
file that isn't opened in AutoCAD. Is it possible? Do I need RealDWG for this?&lt;BR /&gt;
&lt;BR /&gt;
I'm currently using AutoCAD 2010 and ObjectARX 2010 .Net&lt;BR /&gt;
&lt;BR /&gt;
Any help is greatly appreciated&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Jerri&lt;/J_DEGNER&gt;</description>
      <pubDate>Sat, 30 Jan 2010 12:34:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624479#M67315</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-30T12:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: AttachXref to DWG not opened in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624480#M67316</link>
      <description>That did it! Sorry for the stupid question everyone. Thanks for all of your help getting me on the right route &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Jerri</description>
      <pubDate>Mon, 01 Feb 2010 13:49:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624480#M67316</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-01T13:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: AttachXref to DWG not opened in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624481#M67317</link>
      <description>I'm now changing the path for an xref. However, the new filename/path for the xref does not have file extension, it is stripped by the other product I'm integrating with. When I open the drawing, it's says that the xrefs weren't found, and I think this is because they don't have the "dwg" extension. Am I correct? If so, Is there a way around this?

Edited by: j_degner on Feb 2, 2010 9:36 AM</description>
      <pubDate>Tue, 02 Feb 2010 14:26:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624481#M67317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-02T14:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: AttachXref to DWG not opened in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624482#M67318</link>
      <description>I'm now changing the path for an xref. However, the new filename/path for the xref does not have file extension, it is stripped by the other product I'm integrating with. When I open the drawing, it's says that the xrefs weren't found, and I think this is because they don't have the "dwg" extension. Am I correct? If so, Is there a way around this?</description>
      <pubDate>Tue, 02 Feb 2010 14:28:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624482#M67318</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-02T14:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: AttachXref to DWG not opened in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624483#M67319</link>
      <description>&amp;gt; {quote:title=j_degner wrote:}{quote}&lt;BR /&gt;
&amp;gt; I have been able to get the dwg file, delete the external references. But now I'm stuck.&lt;BR /&gt;
&lt;BR /&gt;
How did you do that? I'm stuck at that place...&lt;BR /&gt;
&lt;BR /&gt;
Thx&lt;BR /&gt;
Ontario</description>
      <pubDate>Tue, 02 Feb 2010 14:43:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624483#M67319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-02T14:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: AttachXref to DWG not opened in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624484#M67320</link>
      <description>I hope this helps.....&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Dim newXDb As Database = New Database(False, True)&lt;BR /&gt;
newXDb.ReadDwgFile(strfilepath, System.IO.FileShare.ReadWrite, False, "")&lt;BR /&gt;
Dim xrefTr As Transaction = newXDb.TransactionManager.StartTransaction()&lt;BR /&gt;
Using xrefTr&lt;BR /&gt;
     Dim bTable As BlockTable = xrefTr.GetObject(newXDb.BlockTableId, OpenMode.ForWrite)&lt;BR /&gt;
     Dim bRecord As BlockTableRecord = xrefTr.GetObject(bTable(BlockTableRecord.ModelSpace), OpenMode.ForWrite)&lt;BR /&gt;
      Dim iter As IEnumerator = bRecord.GetEnumerator&lt;BR /&gt;
      Dim i As Integer = 0&lt;BR /&gt;
      While iter.MoveNext&lt;BR /&gt;
           Dim id As ObjectId = iter.Current&lt;BR /&gt;
           Dim ent As Entity = CType(xrefTr.GetObject(id, OpenMode.ForWrite), Entity)&lt;BR /&gt;
            If (TypeOf ent Is BlockReference) Then&lt;BR /&gt;
               Dim bref As BlockReference = CType(xrefTr.GetObject(ent.ObjectId, OpenMode.ForWrite), BlockReference)&lt;BR /&gt;
               Dim blkRec As BlockTableRecord = CType(xrefTr.GetObject(bref.BlockTableRecord, OpenMode.ForRead), BlockTableRecord)&lt;BR /&gt;
                               &lt;BR /&gt;
	If blkRec.IsFromExternalReference Then&lt;BR /&gt;
                   If bref.IsWriteEnabled = True Then&lt;BR /&gt;
                       bref.Erase()&lt;BR /&gt;
                       bref.Dispose()&lt;BR /&gt;
                        i += 1&lt;BR /&gt;
                    End If&lt;BR /&gt;
                    ent.Dispose()&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
                 End If&lt;BR /&gt;
              End If&lt;BR /&gt;
           End While&lt;BR /&gt;
&lt;BR /&gt;
                        MsgBox("Blocks deleted: " &amp;amp; i)&lt;BR /&gt;
                        xrefTr.Commit()&lt;BR /&gt;
                        newXDb.SaveAs(strfilepath, DwgVersion.Current)&lt;BR /&gt;
                        xrefTr.Dispose()&lt;BR /&gt;
                        newXDb.Dispose()&lt;BR /&gt;
                    End Using</description>
      <pubDate>Tue, 02 Feb 2010 15:06:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624484#M67320</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-02T15:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: AttachXref to DWG not opened in AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624485#M67321</link>
      <description>Very great! Danke schoen!&lt;BR /&gt;
&lt;BR /&gt;
Ontario</description>
      <pubDate>Tue, 02 Feb 2010 15:19:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/attachxref-to-dwg-not-opened-in-autocad/m-p/2624485#M67321</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-02T15:19:33Z</dc:date>
    </item>
  </channel>
</rss>

