MicroStation V8i (SELECTseries 3)
I have to change Format on a number of .dgn file from MU:SU:PU to Std MU and the Accuracy to 0.1234 or 0.0000, I figure there is either a VBA command (not finding) or
a super Key-in command. I asked the question a few various ways did not read any examples I needed. I saw a comment on the "tcb-> command and on MDL ...... nothing.
appeared it was for the above. I also found this command:
Sub Accuracy4()' 122113 Drawing Accuracy setting, TEST ActiveSettings.CoordinateAccuracy = msdAccuracy4 CadInputQueue.SendKeyin "m,ms Set Accuracy 0.0001"End Sub
Did not seem to do anything. Can someone help me on this?
Clarification : the Accuracy4 will change the 0.12 to 0.1234, I had failed to load the VBA after puting it in. I went Back and It works, Sorry
So If someone knows the command for changing MU:SU:PU to just MU I am good, unless there is a Key-in for the Accuracy also.
Version: MicroStation V8i SS 10
RJB Phillips III (Richard) Praise the Lord for His Mercy and grace in Christ Jesus
a couple of comments:
Richard Phillips said:I figure there is either a VBA command (not finding)
How to modify working units using VBA code was discussed several times already, search for these discussions.
BTW it's questionable whether "VBA command" is correct terminology, there are MicroStation key-ins and VBA code, but VBA command?
Richard Phillips said:or a super Key-in command.
There is nothing like "super Key-in command" in MicroStation. Again, it's about proper terminology, and MicroStation has key-ins.
Richard Phillips said:I have to change Format on a number of .dgn file from MU:SU:PU to Std MU and the Accuracy to 0.1234 or 0.0000,
Working units are always set for model, not dgn file. So it's always good to specify whether there can be more models in dgn file(s), so the same code (or key-in) has to be used for individual models, or there is always one (default) model only.
Richard Phillips said:I saw a comment on the "tcb-> command
It seems to me you try to do very simple thing in extremely complicated way. As I wrote above, it's was discussed several times already. e.g. here.
Richard Phillips said:I also found this command:
Maybe it works, but it's completely wrong approach in my opinion.
What about to use simple VBA code:
ActiveSettings.CoordinateFormat = <MsdCoordinateFormat>
ActiveSettings.CoordinateAccuracy = <MsdCoordinateAccuracy>
See MicroStation VBA documentation for values of MsdCoordinateAccuracy and MsdCoordinateFormat values.
In your case, they probably will be
ActiveSettings.CoordinateFormat = msdMasterUnits
ActiveSettings.CoordinateAccuracy = msdAccuracy4
And when used as key-ins:
vba execute ActiveSettings.CoordinateFormat = msdMasterUnits
vba execute ActiveSettings.CoordinateAccuracy = msdAccuracy4
But as I wrote already, everything was discussed in the past...
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan, I found this statement:
For all possible values of accuracy constant, see MsdCoordinateAccuracy Type description in MicroStation VBA help (delivered with all MicroStation installations).
I opend VBA, and then the help. I typed in the following
msdcoordinteAccuracy and I must have misunderstood something because this is what I got.
I was hoping to find all the various code you know for many of the items listed in Settings>Design File>
some seem to have key-ins like KY= <VALUE>
seems every drawing I get it is a 1 and the 2 works so much better. I also like to set the two colors
for element highlight and Selection color, a quick Key-in or V code, I was using the term command because I was reading the statements or Code
and many say : CadInputQueue.SendCommand or CommandState.StartDefaultCommand Another error, I do want to learn the proper terms to converse and ask questions correct. I do search, as I have head others do. I was told once use goggle it works better ? I need to try that with these commands or code. As always thank you for any help.
Richard Phillips said:I must have misunderstood something because this is what I got.
You opened VBA help file, not MicroStation VBA help. There are two different chm files!
Jan, so hate to ask, I know how to open help F1, or I know how to open VBA project manager>open visual basic editor and then the help. But do not know how to load or open the Microstation VBA help. Is is possible you would tell me or give me a link. I have been checking ? I even did a search on the communities > Search and put in
for sure I am missing something. Any other information you would pass on?
Richard Phillips said:But do not know how to load or open the Microstation VBA help
did you try use F1?
Richard Phillips said:Is is possible you would tell me or give me a link. I have been checking ?
The most simple way is to simply search MicroStation installation, e.g. using Windows Explorer to search MicroStation folder (usually MicroStation V8i (SELECTseries)\MicroStation\) for *VBA*. It gives you a couple of findings...
... and voilà ... MicroStationVBA.chm is found in the same folder where ustation.exe is located.
Richard Phillips said:How to load or open the Microstation VBA help?
Look at this article about VBA help.
Once you've located that .chm file, use Windows to create a shortcut (right-click) and place that shortcut on your Windows desktop.
Regards, Jon Summers LA Solutions
Will DO and thank you so much. I was somewhere yesterday
reading a page of information you posted to help folks.
hope it is ok to add that information. Heading to try the link you gave me. and thank you and Jan again for helping this old man who also has a poor memory, @ 74 (c;
I wrote several MVBA code as below link:
The set working unit code is as below:
Sorry, all contents are in Chinese but code is same. You can use Google translator to turn to English.
well thank you for being willing to help. I will attempt to get a person to assist. on the Goggle translator. Do appreciate
Yongan.Fu So thank you This is what I got, super but I am going to English. I tried to convert your great example
but got lost in the Denominator and Numerator . I had started a new post with much more detail on the settings. Jan did give me the basic information, but I needed the Inches, Custom
Dim myUnit As MeasurementUnit
myUnit.System = msdMeasurementSystemMetric
myUnit.Base = msdMeasurementBaseMeter
myUnit.Label = "mm"
myUnit.UnitsPerBaseDenominator = 1
myUnit.UnitsPerBaseNumerator = 1000
ActiveModelReference.MasterUnit = myUnit
Anyway, I had lost this post and I realized I am way over my head, and did not word the question properly. If I knew the msg stuff you do I think I could get your code to work,
This link has the correct way to do what I was trying to do, A -G- posted the answer and it worked GREAT !!!!!
SO if it would help anyone else the above link is where it is. Thank you all for any attempt to assist me.