<?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 Layer Colors from RGB to an Indexed Color</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22232/changing-layer-colors-from-rgb-to-an-indexed-color</link><description>Bentley View, MicroStation, PowerDraft</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Changing Layer Colors from RGB to an Indexed Color</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22232/changing-layer-colors-from-rgb-to-an-indexed-color</link><pubDate>Thu, 09 Jul 2015 15:34:23 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:99f83bd5-b05b-4316-bc03-bdb0b3e0cfa5</guid><dc:creator>Maggie Fortescue</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22232/changing-layer-colors-from-rgb-to-an-indexed-color#comments</comments><description>Current Revision posted to MicroStation Wiki by Maggie Fortescue on 7/9/2015 3:34:23 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;A frequently used color assignment for elements is &amp;quot;from level&amp;quot;, meaning an item is displayed in the color assigned to the layer containing the element.&lt;/p&gt;
&lt;p&gt;When choosing colors for the levels (0 to 255), any RGB values can be supplied, not just those on the color table. This can bring up printing problems when the pen tables alter colors and the RGB values are not identified.&lt;/p&gt;
&lt;p&gt;Therefore, it may be best to modify all RGB colors of levels of specific indexes to the color table while maintaining the original color.&lt;/p&gt;
&lt;p&gt;To find the closest possible color in the color table, there is a useful VBA method called &amp;quot;.InternalColorToIndexedcOLOR&amp;quot;.&lt;/p&gt;
&lt;p&gt;To lump modify all colors of the levels to index colors, you can use the following approach:&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;Dim oLv As Level
For Each oLv In ActiveDesignFile.Levels
    If Not oLv.IsFromLevelLibrary Then
        oLv.ElementColor = ActiveModelReference.InternalColorToIndexedColor(oLv.ElementColor)
    End If
Next
ActiveDesignFile.Levels.Rewrite
 &lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&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 Layer Colors from RGB to an Indexed Color</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22232/changing-layer-colors-from-rgb-to-an-indexed-color/revision/3</link><pubDate>Wed, 08 Jul 2015 20:57:09 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:99f83bd5-b05b-4316-bc03-bdb0b3e0cfa5</guid><dc:creator>Maggie Fortescue</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22232/changing-layer-colors-from-rgb-to-an-indexed-color#comments</comments><description>Revision 3 posted to MicroStation Wiki by Maggie Fortescue on 7/8/2015 8:57:09 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;A frequently used color assignment for elements is &amp;quot;from level&amp;quot;, meaning an item is displayed in the color assigned to the layer containing the element.&lt;/p&gt;
&lt;p&gt;When choosing colors for the levels (0 to 255), any RGB values can be supplied, not just those on the color table. This can bring up printing problems when the pen tables alter colors and the RGB values are not identified.&lt;/p&gt;
&lt;p&gt;Therefore, it may be interesting to modify all RGB colors of levels of specific indexes to the color table while maintaining the original color.&lt;/p&gt;
&lt;p&gt;To find the closest possible color in the color table, there is a useful VBA method called &amp;quot;.InternalColorToIndexedcOLOR&amp;quot;.&lt;/p&gt;
&lt;p&gt;To lump modify all colors of the levels to index colors, you can use the following approach:&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;Dim oLv As Level
For Each oLv In ActiveDesignFile.Levels
    If Not oLv.IsFromLevelLibrary Then
        oLv.ElementColor = ActiveModelReference.InternalColorToIndexedColor(oLv.ElementColor)
    End If
Next
ActiveDesignFile.Levels.Rewrite
 &lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&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 Layer Colors from RGB to an Indexed Color</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22232/changing-layer-colors-from-rgb-to-an-indexed-color/revision/2</link><pubDate>Mon, 29 Jun 2015 15:39:00 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:99f83bd5-b05b-4316-bc03-bdb0b3e0cfa5</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22232/changing-layer-colors-from-rgb-to-an-indexed-color#comments</comments><description>Revision 2 posted to MicroStation Wiki by Tristan Anderson on 6/29/2015 3:39:00 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;A frequently used color assignment for elements is &amp;quot;from level&amp;quot;, meaning an item is displayed in the color assigned to the layer containing the element.&lt;/p&gt;
&lt;p&gt;When choosing colors for the levels (0 to 255), any RGB values can be supplied, not just those on the color table. This can, for example, bring up printing problems when the pen tables alter colors and the RGB values are not identified.&lt;/p&gt;
&lt;p&gt;Therefore, it may be interesting to modify all RGB colors of levels of specific indexes to the color table while maintaining the original color.&lt;/p&gt;
&lt;p&gt;To find the closest possible color in the color table, there is a useful VBA method called &amp;quot;.InternalColorToIndexedcOLOR&amp;quot;.&lt;/p&gt;
&lt;p&gt;To lump modify all colors of the levels to index colors, you can use the following approach:&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;Dim oLv As Level
For Each oLv In ActiveDesignFile.Levels
    If Not oLv.IsFromLevelLibrary Then
        oLv.ElementColor = ActiveModelReference.InternalColorToIndexedColor(oLv.ElementColor)
    End If
Next
ActiveDesignFile.Levels.Rewrite
 &lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&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 Layer Colors from RGB to an Indexed Color</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22232/changing-layer-colors-from-rgb-to-an-indexed-color/revision/1</link><pubDate>Mon, 29 Jun 2015 15:37:14 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:99f83bd5-b05b-4316-bc03-bdb0b3e0cfa5</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22232/changing-layer-colors-from-rgb-to-an-indexed-color#comments</comments><description>Revision 1 posted to MicroStation Wiki by Tristan Anderson on 6/29/2015 3:37:14 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;A frequently used color assignment for elements is &amp;quot;from level&amp;quot;, meaning an item is displayed in the color assigned to the layer containing the element.&lt;/p&gt;
&lt;p&gt;When choosing colors for the levels (0 to 255), any RGB values can be supplied, not just those on the color table. This can, for example, bring up printing problems when the pen tables alter colors and the RGB values are not identified. &lt;/p&gt;
&lt;p&gt;Therefore, it may be interesting to modify all RGB colors of levels of specific indexes to the color table while maintaining the original color. &lt;/p&gt;
&lt;p&gt;To find the closest possible color in the color table, there is a useful VBA method called &amp;quot;.InternalColorToIndexedcOLOR&amp;quot;.&lt;/p&gt;
&lt;p&gt;To lump modify all colors of the levels to index colors, you can use the following approach:&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;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 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;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 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;&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 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 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;oLv.ElementColor = ActiveModelReference.InternalColorToIndexedColor(oLv.ElementColor)&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 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 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;Next&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 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;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&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>