I've always tried to share what I can as it's hard enough to find admin docs on many of the applications Bentley now own, and my recent dive into ProSteel on MicroStation (PS) was no different. In fact, it's probably been one of the harder applications I've played with in recent times. More on that throughout this blog.
As with all of the applications I work with, my main aim was to be able to deliver it in the CADmanage environment I have developed. This was a challenge from the start as PS doesn’t use traditional appl cfg files as with other applications. In fact, some cfg files within PS are not used as is the standard with a great majority of Bentley applications.
One file in particular is critical to the whole ability to network a PS build:
…….\ProStructures\V8i_S5\MicroStation081109\Prg\Config\pro_st3d.cfg
The issue with this file is 3 fold. The first is that PS does not use these paths set as we would normally expect. While it does process them, the variables do not show is any debug or in the variables list through Workspace<Configuration.
The second, and critical point, is that setting some of these paths to the network can cause issues. It took me some time to work this out. Luckily enough I can across another blog:
http://communities.bentley.com/other/old_site_member_blogs/bentley_employees/b/tegel_zarate_blog/archive/2013/02/25/tip-no-1-prostructures-installation.aspx
which deals with a single application option to network PS. Pay close attention to the paths listed at the end and which can\should be networked:
‘At the bottom of this file are located the paths to ProStructures files. We need to make a few adjustments. The bold/red lines below are the lines we need to change. The green lines bellow each red line are the replacement lines. Keep in mind this applies here according to the mapped drive we created and the folder in which we placed the local folder in.
DATAPATH=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2012\Data DATAPATH=X:\ProStructures\Data TEMPPATH=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2012\Temp TEMPLATEPATH=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2012\Varia TEMPLATEPATH=X:\ProStructures\Varia DETAILPATH=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2012\Detail NCPATH=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2012\Nc BLOCKCENTERPATH=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2012\Localised\English\UserBlocks BLOCKCENTERPATH=X:\ProStructures\Localised\USA_Canada\UserBlocks FACTORYSETTINGSPATH=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2013\FactorySettings USERSHAPES=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2012\Data\UserShapes USERSHAPES=X:\ProStructures\Data\UserShapes ROOFWALLPANELS=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2012\Data\RoofWall ROOFWALLPANELS=X:\ProStructures\Data\RoofWall COMBISHAPES=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2012\Data\CombiShapes COMBISHAPES=X:\ProStructures\Data\CombiShapes WELDSHAPES=C:\Program Files\Bentley\ProStructures\V8i_S5\AutoCAD 2012\Data\WeldShapes WELDSHAPES=X:\ProStructures\Data\WeldShapes
This operation (changing the "pro_st3d.cfg" file) needs to be performed on every computer that has ProStructures installed on and that we want to setup as a network sharing installation.’
Thirdly, and a real game changer with networking PS, is that the paths in this file do not use traditional style variables and can only use full paths. This means that the only real way to network PS is to have each any every part of the PS build in the project. A real pain and something I hope the developers change going forward with the product. If nothing else, the way in which these cfg files work needs to be brought in line with all other Bentley applications. Rant over.
OK, so now I’m limited in how I can deliver the build, what other option is there? The only easy option is to have the whole PS build in the project and use the start button to point to this location. After looking at a few options, I decided on revamping the delivered PS short cut:
C:\Apps\Bentley\MS811_SS3\MicroStation_V8i\MicroStation\ustation.exe -wc"C:\Apps\Bentley\MS811_SS3\ProStructures\V8i_S5\MicroStation081109\Prg\Config\ps3d_ustn.cfg"
It’s easy enough to revamp this shortcut to use the variables set in the hta. To make this work in a project build, it needs to use the project variable. What we end up with is:
Sub StartProst
If (oEnv("Phase")) <> "Legacy" Then
objFSO.CopyFile Site_Root + "MS811_SS3\Standards\data\std_appl.cfg" , BentleyV8iRoot + "MicroStation\config\appl\", OverwriteExisting
End If
If (oEnv("Phase")) <> "" Then
'msgbox BentleyV8iRoot + "MicroStation\ustation.exe" + " -wc""" + Bentley_Root + "Site\MS811_SS3\Project\" + oEnv("Phase") + "\ProStructures\V8i_S5\MicroStation_081107S2\Prg\Config\ps3d_ustn.cfg"""
WshShell.run BentleyV8iRoot + "MicroStation\ustation.exe" + " -wc""" + Bentley_Root + "Site\MS811_SS3\Project\" + oEnv("Phase") + "\ProStructures\V8i_S5\MicroStation_081107S2\Prg\Config\ps3d_ustn.cfg"""
Else
msgbox "Please Select a Phase first !"
End Sub
I leave the msgbox line in so I can debug paths if I feel I’ve made a mistake. The critical line in this is:
WshShell.run BentleyV8iRoot + "MicroStation\ustation.exe" + " -wc""" + Bentley_Root + "Site\MS811_SS3\Project\" + oEnv("project") + "\ProStructures\V8i_S5\MicroStation_v01\Prg\Config\ps3d_ustn.cfg"""
(for a refresher on how to use hta files, check out the previous blogs)
I’ve used the ‘ProStructures’ directory from the PS install as a base for my build. You could go through and pull out the bits you want, but this could take some time. The shortcut now points to the file in the site area of my build, which is where I keep my project builds and a ‘project’ orientated location for the base cfg file.
The button for this works the same as for other applications:
<button id="startprobutton" onclick="StartProst" name="StartProst" value="ProStructures" class="aButton"><img src="img\MS811_STR.gif" align="left" alt="ProStructures">ProStructures</button><br>v
Within the hta itself, the only extra code I have added is to have the ability to have the button turn off if the ps3d_ustn.cfg in not available, meaning there is now PS project. This works on top of the check to see if PS has been installed.
The code for this is:
If MSpath.FileExists(Bentley_Root + "Site\MS811_SS3\Project\" + oEnv("project") + "\ProStructures\V8i_S5\MicroStation_v01\Prg\Config\ps3d_ustn.cfg")=false then
startprobutton.disabled=True
end if
Now we have our base, it’s time to make sure we set our network variables correctly. Again, this turned out to be a real case of trial and error as there will be issues if you try and run everything from the network.
First stop is the ps3d_ustn.cfg file and we end up with:
#
# ps3d_ustn.cfg - ProStructures for Microstation Local Configuration File
# Copyright: (c) 2012 Bentley Systems Incorporated. All rights reserved.
#------------------------------------------------------------------------
# Define location of the product and its MS configuration files.
STD_Workspace_PROSTR = $(hta_sBentley)Site/$(STD_MS)/Project/$(Phase)/ProStructures/
MS_PROSTEEL3D = $(STD_Workspace_PROSTR)V8i_S5/MicroStation_v01/Prg/
%lock MS_PROSTEEL3D
_USTN_ECAPPL = $(MS_PROSTEEL3D)Config/appl/
# Include MicroStation configuration file
%include $(_ROOTDIR)/Config/mslocal.cfg
Nothing show stopping here, but what I have done is use the _USTN_ECAPPL off the network as well. The reason for this is that I wanted to make double sure that the one file in this directory was set correctly. The file is product.cfg and I have edited it as such:
# product.cfg - ProStructures for Microstation Application Configuration File
MS_PROSTEEL3D_LOCAL = C:\Apps\Bentley\MS811_SS3\ProStructures\V8i_S5\MicroStation081109\Prg/
# To load the ProStructures application...
_USTN_FIRSTDGNAPPS < $(MS_PROSTEEL3D_LOCAL)PsUSTN.ma
# Set paths to find ProStructures library files
MS_LIBRARY_PATH < $(MS_PROSTEEL3D_LOCAL)
# Set paths to find ProStructures applications
MS_MDL < $(MS_PROSTEEL3D_LOCAL)
MS_MDLAPPS < $(MS_PROSTEEL3D_LOCAL)
MS_ADDINPATH < $(MS_PROSTEEL3D_LOCAL)
# Set filter to find ProStructures icon files
MS_ICONRSCLIST < $(MS_PROSTEEL3D_LOCAL)*.rsc
# Set filter to find ProStructures menu files
MS_DGNLIBLIST < $(MS_PROSTEEL3D_LOCAL)*.dgnlib
# Load the ProStructures Persistence Stategy
EC_EXTENSION_ASSEMBLIES < publishdgn.prostructures.v2.dll
# Set filter to find ProStructures Propery Enabler Schema file
MS_ECFRAMEWORK_SCHEMAS < $(STD_WORKSPACE)ProStructures/ECSchemas/ProStructures/
The key here is to make sure that all of the files in this cfg run locally and I’ve forced this using the variable MS_PROSTEEL3D_LOCAL . The issue here is that running some of the PS dll files across a network will cause issues and in some cases cause the program to exception error and continuously crash. Lesson learnt.
From a ProSteel point of view, this is really as much as you need to do as many of the other product paths can only be set from within the Project Management tools. The real danger here is that users can edit these so make sure you audit these on a regular basis. I hope this sort of thing becomes a lot more variable controlled so they can be set once and locked from cfg files instead of having to control then from different locations.
I hope to have more of my PS pondering available soon. In the meantime, feel free to add and share what you have done with PS. Who shares, wins.