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

Selection Set

$
0
0

Hello everybody. In the beginning, my english is too bad, so sorry for that!
I'm novice in microstation programming, so I need you to help me for some questions in simple BASIC, not VBA.

My Microstation version is V8.05.02.55
I need to make a selection set of all elements on some levels, then apply  "measure length" command and write in a txt file the MbeState.measureResult1 value.
This code works good, but only if there are elements on levels.
When I move to another dgn file with zero elements on those levels, the MbeState.measureResult1 value remains the same in the previous file whith selection set not null, so the programm writes it again in txt file.
Is there another way to create a selection set so I can manipulate it with If function?
Here is my code:

Sub main
    Dim totalLength As Single
    Dim fileName As String
    Dim dgname As String
    MbeSendCommand "null"
    MbeSendcommand "noecho"
    fileName = MbeDgnInfo.dgnFileName
    dgname = FileParse$(fileName, 3)
    MbeSendCommand "choose none"
    MbeSendKeyin "level element select LEVEL1 LEVEL2 LEVEL8"
    MbeSendCommand "MEASURE LENGTH"
    totalLength = MbeState.measureResult1
    Open "d:\long.txt" for Append access Write as #1
    Write #1, dgname, totalLength
    Close
End Sub




Viewing all articles
Browse latest Browse all 7260

Trending Articles



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