<?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>Change Model Properties in VBA</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/92534/change-model-properties-in-vba</link><description>Before I jump into this, I thought I&amp;#39;d ask here first. 
 Does anyone have some VBA code that changes a model from design model to a sheet and then applies some of the additional properties that become available once a model is a sheet? 
 I tried recording</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Change Model Properties in VBA</title><link>https://communities.bentley.com/thread/396994?ContentTypeID=1</link><pubDate>Sat, 31 Dec 2016 06:42:41 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ee9b6ba7-5e9e-4e99-b743-a1dbe0c49404</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;Flounder_Pounder&amp;quot;] Did you successfully create a macro?[/quote]&lt;/p&gt;
&lt;p&gt;What do you need that isn&amp;#39;t covered either by Jan&amp;#39;s suggestion or by this example from VBA help?&lt;/p&gt;
&lt;pre class="brush: vb; fontsize: 100; first-line: 1; "&gt;Sub CopySheets()
    Dim mdlTemp As ModelReference
    Dim sd As SheetDefinition
    
    Set sd = ActiveModelReference.GetSheetDefinition
    
    For Each mdlTemp In ActiveModelReference.DesignFile.Models
        If mdlTemp.Type = msdModelTypeSheet Then
            &amp;#39;
            &amp;#39;  The same sheet definition can be applied to
            &amp;#39;  all sheet models.
            &amp;#39;
            mdlTemp.SetSheetDefinition sd
            &amp;#39;
            &amp;#39;  Change all of the elements in the model to use
            &amp;#39;  the new annotation scale.
            &amp;#39;
            mdlTemp.PropagateAnnotationScale
        End If
    Next
End Sub

&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change Model Properties in VBA</title><link>https://communities.bentley.com/thread/396988?ContentTypeID=1</link><pubDate>Fri, 30 Dec 2016 22:30:59 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ef64c073-b843-44a9-b330-686643a9350b</guid><dc:creator>Flounder_Pounder</dc:creator><description>Chuck, &lt;br /&gt;
&lt;br /&gt;
Did you successfully create a macro? &lt;br /&gt;
&lt;br /&gt;
Travis&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Change Model Properties in VBA</title><link>https://communities.bentley.com/thread/266602?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2013 20:42:46 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ffab9552-a204-4862-b482-fe0553611276</guid><dc:creator>caddcop</dc:creator><description>&lt;p&gt;Looks Promising. &lt;/p&gt;
&lt;p&gt;When I find the time, if I get something functional, I will post it back.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Change Model Properties in VBA</title><link>https://communities.bentley.com/thread/266535?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2013 12:21:13 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5477d431-cf93-49e9-9553-74ba8f4e8511</guid><dc:creator>Jan Šlegr</dc:creator><description>&lt;p&gt;Hi caddcop,&lt;/p&gt;
&lt;p&gt;the code would be similar to this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim modelRef As ModelReference&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set modelRef = ActiveDesignFile.Models(&amp;quot;modelName&amp;quot;)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; modelRef.Type = msdModelTypeSheet&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sheetDef As SheetDefinition&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set sheetDef = modelRef.GetSheetDefinition&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheetDef.AnnotationScaleFactor = 0.05&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheetDef.SheetName = &amp;quot;My form&amp;quot;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; modelRef.SetSheetDefinition sheetDef&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; modelRef.PropagateAnnotationScale&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;There is also example &lt;em&gt;Copying the Sheet Definition from the Active Model to all Sheet Models&lt;/em&gt; in MicroStation VBA help demonstrating how to iterate through models in a design file.&lt;/p&gt;
&lt;p&gt;With regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>