<?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>VBA to Reference Files and Set Geographic Coordinates.</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/89103/vba-to-reference-files-and-set-geographic-coordinates</link><description>Hi All, 
 I&amp;#39;m having some problems with a Project at work. I am trying to speed up the process for our users to Import GIS Data that has been extracted from our GIS System 
 The Extract file works fine when i opened it in MicroStation, attach the coordinate</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Re: VBA to Reference Files and Set Geographic Coordinates.</title><link>https://communities.bentley.com/thread/255479?ContentTypeID=1</link><pubDate>Fri, 16 Aug 2013 22:32:57 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:b2886394-40e6-4774-b4a4-d85a013cb5cd</guid><dc:creator>mphill</dc:creator><description>&lt;p&gt;There are different options for the attachments. Have you tried something like this? Note the AddCoincident1 which allows for several mdsAdd options which the AddCoincident does not.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; Set att = ActiveModelReference.Attachments.AddCoincident1(MapRefName, &amp;quot;Project MAP&amp;quot;, _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;map&amp;quot;, &amp;quot;True Scale World&amp;quot;, msdAddAttachmentFlagCoincidentWorld)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: VBA to Reference Files and Set Geographic Coordinates.</title><link>https://communities.bentley.com/thread/253141?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2013 10:17:18 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:3d65e55f-7ce0-4b63-9dbe-cee9a657b74e</guid><dc:creator>Rob Golding</dc:creator><description>&lt;p&gt;Further to this...&lt;/p&gt;
&lt;p&gt;If i open the GIS File i want to import and set the Coordinates to MGA94-50 the Google Earth file is correct... so i know its in the right coordinates.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not an expert but the only thing i can think of is the code to attach the reference... is there another way to do this through code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: VBA to Reference Files and Set Geographic Coordinates.</title><link>https://communities.bentley.com/thread/253029?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2013 19:31:05 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:7531e0f7-f4ba-47cb-b300-62ecee59ad73</guid><dc:creator>Rob Golding</dc:creator><description>&lt;p&gt;Thanks Dan,&lt;/p&gt;
&lt;p&gt;Have tried the SendSyncKeyin and unfortunately it&amp;#39;s the same result... the coordinate system is off and the Extract file covers the entire globe!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: VBA to Reference Files and Set Geographic Coordinates.</title><link>https://communities.bentley.com/thread/252947?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2013 14:03:51 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:481bbd83-7544-4e28-80eb-beb42106dc0b</guid><dc:creator>DanPaul</dc:creator><description>&lt;p&gt;Perhaps it is just a synchronization problem where you are attaching reference file earlier then it has chosen correct coordinate system. You are using SendKeyin function which just adds keyin at the end of input queue, but does not wait until it is executed. Unfortunately, VBA does not have a function to send synchronized keyin, however it can use MDL to do it.&lt;/p&gt;
&lt;p&gt;Please, try to call ALL keyins using following SendSyncKeyin routine and let us know whether it works:&lt;/p&gt;
&lt;div style="font-family:Courier New;"&gt;&lt;span style="color:blue;"&gt;Option&lt;/span&gt;&amp;nbsp;Explicit &lt;br /&gt; &lt;br /&gt;&lt;span style="color:blue;"&gt;Declare&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&amp;nbsp;mdlInput_sendSynchronizedKeyin&amp;nbsp;&lt;span style="color:blue;"&gt;Lib&lt;/span&gt;&amp;nbsp;&lt;span style="color:maroon;"&gt;&amp;quot;stdmdlbltin.dll&amp;quot;&lt;/span&gt;&amp;nbsp;(&amp;nbsp;_ &lt;br /&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;&amp;nbsp;stringP&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;String&lt;/span&gt;,&amp;nbsp;&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;&amp;nbsp;literal&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Long&lt;/span&gt;,&amp;nbsp;_ &lt;br /&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;&amp;nbsp;position&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Long&lt;/span&gt;,&amp;nbsp;&lt;span style="color:blue;"&gt;ByVal&lt;/span&gt;&amp;nbsp;taskIdP&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;String&lt;/span&gt;) &lt;br /&gt; &lt;br /&gt;&lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&amp;nbsp;SendSyncKeyin(expr&amp;nbsp;&lt;span style="color:blue;"&gt;As&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;String&lt;/span&gt;) &lt;br /&gt;&amp;nbsp;&amp;nbsp;mdlInput_sendSynchronizedKeyin&amp;nbsp;expr,&amp;nbsp;&lt;span style="color:maroon;"&gt;0&lt;/span&gt;,&amp;nbsp;-&lt;span style="color:maroon;"&gt;1&lt;/span&gt;,&amp;nbsp;vbNullString &lt;br /&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>