<?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/"><channel><title>Placing annotation cells with VBA</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/21805/placing-annotation-cells-with-vba</link><description>Bentley View, MicroStation, PowerDraft</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Placing annotation cells with VBA</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/21805/placing-annotation-cells-with-vba</link><pubDate>Mon, 08 Jun 2015 17:43:53 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:b4ecade9-9a1e-4e8c-83d3-d544ef7fa2a8</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/21805/placing-annotation-cells-with-vba#comments</comments><description>Current Revision posted to MicroStation Wiki by Tristan Anderson on 6/8/2015 5:43:53 PM&lt;br /&gt;
&lt;h1&gt;&lt;b&gt;&lt;img style="border-width:0px;" alt=" " src="/cfs-file.ashx/__key/communityserver-components-sitefiles/TSG-Logo.png" width="189" height="60" /&gt;&lt;/b&gt;&lt;/h1&gt;
&lt;table style="width:500px;background-color:#dce5f0;border:#dce5f0 0px solid;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;span style="font-size:medium;"&gt;&lt;b&gt;Applies To&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MicroStation&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.09.578&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Environment:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Windows 7 32 bit,Windows 7 64 bit&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Programming&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Subarea:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VBA&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Original Author:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Tristan Anderson, Bentley Technical Support Group&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="white-space:normal;text-transform:none;color:#000000;margin:1.5em 0px;letter-spacing:normal;background-color:#ffffff;text-indent:0px;"&gt;&lt;span&gt;&lt;span&gt;It should be placed with VBA new cells to ensure that they are placed as an annotation cell.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="white-space:normal;text-transform:none;color:#000000;margin:1.5em 0px;letter-spacing:normal;background-color:#ffffff;text-indent:0px;"&gt;&lt;span&gt;&lt;span&gt;One possibility is to place the cells and then put the property &amp;quot;IsAnnotation&amp;quot;.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="white-space:normal;text-transform:none;color:#000000;margin:1.5em 0px;letter-spacing:normal;background-color:#ffffff;text-indent:0px;"&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-converted-space"&gt;However, a cell only has this &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;property if it is set in advance so that they may be placed as an annotation cell.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;This can be set in the cell&amp;nbsp;model properties.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="white-space:normal;text-transform:none;color:#000000;margin:1.5em 0px;letter-spacing:normal;background-color:#ffffff;text-indent:0px;"&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;Whether or not&amp;nbsp;they can be placed as an annotation cell is the property:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&amp;quot;AnnotationPurpose&amp;quot;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="white-space:normal;text-transform:none;color:#000000;margin:1.5em 0px;letter-spacing:normal;background-color:#ffffff;text-indent:0px;"&gt;&lt;span&gt;&lt;span&gt;If this is set to True, the property &amp;quot;IsAnnotation&amp;quot; can also be set to True.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;A VBA example of this may look something like the following example, where a cell library is attached and a cell named &amp;quot;CellToPlace&amp;quot; exists:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;pre class="brush: vb; fontsize: 100; first-line: 1; "&gt;Sub  CellemitAnnoScale ()
 Dim  oCell As  CellElement
 Dim pScale As Point3d
 Dim  oProp As  Property Transfers
  
 pScale.X = 2
 pScale.Y = 2
 pScale.Z = 1
 
 Set oCell = CreateCellElement2(&amp;quot;CellToPlace&amp;quot;, Point3dZero, pScale, True, Matrix3dIdentity)
 Bird ActiveModelReference.AddElement
 
 Set  oProp CreatePropertyHandler = (Bird)
 oProp.SelectByAccessString &amp;quot;AnnotationPurpose&amp;quot;
 If oProp.GetValue = True Then
    oProp.SelectByAccessString &amp;quot;IsAnnotation&amp;quot;
    oProp.SetValue (True)
 End  If
End Sub&lt;/pre&gt;
&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: VBAWindows 7 32 bit, MicroStation, Windows 7 64 bit, Programming, en, 08.11.09.578, SELECTsupport&lt;/div&gt;
</description></item><item><title>Placing annotation cells with VBA</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/21805/placing-annotation-cells-with-vba/revision/1</link><pubDate>Thu, 04 Jun 2015 20:31:22 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:b4ecade9-9a1e-4e8c-83d3-d544ef7fa2a8</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/21805/placing-annotation-cells-with-vba#comments</comments><description>Revision 1 posted to MicroStation Wiki by Tristan Anderson on 6/4/2015 8:31:22 PM&lt;br /&gt;
&lt;h1&gt;&lt;b&gt;&lt;img style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;border-top-width:0px;" alt=" " src="http://communities.bentley.com/cfs-file.ashx/__key/communityserver-components-sitefiles/TSG-Logo.png" width="189" height="60" /&gt;&lt;/b&gt;&lt;/h1&gt;
&lt;table style="border-top:#dce5f0 0px solid;border-right:#dce5f0 0px solid;width:500px;border-bottom:#dce5f0 0px solid;border-left:#dce5f0 0px solid;background-color:#dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;span style="font-size:medium;"&gt;&lt;b&gt;Applies To&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MicroStation&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.09.578 &lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Environment:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Windows 7 32 bit,Windows 7 64 bit&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Programming&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Subarea:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VBA&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Original Author:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Tristan Anderson, Bentley Technical Support Group&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p style="white-space:normal;text-transform:none;color:rgb(0,0,0);margin:1.5em 0px;letter-spacing:normal;background-color:rgb(255,255,255);text-indent:0px;"&gt;&lt;font&gt;&lt;font&gt;It should be placed with VBA new cells to ensure that they are placed as an annotation cell.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="white-space:normal;text-transform:none;color:rgb(0,0,0);margin:1.5em 0px;letter-spacing:normal;background-color:rgb(255,255,255);text-indent:0px;"&gt;&lt;font&gt;&lt;font&gt;One possibility is to place the cells and then put the property &amp;quot;IsAnnotation&amp;quot;.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="white-space:normal;text-transform:none;color:rgb(0,0,0);margin:1.5em 0px;letter-spacing:normal;background-color:rgb(255,255,255);text-indent:0px;"&gt;&lt;font&gt;&lt;font&gt;&lt;span class="Apple-converted-space"&gt;However, a cell only has this &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;font&gt;property if it is set in advance so that they may be placed as an annotation cell.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;font&gt;&lt;font&gt;This can be set in the cell&amp;nbsp;model properties.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="white-space:normal;text-transform:none;color:rgb(0,0,0);margin:1.5em 0px;letter-spacing:normal;background-color:rgb(255,255,255);text-indent:0px;"&gt;&lt;br /&gt;&lt;font&gt;&lt;font&gt;Whether or not&amp;nbsp;they can be placed as an annotation cell is the property:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;font&gt;&amp;quot;AnnotationPurpose&amp;quot;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="white-space:normal;text-transform:none;color:rgb(0,0,0);margin:1.5em 0px;letter-spacing:normal;background-color:rgb(255,255,255);text-indent:0px;"&gt;&lt;font&gt;&lt;font&gt;If this is set to True, the property &amp;quot;IsAnnotation&amp;quot; can also be set to True.&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;font&gt;&amp;nbsp;&lt;/font&gt;&lt;font&gt;A VBA example of this may look something like the following example, where a cell library is attached and a cell named &amp;quot;CellToPlace&amp;quot; exists:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;&lt;pre style="background:rgb(255,255,255);text-transform:none;font-weight:normal;color:rgb(0,0,0);font-style:normal;letter-spacing:normal;line-height:normal;text-indent:0px;"&gt;&lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;Sub&lt;/span&gt;  CellemitAnnoScale ()
 &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;Dim&lt;/span&gt;  oCell &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;As&lt;/span&gt;  CellElement
 &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;Dim&lt;/span&gt; pScale &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;As&lt;/span&gt; Point3d
 &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;Dim&lt;/span&gt;  oProp &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;As&lt;/span&gt;  &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;Property&lt;/span&gt; Transfers
  
 pScale.X = 2
 pScale.Y = 2
 pScale.Z = 1
 
 &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;Set&lt;/span&gt; oCell = CreateCellElement2(&lt;span style="color:rgb(42,0,255);"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:rgb(42,0,255);"&gt;CellToPlace&lt;/span&gt;&lt;span style="color:rgb(42,0,255);"&gt;&amp;quot;&lt;/span&gt;, Point3dZero, pScale, &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;True&lt;/span&gt;, Matrix3dIdentity)
 Bird ActiveModelReference.AddElement
 
 &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;Set&lt;/span&gt;  oProp CreatePropertyHandler = (Bird)
 oProp.SelectByAccessString &lt;span style="color:rgb(42,0,255);"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:rgb(42,0,255);"&gt;AnnotationPurpose&lt;/span&gt;&lt;span style="color:rgb(42,0,255);"&gt;&amp;quot;&lt;/span&gt;
 &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;If&lt;/span&gt; oProp.GetValue = &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;True&lt;/span&gt; &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;Then&lt;/span&gt;
    oProp.SelectByAccessString &lt;span style="color:rgb(42,0,255);"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:rgb(42,0,255);"&gt;IsAnnotation&lt;/span&gt;&lt;span style="color:rgb(42,0,255);"&gt;&amp;quot;&lt;/span&gt;
    oProp.SetValue (&lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;True&lt;/span&gt;)
 &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;End  If&lt;/span&gt;
&lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;End&lt;/span&gt; &lt;span style="font-weight:bold;color:rgb(127,0,85);"&gt;Sub&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: VBAWindows 7 32 bit, MicroStation, Windows 7 64 bit, Programming, en, 08.11.09.578, SELECTsupport&lt;/div&gt;
</description></item></channel></rss>