Tech Tip - Managing Seed Files

Lets get it out there right to start with. I know this could be a LOT slicker and in environments I manage on my own it is, but this is a good alternative where you have users who may need to edit this without a LOT of vb knowledge.

Now we have that out of the way, one things that gets users to this day is seed files and how\when to use them. To work around a user needing to know what seed does when I have written some vb that runs off a menu selection in the guidgnlib:

One run, a dialog\form appears:

This is where the users can select the discipline directory where the files is to be created and write down the file name:

Once completed, the user hits run and the vb does to the seed file directory and opens the required file and simply does a 'save-as' to the new directory with the correct name. Once complete the users gets an alert:

I have attached one of the vb apps I use. Just rename to a mvba to view and use in MicroStation. 

One fail safe built into the vb is to show an alert if a file name already exists in a directory. A message box is shown then the app is closed:

If ExistFile.FileExists(SavePth + newfile + ".dgn") Then
msg = "File exists please check file name"
response = MsgBox(msg)


This is where using standard locations for files is very important. I can use my build variables to locate the seed file:

    Const str_Standard_Bld  As String = "$(STD_STDS)"
StdLcn = ActiveWorkspace.ExpandConfigurationVariable(str_Standard_Bld)

CadInputQueue.SendCommand "NEWFILE " + StdLcn + "seed\a1_3d_seed.dgn"

I can then use my variables to locate the project and plug in the discipline and drawing or model location:

Dim ExistFile As Scripting.FileSystemObject
Set ExistFile = New Scripting.FileSystemObject

newfile = (Create_3d_Drg.TextBox1.Value)

Discipline = (Create_3d_Drg.DiscList.Value)

Const str_CADNETpath As String = "$(CADNET)"
CADNETpath = ActiveWorkspace.ExpandConfigurationVariable(str_CADNETpath)
SavePth = CADNETpath + Discipline + "\01_Drgs\"

One thing this app has done is reduce to zero any calls I've ever had on seed files and how to use them. Once you are happy with your vb knowledge you can expand on this and build it into a single dialog front end, but that's for another day.

More soon.