<?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>Deleting Lines of Length 0 Using VBA</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22443/deleting-lines-of-length-0-using-vba</link><description>Bentley View, MicroStation, PowerDraft</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Deleting Lines of Length 0 Using VBA</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22443/deleting-lines-of-length-0-using-vba</link><pubDate>Wed, 08 Jul 2015 13:59:38 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:cde6b870-3649-4387-b0b1-0b0e2a7d2fa3</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22443/deleting-lines-of-length-0-using-vba#comments</comments><description>Current Revision posted to MicroStation Wiki by Tristan Anderson on 7/8/2015 1:59:38 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;Sometimes, drawings contain a large number of points. This may be caused by a variety of manipulations and initially might not bother us. When plotting, this may be due to the line widths suddenly becoming visible that should be removed from the drawing. Rather than finding and deleting these points by hand which can be very time-consuming, VBA can be used.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Points are represented in MicroStation by lines of longitude. To remove these lines, all lines are selected and searched for length. If the length is equal to 0, the line can be deleted. A possible implimentation of this in VBA might look something like this:&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;Sub LineLength0Delete()
    Dim Ee As ElementEnumerator
    Dim Sc As New ElementScanCriteria
    Dim Anzahl As Long   &amp;#39; Counter for deleted items
     
    &amp;#39; Only lines of length 0 are to be tested:
    Sc.ExcludeAllTypes
    Sc.IncludeType msdElementTypeLine
    Set Ee = ActiveModelReference.Scan(Sc)
    Number = 0
    Do While Ee.MoveNext
        With Ee.Current.AsLineElement
            &amp;#39; If the line length is 0 it will be deleted 
            If Ee.Current.AsLineElement.Length = 0 Then
                ActiveModelReference.RemoveElement Ee.Current
                Number = Number + 1
            End If
        End With
    Loop
    MessageCenter.AddMessage &amp;quot;There were &amp;quot; + str(Anzahl) + &amp;quot; lines with a length of 0 deleted&amp;quot;, , msdMessageCenterPriorityInfo
End Sub&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The result will be the number of deleted items displayed in the message center.&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/22095.searching-and-evaluating-data-in-a-drawing-with-vba-part-2-reading-properties-of-elements"&gt;Searching and Evaluating Data in a drawing with VBA: Part 2 - Reading properties of Elements&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>Deleting Lines of Length 0 Using VBA</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22443/deleting-lines-of-length-0-using-vba/revision/1</link><pubDate>Wed, 08 Jul 2015 13:58:38 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:cde6b870-3649-4387-b0b1-0b0e2a7d2fa3</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22443/deleting-lines-of-length-0-using-vba#comments</comments><description>Revision 1 posted to MicroStation Wiki by Tristan Anderson on 7/8/2015 1:58:38 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;Sometimes, drawings contain a large number of points. This may be caused by a variety of manipulations and initially might not bother us. When plotting, this may be due to the line widths suddenly becoming visible that should be removed from the drawing. Rather than finding and deleting these points by hand which can be very time-consuming, VBA can be used.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Points are represented in MicroStation by lines of longitude. To remove these lines, all lines are selected and searched for length. If the length is equal to 0, the line can be deleted. A possible implimentation of this in VBA might look something like this:&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;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;LineLength0Delete()&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 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;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;Ee &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;ElementEnumerator&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;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;Sc &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;New&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;ElementScanCriteria&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;&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;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;Anzahl &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;&amp;nbsp;&amp;nbsp; &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; Counter for deleted items&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;&amp;nbsp;&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 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 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; Only lines of length 0 are to be tested:&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 plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sc.ExcludeAllTypes&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;&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;Sc.IncludeType msdElementTypeLine&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;&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;Set&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;Ee = ActiveModelReference.Scan(Sc)&lt;/code&gt;&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;Number&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; = 0&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 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;Do&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;While&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;Ee.MoveNext&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 keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;With&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;Ee.Current.AsLineElement&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 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;&amp;nbsp;&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;&amp;nbsp;If the line length is 0 it will be deleted&amp;nbsp;&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 comments" 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 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;&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 plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Ee.Current.AsLineElement.Length = 0 &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 number15 index14 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;ActiveModelReference.RemoveElement Ee.Current&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number16 index15 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;&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;Number =&amp;nbsp;Number + 1&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number17 index16 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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 number18 index17 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 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;With&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number19 index18 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;Loop&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number20 index19 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 plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;MessageCenter.AddMessage &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;There were&amp;nbsp;&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;+ str(Anzahl) + &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; lines with a length of 0 deleted&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;, , msdMessageCenterPriorityInfo&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number21 index20 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 result will be the number of deleted items displayed in the message center.&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/22095.searching-and-evaluating-data-in-a-drawing-with-vba-part-2-reading-properties-of-elements"&gt;Searching and Evaluating Data in a drawing with VBA: Part 2 - Reading properties of Elements&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>