<?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>Changing the Transparency Settings of Levels with VBA</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22376/changing-the-transparency-settings-of-levels-with-vba</link><description>Bentley View, MicroStation, PowerDraft</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Changing the Transparency Settings of Levels with VBA</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22376/changing-the-transparency-settings-of-levels-with-vba</link><pubDate>Wed, 08 Jul 2015 21:17:49 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:2156c638-0204-4132-a3fa-f749ad873d01</guid><dc:creator>Maggie Fortescue</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22376/changing-the-transparency-settings-of-levels-with-vba#comments</comments><description>Current Revision posted to MicroStation Wiki by Maggie Fortescue on 7/8/2015 9:17:49 PM&lt;br /&gt;
&lt;h1&gt;&lt;b&gt;&lt;img style="border-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="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&gt;&amp;nbsp;&lt;strong&gt;Background Information&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It is often necessary to make major changes in the settings in VBA levels. For example, running in batch mode.&lt;/p&gt;
&lt;p&gt;Many of the potential level attributes such as color, line width, line style, etc. are designed as direct properties available in the VBA object model settings, while others you can change as a VBA wrapper from the MDL add functions.&lt;/p&gt;
&lt;p&gt;Transparency, which can be changed as a property in the Layer Manager, can be given a value between 0 and 100.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To change the transparency settings of levels, a VBA wrapper function is needed. The V8 &amp;quot;MDL Function Reference&amp;quot; states the following:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VBA Wrapper Declaration&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p&gt;Declare Function mdlLevel_setTransparency Lib &amp;quot;stdmdlbltin.dll&amp;quot; (ByVal modelRefln As Long, ByVal levelldln As Long, ByVal transparencyIn As Double) As Long&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you want to apply this declaration into a VBA routine, it might look like the following:&lt;/p&gt;
&lt;div class="line number1 index0 alt2" style="background:white;text-transform:none;color:#000000;text-align:left;margin:0px;letter-spacing:normal;text-indent:0px;border:0px;"&gt;
&lt;pre class="brush: vb; fontsize: 100; first-line: 1; "&gt;Declare Function mdlLevel_getTransparency Lib &amp;quot;stdmdlbltin.dll&amp;quot; (ByRef transparencyOut As Double, ByVal modelRefIn As Long, ByVal levelIdIn As Long) As Long
Declare Function mdlLevel_setTransparency Lib &amp;quot;stdmdlbltin.dll&amp;quot; (ByVal modelRefIn As Long, ByVal levelIdIn As Long, ByVal transparencyIn As Double) As Long
 
Sub levelTransparency()
Dim oLv As Level
For Each oLv In ActiveDesignFile.Levels
    If Not oLv.IsFromLevelLibrary Then
        mdlLevel_setTransparency ActiveModelReference.MdlModelRefP, oLv.ID, 0.4    &amp;#39; Transparency between 0 and 1
 
    End If
Next
        ActiveDesignFile.Levels.Rewrite
End Sub&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The new transparency value must be set as a double value in the range between 0.0 and 1.0 corresponding to the percentage of transparency you want (0% to 100%).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;See Also&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://communities.bentley.com/products/microstation/w/microstation__wiki/21888.changing-the-presentation-order-of-layers"&gt;Changing the presentation order of Layers&lt;/a&gt;&lt;/p&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>Changing the Transparency Settings of Levels with VBA</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22376/changing-the-transparency-settings-of-levels-with-vba/revision/2</link><pubDate>Mon, 06 Jul 2015 13:46:55 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:2156c638-0204-4132-a3fa-f749ad873d01</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22376/changing-the-transparency-settings-of-levels-with-vba#comments</comments><description>Revision 2 posted to MicroStation Wiki by Tristan Anderson on 7/6/2015 1:46:55 PM&lt;br /&gt;
&lt;h1&gt;&lt;b&gt;&lt;img style="border-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="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&gt;&amp;nbsp;&lt;strong&gt;Background Information&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It is often necessary to make major changes in the settings in VBA levels. For example, running in batch mode.&lt;/p&gt;
&lt;p&gt;Many of the potential level attributes such as color, line width, line style, etc. are designed as direct properties available in the VBA object model settings, while others you can change as a VBA wrapper from the MDL add functions.&lt;/p&gt;
&lt;p&gt;Transparency, which can be changed as a property in the Layer Manager, can be given a value between 0 and 100.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To change the transparency settings of levels, a VBA wrapper function is needed. The V8 &amp;quot;MDL Function Reference&amp;quot; states the following:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VBA Wrapper Declaration&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p&gt;Declare Function mdlLevel_setTransparency Lib &amp;quot;stdmdlbltin.dll&amp;quot; (ByVal modelRefln As Long, ByVal levelldln As Long, ByVal transparencyIn As Double) As Long&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you want to apply this declaration into a VBA routine, it might look like the following:&lt;/p&gt;
&lt;div class="line number1 index0 alt2" style="background:white;text-transform:none;color:#000000;text-align:left;margin:0px;letter-spacing:normal;text-indent:0px;border:0px;"&gt;
&lt;pre class="brush: vb; fontsize: 100; first-line: 1; "&gt;Declare Function mdlLevel_getTransparency Lib &amp;quot;stdmdlbltin.dll&amp;quot; (ByRef transparencyOut As Double, ByVal modelRefIn As Long, ByVal levelIdIn As Long) As Long
Declare Function mdlLevel_setTransparency Lib &amp;quot;stdmdlbltin.dll&amp;quot; (ByVal modelRefIn As Long, ByVal levelIdIn As Long, ByVal transparencyIn As Double) As Long
 
Sub levelTransparency()
Dim oLv As Level
For Each oLv In ActiveDesignFile.Levels
    If Not oLv.IsFromLevelLibrary Then
        mdlLevel_setTransparency ActiveModelReference.MdlModelRefP, oLv.ID, 0.4    &amp;#39; Transparency between 0 and 1
 
    End If
Next
        ActiveDesignFile.Levels.Rewrite
End Sub&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The new transparency value must be set as a double value in the range between 0.0 and 1.0 corresponding to the percentage of transparency you want (0% to 100%).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;See Also&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://communities.bentley.com/products/microstation/w/microstation__wiki/21888.changing-the-presentation-order-of-layers"&gt;Changing the presentation order of Layers&lt;/a&gt;&lt;/p&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>Changing the Transparency Settings of Levels with VBA</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22376/changing-the-transparency-settings-of-levels-with-vba/revision/1</link><pubDate>Mon, 06 Jul 2015 13:42:41 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:2156c638-0204-4132-a3fa-f749ad873d01</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22376/changing-the-transparency-settings-of-levels-with-vba#comments</comments><description>Revision 1 posted to MicroStation Wiki by Tristan Anderson on 7/6/2015 1:42:41 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&gt;&amp;nbsp;&lt;strong&gt;Background Information&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;It is often necessary to make major changes in the settings in VBA levels. For example, running in batch mode.&lt;/p&gt;
&lt;p&gt;Many of the potential level attributes such as color, line width, line style, etc. are designed as direct properties available in the VBA object model settings, while others you can change as a VBA wrapper from the MDL add functions.&lt;/p&gt;
&lt;p&gt;Transparency, which can be changed as a property in the Layer Manager, can be given a value between 0 and 100.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To change the transparency settings of levels, a VBA wrapper function is needed. The V8 &amp;quot;MDL Function Reference&amp;quot; states the following:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VBA Wrapper Declaration&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p&gt;Declare Function mdlLevel_setTransparency Lib &amp;quot;stdmdlbltin.dll&amp;quot; (ByVal modelRefln As Long, ByVal levelldln As Long, ByVal transparencyIn As Double) As Long&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;If you want to apply this declaration into a VBA routine, it might look like the following:&lt;/p&gt;
&lt;div class="line number1 index0 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Declare&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Function&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;mdlLevel_getTransparency &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Lib&lt;/code&gt; &lt;code class="vb string" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;quot;stdmdlbltin.dll&amp;quot;&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;(&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ByRef&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;transparencyOut &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Double&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;, &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ByVal&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;modelRefIn &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Long&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;, &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ByVal&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;levelIdIn &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Long&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;) &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Long&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number2 index1 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Declare&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Function&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;mdlLevel_setTransparency &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Lib&lt;/code&gt; &lt;code class="vb string" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;quot;stdmdlbltin.dll&amp;quot;&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;(&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ByVal&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;modelRefIn &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Long&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;, &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ByVal&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;levelIdIn &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Long&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;, &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ByVal&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;transparencyIn &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Double&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;) &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Long&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number3 index2 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="line number4 index3 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sub&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;levelTransparency()&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number5 index4 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Dim&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;oLv &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Level&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number6 index5 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;For&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Each&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;oLv &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;In&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ActiveDesignFile.Levels&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number7 index6 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Not&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;oLv.IsFromLevelLibrary &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Then&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number8 index7 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;mdlLevel_setTransparency ActiveModelReference.MdlModelRefP, oLv.ID, 0.4&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; Transparency between 0 and 1&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number9 index8 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="line number10 index9 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;End&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number11 index10 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Next&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number12 index11 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ActiveDesignFile.Levels.Rewrite&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number13 index12 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;End&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sub&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;The new transparency value must be set as a double value in the range between 0.0 and 1.0 corresponding to the percentage of transparency you want (0% to 100%).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;See Also&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://communities.bentley.com/products/microstation/w/microstation__wiki/21888.changing-the-presentation-order-of-layers"&gt;Changing the presentation order of Layers&lt;/a&gt;&lt;/p&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>