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

[V8i VBA] Measure Distance Total

$
0
0

Greetings everyone.

I am making a macro utility for my department that will automate nearly everything that we do with creating maps. I am having some difficulty with figuring out how to go about this next piece, as I have been working unsuccessfully for a few days now. Ultimately, I would like to use the cumulative total that MicroStation displays in the Measure Distance dialog box and set that in a variable that I can use. The problem that I am experiencing that I cannot locate that variable or command state that houses that information.

My intent for this project is to be able to grab that information and use it for an on-demand unit conversion utility for a linear feature that we need to measure in miles or other units. We have all our working units in meters and since we do no dimensioning (just placing text that states the measurement) and support for changing the units will likely be lacking, I decided to just create something to do it for us. We use it for verification purposes that what we are placing on the map corresponds with the linear measurement of the element.

I have the utility set up so that the user can choose between the two measuring methods that we most commonly use, which are measure between points and along element. I have the along element measurement conversion portion running correctly. The between points method has me stumped. I'm pretty certain that I should be able to use the values from commandstate.measureresult1 & 2 to generate a total, but if MicroStation is already doing that calculations then I should be able to locate this value somehow after the User sends a reset command.

If someone knows the variable, or what I need to code to be able to access this value I will do it that way; otherwise, I would use the command states.

Going with the second option, this is what little code I have so far: When the user clicks on the method that they want, the utility sends the key in to MicroStation to start the measure distance, between points method. It's not very much because I can't formulate in my mind how I need to approach this.

After this, I would like it to start a procedure that would let the user proceed with measuring the object, while calculating the two measurements separately (for verification purposes) until the User sends a reset. Then it would calculate the total and then I could send that information through my conversion process and send the output to the User.

I'm hoping that someone can give me ideas how to locate the variable that holds the information or help me get through the more code intensive, second option.

Thanks in advance.


Viewing all articles
Browse latest Browse all 1677

Trending Articles



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