<?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>Problem with Moving Reference File</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/98269/problem-with-moving-reference-file</link><description>Hi All, 
 I am having issues with Moving a Reference file. 
 I am trying to Insert the Default Model into a Sheet Model, Scale it, then Move it to around the location of the Drawing Sheet (XY = 18,50) 
 The Code... 
 Set oRef = ActiveModelReference.Attachments</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/289640?ContentTypeID=1</link><pubDate>Thu, 26 Jun 2014 15:56:36 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:370cb1bb-025f-4a4a-8f37-418f88a18725</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Rob Golding&amp;quot;]I&amp;#39;m leaning towards the idea of the Files - or perhaps the seed from SmallWorld is corrupt[/quote]&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re seeing that problem consistently, I suggest that you submit a TR to Bentley Systems, with a SmallWorld DGN file as evidence.&amp;nbsp; See what they can make of it.&amp;nbsp; If they can definitively say what&amp;#39;s wrong with it, you can (a)&amp;nbsp;firstly send it back to SmallWorld for them to fix their DGN exporter and (b)&amp;nbsp;secondly devise a work-around that solves the problem for bad SmallWorld DGN files.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/289636?ContentTypeID=1</link><pubDate>Thu, 26 Jun 2014 15:50:28 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:838e6adf-4bd9-4cea-b98a-448097ce6e8e</guid><dc:creator>Rob Golding</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Jon Summers&amp;quot;]I notice that it has a master model (the map) and a sheet border model.&amp;nbsp; Is that how SmallWorld exports it?[/quote]&lt;/p&gt;
&lt;p&gt;Sorry, the default model is straight from SmallWorld, I have added a sheet model with Title Block. But this file now works for me too... I don&amp;#39;t understand why? All others don&amp;#39;t seem to...&lt;/p&gt;
&lt;p&gt;Attached is a straight extract from SmallWorld, which hasn&amp;#39;t been touched&lt;/p&gt;
&lt;p&gt;I had a play around with different options for Sheet Models to see if that was the issue. Instead of creating it from my seed, i would use the normal &amp;quot;Create Sheet&amp;quot; function and do everything through MicroStation tools, but same result. I even checked another PC to see if it was an issue with my MicroStation install.&lt;/p&gt;
&lt;p&gt;I Have tried to Clip the Default model to certain parts of the Default Model then do the process manually. Still same result.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Im leaning towards the idea of the Files - or perhaps the seed from SmallWorld is corrupt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description><enclosure url="https://communities.bentley.com/cfs-file/__key/telligent-evolution-components-attachments/00-343173-01-00-00-28-96-36/Kununurra-sample_5F00_0000.dgn" length="1405440" type="application/octet-stream" /></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/289498?ContentTypeID=1</link><pubDate>Thu, 26 Jun 2014 07:48:45 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:53c10cfc-fd1d-4772-9068-f1038d52da4f</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Rob Golding&amp;quot;]Attached is a file directly from Smallworld.[/quote]&lt;/p&gt;
&lt;p&gt;I notice that it has a master model (the map) and a sheet border model.&amp;nbsp; Is that how SmallWorld exports it?&lt;/p&gt;
&lt;p&gt;This file behaved rationally.&amp;nbsp; First, the refernence has the expected boundary, Second, I was able to attach the map, scale and move it&amp;nbsp; manually.&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file.ashx/__key/communityserver-discussions-components-files/343173/GIS_2D00_test_2D00_ref_2D00_attach_2D00_scaled_2D00_and_2D00_moved.png"&gt;&lt;img src="/resized-image.ashx/__size/690x0/__key/communityserver-discussions-components-files/343173/GIS_2D00_test_2D00_ref_2D00_attach_2D00_scaled_2D00_and_2D00_moved.png" alt=" " border="0" height="360" width="485" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now you have good data, you can continue with your VBA development.&lt;/p&gt;
&lt;p&gt;I ran VerifyDgn on your bad DGN, but it told me nothing.&amp;nbsp; Perhaps you could ask Bentley Systems to analyse it to understand why its reference boundary is so bizarre.&amp;nbsp; Bear in mind that it could be the sheet model that&amp;#39;s wacky.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/289484?ContentTypeID=1</link><pubDate>Thu, 26 Jun 2014 06:47:29 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:b97af791-0034-4b5c-af10-f562f5777a94</guid><dc:creator>Rob Golding</dc:creator><description>&lt;p&gt;V8 DGN&lt;/p&gt;
&lt;p&gt;Attached is a file directly from Smallworld.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have tried a few different files, all with the same issue. Where the Extents in the Default Model are just of the elements, but reference it into a Sheet and the Extents are massive.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description><enclosure url="https://communities.bentley.com/cfs-file/__key/telligent-evolution-components-attachments/00-343173-01-00-00-28-94-84/sample_5F00_0000.dgn" length="2246144" type="application/octet-stream" /></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/289478?ContentTypeID=1</link><pubDate>Thu, 26 Jun 2014 06:30:48 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e6d9c88e-eb0a-4088-b5a1-f9fc6a0e4666</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Rob Golding&amp;quot;] The DGN we are getting...[/quote]&lt;/p&gt;
&lt;p&gt;Does SmallWorld create a V7 DGN or a V8 DGN?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/289462?ContentTypeID=1</link><pubDate>Thu, 26 Jun 2014 03:44:03 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ad3f8dc2-ca42-42f2-babc-2f791b24f1ec</guid><dc:creator>Rob Golding</dc:creator><description>&lt;p&gt;I was afraid of that...&lt;/p&gt;
&lt;p&gt;The GIS file is exported from our GIS System (GE Small World) into a DGN. The DGN we are getting isnt the best as is (levels are limited, text is a weird font etc.). So i wouldn&amp;#39;t be surprised if there is something else wrong.&lt;/p&gt;
&lt;p&gt;I will see if I can do anything with Small World but I don&amp;#39;t like my chances.&lt;/p&gt;
&lt;p&gt;Would there be something we could do in MicroStation to help &amp;quot;fix&amp;quot; the problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/289445?ContentTypeID=1</link><pubDate>Wed, 25 Jun 2014 21:02:09 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:91ce339c-49a4-4dbc-8376-73dcbbcd8a05</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;I detached your master model, then reattached manually.&amp;nbsp; I used the default settings (1:1 scale, coincident world).&amp;nbsp; The screenshot shows the result.&amp;nbsp; There&amp;#39;s something fishy about the attachment extents.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The map in the master model is crammed up in the north-east corner.&amp;nbsp; The Y value is six billion master units north of the origin. When I attempt to move it manually I get strange results &amp;mdash; the map vanishes.&lt;/p&gt;
&lt;p&gt;I think your VBA problems may be down to something in the DGN models.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description><enclosure url="https://communities.bentley.com/cfs-file/__key/telligent-evolution-components-attachments/00-343173-01-00-00-28-94-45/GIS_2D00_test_2D00_ref_2D00_attach_2D00_default_2D00_settings.png" length="28794" type="image/png" /></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/289193?ContentTypeID=1</link><pubDate>Wed, 25 Jun 2014 02:04:38 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:1052299e-31fb-4f7b-9c0e-2792b4960589</guid><dc:creator>Rob Golding</dc:creator><description>&lt;p&gt;Does anyone have any ideas for moving this reference file? I have been playing around for a bit over a day but cannot make any progress. I have a demonstration soon and would like to get this sorted beforehand.&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/288831?ContentTypeID=1</link><pubDate>Mon, 23 Jun 2014 13:47:23 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:2f41ecad-122b-4b6a-b236-56a2f4f2f1d0</guid><dc:creator>Rob Golding</dc:creator><description>&lt;p&gt;I will definitely use the hints above with Boolean, makes it much more clear to read!&lt;/p&gt;
&lt;p&gt;Is there anything else that can be done to achieve what im after? eg to Move the reference file to 18, 50?&lt;/p&gt;
&lt;p&gt;It was, at one point working, however I am unable to recreate it.&lt;/p&gt;
&lt;p&gt;If the X value is suspect, could it be a corruption? I have tried it on a few different DGN files and have the same issue on all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/288787?ContentTypeID=1</link><pubDate>Mon, 23 Jun 2014 10:10:47 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:abaa6da8-bcda-4865-a3d6-fffc4c591880</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Rob Golding&amp;quot;]&lt;/p&gt;
&lt;p&gt;The reason i put (True) in there is because when run i get an error message stating &amp;quot;Compile Error: Argument Not Optional&amp;quot;&lt;/p&gt;
&lt;p&gt;If i put in an argument (I put false this time) it will work.&lt;/p&gt;
&lt;p&gt;[/quote]&lt;/p&gt;
&lt;p&gt;I find those methods that take a &lt;span style="font-family:courier new,courier;"&gt;Boolean&lt;/span&gt; hard to remember, especially when I review my code after a few weeks or months.&amp;nbsp; A solution I like to use is to define local constants that document the &lt;span style="font-family:courier new,courier;"&gt;Boolean&lt;/span&gt; value...&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new,courier;"&gt;Const IncludeAttachments As Boolean = True&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new,courier;"&gt;Const IgnoreAttachments As Boolean = False&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new,courier;"&gt;range = oRef.Range(IgnoreAttachments)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;[quote user=&amp;quot;Rob Golding&amp;quot;]When doing a watch on oRef.Range.Low I get the above[/quote]&lt;/p&gt;
&lt;p&gt;Well, anything times 10 to the power -308 is small enough to be considered zero for practical purposes&amp;nbsp; 8-)&amp;nbsp; However, that X-value looks suspect: it&amp;#39;s a huge number that doesn&amp;#39;t appear to include a decimal point.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/288786?ContentTypeID=1</link><pubDate>Mon, 23 Jun 2014 10:00:27 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:44e47adc-a889-4954-8b90-6c6a4640cecf</guid><dc:creator>Rob Golding</dc:creator><description>&lt;p&gt;The reason i put (True) in there is because when run i get an error message stating &amp;quot;Compile Error: Argument Not Optional&amp;quot;&lt;/p&gt;
&lt;p&gt;If i put in an argument (I put false this time) it will work.&lt;/p&gt;
&lt;p&gt;When running the command you sent, the value is &amp;quot;Ref Range XY=0,0&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file.ashx/__key/communityserver-discussions-components-files/343173/oRefrange.png"&gt;&lt;img src="/resized-image.ashx/__size/690x0/__key/communityserver-discussions-components-files/343173/oRefrange.png" border="0" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When doing a watch on oRef.Range.Low i get the above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Moving Reference File</title><link>https://communities.bentley.com/thread/288779?ContentTypeID=1</link><pubDate>Mon, 23 Jun 2014 09:34:38 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e3a6fc9c-f0ea-4601-b384-ba011285089c</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Rob Golding&amp;quot;]distance = Point3dSubtract(oOrigin, oRef.Range(True).Low)&lt;br /&gt; [/quote]&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think this is the immediate problem, but it could lead to other curiosities.&amp;nbsp; By setting &lt;span style="font-family:courier new,courier;"&gt;Range(True)&lt;/span&gt; you&amp;#39;re asking for the range of the attachment, which happens to be the active model, including all its references&lt;/p&gt;
&lt;p&gt;What is the value of o&lt;span style="font-family:courier new,courier;"&gt;Ref.Range.Low&lt;/span&gt;?&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new,courier;"&gt;Debug.Print &amp;quot;Ref Range XY=&amp;quot; &amp;amp; Format (oRef.Range.Low.X, &amp;quot;#,##0&amp;quot;) &amp;amp; &amp;quot;,&amp;quot;&amp;nbsp; &amp;amp; Format (oRef.Range.Low.Y, &amp;quot;#,##0&amp;quot;)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>