<?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 Attach Reference File - Choose Orientation?</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/91226/vba-attach-reference-file---choose-orientation</link><description>To all the VBA / MDL gods out there ... 
 Is there a chance to attach a reference file and define the orientation (p.ex. &amp;quot;front&amp;quot;, &amp;quot;back&amp;quot;, &amp;quot;left&amp;quot;) as shown below? 
 
 I was not able to find a way to touch this setting so far ...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Re: VBA Attach Reference File - Choose Orientation?</title><link>https://communities.bentley.com/thread/261653?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2013 12:02:07 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:8ea29fce-465c-428a-86e8-6687d5b49434</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;quasi_modo&amp;quot;]&lt;/p&gt;
&lt;p&gt;That&amp;#39;s okay - it would have been nice to have the &amp;quot;standard&amp;quot; orientation directions like &amp;quot;front&amp;quot; or &amp;quot;back&amp;quot; available&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;p&gt;[/quote]&lt;/p&gt;
&lt;p&gt;Look at the View object in VBA help.&amp;nbsp; There&amp;#39;s a comment about View Rotation:&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#008000;"&gt;&lt;em&gt;Rotation&lt;/em&gt; specifies the &lt;b&gt;View&lt;/b&gt;&amp;#39;s rotation. A program can set a &lt;b&gt;View&lt;/b&gt;&amp;#39;s rotation by using the &lt;b&gt;Rotation&lt;/b&gt; property, or by using one of a set of methods that set the &lt;b&gt;View&lt;/b&gt;&amp;#39;s rotation to a standard value. For example, the statements &lt;b&gt;vw.Rotation&amp;nbsp;=&amp;nbsp;Matrix3dIdentity&lt;/b&gt; and &lt;b&gt;vw.SetToTop&lt;/b&gt; are equivalent. Also, the statements &lt;b&gt;vw.Rotation&amp;nbsp;=&amp;nbsp;Matrix3dFromAxisAndRotationAngle(0, Pi)&lt;/b&gt; and &lt;b&gt;vw.SetToBottom&lt;/b&gt; are equivalent&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: VBA Attach Reference File - Choose Orientation?</title><link>https://communities.bentley.com/thread/261645?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2013 09:04:59 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:d9f12f76-61a2-4616-a91e-1e5384920700</guid><dc:creator>quasi_modo</dc:creator><description>&lt;p&gt;Hi Jon - I expected your answer ;-)&lt;/p&gt;
&lt;p&gt;That&amp;#39;s okay - it would have been nice to have the &amp;quot;standard&amp;quot; orientation directions like &amp;quot;front&amp;quot; or &amp;quot;back&amp;quot; available, but it&amp;#39;s no problem to use the rotation instead.&lt;/p&gt;
&lt;p&gt;Thanks for your help!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: VBA Attach Reference File - Choose Orientation?</title><link>https://communities.bentley.com/thread/261463?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2013 18:14:24 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:67a8ef6b-18e8-4a88-b3db-b67980481e07</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;quasi_modo&amp;quot;]Is there a chance to attach a reference file and define the orientation[/quote]&lt;/p&gt;
&lt;h4&gt;&lt;span style="color:#008000;"&gt;References and Attachments&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;Reference models&lt;/em&gt; are termed &lt;span style="font-family:courier new,courier;"&gt;Attachment&lt;/span&gt; in VBA.&amp;nbsp; Attach a model as a reference like this...&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new,courier;"&gt;Dim oReference As Attachment&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new,courier;"&gt;Set oReference = ActiveModelReference.Attachments.Add (&lt;i&gt;FileSpecification&lt;/i&gt;, &lt;i&gt;ModelName&lt;/i&gt;, &lt;i&gt;LogicalName&lt;/i&gt;, &lt;i&gt;Description&lt;/i&gt;, &lt;i&gt;MasterOrigin&lt;/i&gt;, &lt;i&gt;ReferenceOrigin&lt;/i&gt; [, &lt;i&gt;TrueScale&lt;/i&gt; [, &lt;i&gt;DisplayImmediately&lt;/i&gt;]])&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You can see that there&amp;#39;s no parameter to specify orientation, so you must use the methods of the new attachment.&amp;nbsp; Use &lt;span style="font-family:courier new,courier;"&gt;Attachment.Rotate&lt;/span&gt; to specify a rotation, then &lt;span style="font-family:courier new,courier;"&gt;Attachment.Rewrite&lt;/span&gt; to make it permanent.&lt;/p&gt;
&lt;h4&gt;&lt;span style="color:#008000;"&gt;Orientation and Rotation&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;What is presented to the user as &lt;em&gt;orientation&lt;/em&gt; is, in VBA terms, a view rotation where the view is one of the&lt;em&gt; standard views&lt;/em&gt;.&amp;nbsp; &lt;span style="font-family:courier new,courier;"&gt;Attachment.Rotate&lt;/span&gt; rotates an attachment relative to a view rotation.&amp;nbsp; From VBA help...&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#008000;"&gt;&lt;b&gt;Attachment&lt;/b&gt;.&lt;b&gt;Rotate&lt;/b&gt; rotates the &lt;b&gt;Attachment&lt;/b&gt; about the &lt;b&gt;View&lt;/b&gt;&amp;#39;s axes, not the model&amp;#39;s axes. Use &lt;i&gt;ViewSpecifier&lt;/i&gt; to select the view.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#008000;"&gt;If the &lt;b&gt;Attachment&lt;/b&gt; is clipped by an element, the clip element is rotated and immediately written to the file. In that case, the &lt;b&gt;Attachment&lt;/b&gt; should always be written to the file to keep it in synch with its clipping element&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>