Quantcast
Channel: MicroStation Programming - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1677

measuring lines on a specific layer

$
0
0

Hi,

I'm doing a design which involves laying earth tape on site, and i want to get the total length of earth tape needed for the job.

The level is called "Earthing - Proposed"

This is my first time coding anything, so i'm just trying to fumble my way through...  I've read a few forum posts which seemed similar, but so far i have failed, the following code: oScanCriteria.IncludeLevel.Name oLevel gives me an 'argument not optional' error when i try to compile.

if anyone can point me in the right direction, it would be much appreciated.

-------------------------------------------------------------------------------------------------------

Sub ScanForEarthTape()

Dim counter As Integer

Dim oEnumerator As ElementEnumerator

Dim oScanCriteria As New ElementScanCriteria

Dim oLevel As Level
 Set oLevel = ActiveDesignFile.Levels("Earthing - Proposed")

oScanCriteria.ExcludeAllTypes

oScanCriteria.IncludeType msdElementTypeLine

oScanCriteria.IncludeLevel.Name oLevel
 
Set oEnumerator = ActiveModelReference.Scan(oScanCriteria)

 

Do While oEnumerator.MoveNext

counter = counter + 1

Loop

MsgBox "The total number of Earth Tape lines found were: " & CStr(counter)

End Sub

----------------------------------------------------------------------------------------------------------------------

PS i know the code (if it ever works) will only count the individual lines of earth tape and not the lengths - that would be the next step.

Thanks

.


Viewing all articles
Browse latest Browse all 1677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>