<?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>Remove reference path for rasters</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/archived-microstation-v8i-vba-forum/20383/remove-reference-path-for-rasters</link><description>Everyone, 
 
 We have a problem that we have some files which have many &amp;quot;hard-referenced&amp;quot; raster files have been attached. I need to suppress the original location so that MS_RFDIR can supply the location. As an intermediate step, I am trying to change</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Re: Remove reference path for rasters</title><link>https://communities.bentley.com/thread/44528?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2009 21:40:50 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:66765375-3613-48a7-a142-415a5f3a850f</guid><dc:creator>Michael Farmer</dc:creator><description>&lt;p&gt;
Everybody,
&lt;/p&gt;
&lt;p&gt;
The basic logic for this macro has now worked and the final version is as below... please note that I had to add &lt;strong&gt;On Error Resume Next&lt;/strong&gt; to make it work. Suggest that this might be due to some of the names for the rasters which contained &amp;quot;[xx]&amp;quot;. The &amp;quot;hard-wired&amp;quot; raster path has been supplanted by the file name alone and the path for the rasters is now supplied by MS_RFDIR, which is what we want. 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	Option Explicit&lt;br /&gt;
	Dim theRasters As Rasters&lt;br /&gt;
	Dim oRaster As raster&lt;br /&gt;
	Dim i As Long&lt;br /&gt;
	Dim sPath As String
	&lt;/p&gt;
	&lt;p&gt;
	Sub Main()
	&lt;/p&gt;
	&lt;p&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; Set theRasters = RasterManager.Rasters
	&lt;/p&gt;
	&lt;p&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each oRaster In theRasters&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If oRaster.RasterInformation.Path = &amp;quot;T:\2346 Eldon Square Newcastle Phase 3\Images\Statutory Signage&amp;quot; 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; sPath = oRaster.RasterInformation.Name&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; 'Debug.Print sPath&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; &lt;strong&gt;On Error Resume Next&lt;br /&gt;
	&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oRaster.SetAttachName sPath 'works&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; i = i + 1&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;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print &amp;quot;rasters processed: &amp;quot; &amp;amp; i
	&lt;/p&gt;
	&lt;p&gt;
	End Sub
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Remove reference path for rasters</title><link>https://communities.bentley.com/thread/44290?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2009 22:33:43 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:16751f4a-6409-4b38-9cc6-9096f7830184</guid><dc:creator>Michael Farmer</dc:creator><description>&lt;p&gt;
Yes, that's correct as far as I know. But a temp security glitch meant that a user was able to mess about with our standards.cfg with:
&lt;/p&gt;
&lt;code&gt;MS_DISALLOWFULLREFPATH = 0&lt;br /&gt;
MS_DISALLOWRELATIVEREFPATH = 0&lt;/code&gt; 
&lt;p&gt;
which allowed the full path to be inserted. Horrors.
&lt;/p&gt;
&lt;code&gt;MS_DISALLOWFULLREFPATH&amp;nbsp;&amp;nbsp;= 1&lt;br /&gt;
MS_DISALLOWRELATIVEREFPATH&amp;nbsp;= 1&lt;/code&gt; 
&lt;p&gt;
Have now been restored - to prevent this, of course. But I am stuck with trying to sort the residual mess&amp;nbsp;out, and the &amp;quot;hard-referencing&amp;quot; of raster references is not supplanted by the MS_RFDIR search path, as far as I can see. Hence the need to write this macro.
&lt;/p&gt;
&lt;p&gt;
Thanks
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;Mike
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Remove reference path for rasters</title><link>https://communities.bentley.com/thread/44284?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2009 22:04:49 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6e4e59a4-9983-4408-8892-0f165435fbb9</guid><dc:creator>caddcop</dc:creator><description>&lt;p&gt;
In my experience, if the MS_RFDIR variable is properly defined, MicroStation will search and find references even&amp;nbsp; if they were attached with a different path.
&lt;/p&gt;
&lt;p&gt;
When it has failed, there was &amp;quot;operator error&amp;quot; in defining the variable.
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>