<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Changing multiple references</title><link>https://communities.bentley.com/products/microstation/f/microstation-forum/91950/changing-multiple-references</link><description>If I have a large amount of .dgn files which have a reference attached, located say for example in &amp;quot;C:\REFONE&amp;quot;. Is there a batch process or an automated way I can change the reference in all the files to &amp;quot;C:\REFTWO&amp;quot; ? 
 Directories are made up, I just</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Re: Changing multiple references</title><link>https://communities.bentley.com/thread/264548?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2013 18:52:29 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:7f62d440-0159-470a-aadd-1d80dce75a7e</guid><dc:creator>Eric Milberger</dc:creator><description>&lt;p&gt;We need the old DOS ref tool.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Changing multiple references</title><link>https://communities.bentley.com/thread/264459?ContentTypeID=1</link><pubDate>Sat, 26 Oct 2013 13:18:29 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:eb129808-6962-4edc-bafe-ffbe2385a216</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;owens_2k&amp;quot;]What do you mean by remove folder spec from each attachment?[/quote]&lt;/p&gt;
&lt;p&gt;[quote user=&amp;quot;RobertArnold&amp;quot;] The new string is either the new path or a configuration variable and a colon[/quote]&lt;/p&gt;
&lt;p&gt;Or the new string can be simply the file name. MicroStation&amp;#39;s default mechanism is to use &lt;span style="font-family:courier new,courier;"&gt;MS_RFDIR&lt;/span&gt; to search for reference files, so it&amp;#39;s not necessary to specify it explicitly.&lt;/p&gt;
&lt;!-- signoff --&gt;
&lt;p&gt;Regards, Jon Summers &lt;br /&gt; &lt;a href="http://www.la-solutions.co.uk"&gt;LA Solutions&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Changing multiple references</title><link>https://communities.bentley.com/thread/264425?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2013 23:27:19 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:66fab6d2-fdd8-40ea-97f6-045894d9b227</guid><dc:creator>RobertArnold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve used this routine in the past to fix some of my drawings:&lt;/p&gt;
&lt;p&gt;Sub ReferenceNameReplace()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oldString As String&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim newString As String&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim OldFileName As String&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oldString = &amp;quot;Details11&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newString = &amp;quot;Details13&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each AttachedFile In ActiveModelReference.Attachments&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OldFileName = AttachedFile.AttachName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Left(OldFileName, Len(oldString)) = oldString Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NewAttachmentName = newString &amp;amp; Right(OldFileName, Len(OldFileName) - Len(oldString))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AttachedFile.SetAttachNameDeferred NewAttachmentName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AttachedFile.Rewrite&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;br /&gt;End Sub&lt;/p&gt;
&lt;p&gt;In your case, the old string is the old path and the new string is either the new path or a configuration variable and a colon.&amp;nbsp; You could use a batch command to run this on each file (vba run ReferenceNameReplace), or you could continue it in vba and have vba open each file and then run the command.&lt;/p&gt;
&lt;p&gt;Please note that I am using SetAttachedNameDEFERRED, which means that the new file will not show up until the drawing is re-opened.&amp;nbsp; If you&amp;#39;re doing this on multiple files, it will save time not loading up the new file.&lt;/p&gt;
&lt;p&gt;--Robert&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Changing multiple references</title><link>https://communities.bentley.com/thread/264353?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2013 16:02:59 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e1ff287d-ddd1-4b2e-9a85-bf357e9cd9e2</guid><dc:creator>Lorys</dc:creator><description>&lt;p&gt;yes you can do this with scripts in the batch processor&lt;/p&gt;
&lt;p&gt;but the real easiest way without having to repath everything is to use win explorer and make and &amp;nbsp;rename refone to refone_old &amp;nbsp;and rename the reftwo to refone and cad will now see the same file name attached as the ref file &amp;nbsp;but its content will be different as long as you dont change any file paths this will work globally for all you work... &lt;/p&gt;
&lt;p&gt;The clipping may be a problem if the files are not coincedent ie same positions geographically .... but that would happen even with the batch processor ...&lt;/p&gt;
&lt;p&gt;If you have win 7 you could find all places refone lives in and replace it with new refone ( made from reftwo) ... same result as above... but this assumes your only replaceing one ref file with another...&lt;/p&gt;
&lt;p&gt;you could also do a search here these forums &amp;nbsp;for replace ref macro or google may prove useful.....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Changing multiple references</title><link>https://communities.bentley.com/thread/264346?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2013 15:27:51 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:793f71d0-313b-4aff-8420-6b30eb8e7db6</guid><dc:creator>owens_2k</dc:creator><description>&lt;p&gt;Jon, what do you mean by remove folder spec from each attachment?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Changing multiple references</title><link>https://communities.bentley.com/thread/264344?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2013 15:19:09 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:77c29491-cfb7-4821-9033-1bd147842dae</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;owens_2k&amp;quot;]&lt;/p&gt;
&lt;p&gt;If I have a large amount of .dgn files which have a reference attached, located say for example in &amp;quot;C:\REFONE&amp;quot;. Is there a batch process or an automated way I can change the reference in all the files to &amp;quot;C:\REFTWO&amp;quot; ?&lt;/p&gt;
&lt;p&gt;[/quote]&lt;/p&gt;
&lt;p&gt;I suggest a combination of the two suggestions...&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Remove the folder spec. from each attachment, leaving only the file name.&amp;nbsp; This will need VBA, probably&lt;/li&gt;
&lt;li&gt;Use the &lt;span style="font-family:courier new,courier;"&gt;MS_RFDIR&lt;/span&gt; configuration variable to define your reference locations&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That way, if you need to do this again you will need only redefine the &lt;span style="font-family:courier new,courier;"&gt;MS_RFDIR&lt;/span&gt; configuration variable.&amp;nbsp; That is, it&amp;#39;s a one-shot task to remove the folder paths from your attachments.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Changing multiple references</title><link>https://communities.bentley.com/thread/264323?ContentTypeID=1</link><pubDate>Fri, 25 Oct 2013 13:30:30 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:672247c0-64c7-4f10-9abd-309578e4d7ff</guid><dc:creator>owens_2k</dc:creator><description>&lt;p&gt;Robert, &lt;/p&gt;
&lt;p&gt;Could you point me in the right direction with regards to doing this via vba?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Changing multiple references</title><link>https://communities.bentley.com/thread/264233?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2013 21:53:01 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:50dc4662-2854-443e-85ab-99b278eec314</guid><dc:creator>RobertArnold</dc:creator><description>&lt;p&gt;This can be done in vba.&lt;/p&gt;
&lt;p&gt;---Robert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Changing multiple references</title><link>https://communities.bentley.com/thread/264231?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2013 21:24:33 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:c7c04a8b-ae8b-477f-8b55-e9822403308b</guid><dc:creator>George A. Martin</dc:creator><description>&lt;p&gt;That&amp;#39;s what the Configuration Variables are for.&lt;/p&gt;
&lt;p&gt;Change the location(s) MS_RFDIR is pointing and the change is made.&lt;/p&gt;
&lt;p&gt;You can even create your own Configuration variables and attach the references using them When you change the location they are pointing too the change is made.&lt;/p&gt;
&lt;p&gt;You could use the Batch Processor to attach or modify References as long as you knew the key ins, but that could take more work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>