Hey all,
Is there any record of a change in V8i or maybe XM where user defined Microstation variables are no longer valid in a basic macro?
For years I had used this but now I'm hitting a wall converting workspaces to 8i.
Thanks,
Mike
Additionally, please explain what you mean by 'MicroStation variables'. As usual, a code snippet is worth 1,000 words of explanation.
Regards, Jon Summers LA Solutions
Gentleman,
Thanks for the replies.
These are small Microstation basic routines that were created in V8.
The variables are user defined in a pcf or ucf.
This is a line from the .bas
MbeSendCommand "set PLOTTER $(CLIENT)Plot\Charlotte\CSXT_M_oce_34.PLT"
Variable is defined in the ucf as follows:
CLIENT = $(CLIENT_STD)CSXT_Rail/
which expands to:
"G:\CAD\Standards\CSXT_Rail\"
I've confirmed the files exist as indicated in the path indicated.
It's all very straightforward but for some reason the variable does not expand either in the macro or as a direct keyin as in older versions.
Hope that helps.
You'll need to expand the variable in the vb and assign it to be used, an example I use is below:
Const str_Standard_Bld As String = "$(STD_STDS)"
StdLcn = ActiveWorkspace.ExpandConfigurationVariable(str_Standard_Bld)
' Start a command
CadInputQueue.SendCommand "NEWFILE " + StdLcn + "seed\a1_2d_seed.dgn"
Hi Bear,
unfortunately Mike uses old MicroStation Basic, not VBA :-( ... and I have to say I think there is no expand variable MicroStation Basic command.
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Woops, my bad. Agreed on expand though. Pretty easy to change this sort of thing to vb though :-)
Guys,
My concern is a lack of time to change through 50 odd client workspaces. It's just not doable for what seems like the last year. But if its no longer doable I don't have much of choice.
Just need a ruling so I can figure how to proceed.
Thanks for the input,
Hi Mike,
Phil Ch. notified me (thanks!) about string = MbeGetConfigVar(cfgVarName as String) function. It seems it is what you are looking for, expand $(CLIENT) variable before you use it in MbeSendCommand.
I understand your situation and your concerns, unfortunately you use something that was marked as obsolete (many) years ago when VBA was introduced in MicroStation. So the probability somebody will know a question without a recall and testing is quite low and it takes some time :-(
The only recommendation for you (from longer time perspective) is to migrate to VBA, from plt to pltcfg and may be from other former technologies and functions that were moved to obsolete/not supported category.
HTH Jan
Jan,
Thanks for the tip. Honestly I don't see microstation basic going away too soon. I know its the plan of Bentley but too many users and agencies have them intertwined with their workspaces to not raise cain at the idea when or if it finally happens.
As far as plt vs. pltcfg goes, I am having a hard time justifying the move over to a format that just gives me a nice interface. The plt format has more configurability and I do most of my editing remotely, so editing a text file in notepad is far easier than opening V8i and editing from there and saving. I'm not completely sold as yet
Unknown said: As far as plt vs. pltcfg goes, I am having a hard time justifying the move over to a format that just gives me a nice interface. I do most of my editing remotely, so editing a text file in notepad is far easier than opening V8i and editing from there and saving. I'm not completely sold as yet.
Both plt & pltcfg are both text files: pltcfg happens to use XML.
You can edit an XML file with Notepad, although it may not be a pleasant experience. Better, you can edit an XML file with more appropriate tools. One such tool is Microsoft's freeware XML Notepad.
Thanks for the tip Jon.
That will definitely make the creation and editing a lot easier.