I am a new MicroStation CONNECT Edition user (Version 10.13.01.01)
Could someone direct me to a good source of information on scripts and batch files. Books, websites anything? I am a beginner and would like something that walks you through examples from the most simple to complex.
Thanks
Start simple. Check out the Batch Process tool. You'll find it under File > Tools > Batch Process.
To use it you first create a text file in Notepad (or other text editor) containing the MicroStation key-in commands you want to execute.
In the Batch Process dialog you select your text command file, and the dgn files on which you want to run your command file. Click the Process button then each dgn file is opened in sequence and the command file is executed on each one.
Rod WingSenior Systems Analyst
Hi Koog,
Koog said:Could someone direct me to a good source of information on scripts and batch files.
Can you provide more details what do you mean by "scripts and batch files"?
I have heard these terms to be used in many different meanings, e.g. as Rod answered, to be used with Batch Process tool, but for some users "script" is equivalent to "simple VBA macro", so to explain what do you want to achieve or what tool want to use will help to provide more precise answer.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Rod,
First of all, thanks for the information about running the Batch Process tool. I am looking forward to trying it.
Being a new user, I am not familiar with many key-in commands and don't know what is possible as far as writing scripts. Is there a list of key-ins somewhere? Could you give me an example of how to select a Line Type with a key-in command and change the color and level? That would be helpful.
Thanks,
Koog
Jan,
Rod is on the right track. I only need to make some simple changes to many drawings. For example: I would like to select a line type and change its properties or select a color or level and change properties. If I could run a Batch Process like Rob mentioned, it might work wonders for me now. As of now, I can't find any examples showing just how to write what I believe would be a simple script.
I am interested in VBA also and have found a book that might be helpful. I think it is, "VBA for MicroStation" or something like that. For now, I am only interested in key-in scripts. I have many drawings to edit in a short time. The learning curve and time would prohibit VBA for now.
Koog said:I am not familiar with many key-in commands
Probably nobody is familiar with all MicroStation key-ins.
BTW Use "key-in", not "key-in commands", it's a bit redundant, and also has slightly different meaning in some context (e.g. a tool command can consist from a sequence of key-ins).
Koog said:and don't know what is possible as far as writing scripts
Again, please tell us what do you mean by "scripts". The are scripts for batch process, batch conversion, for printing you can DesignScript language etc.
Koog said: Is there a list of key-ins somewhere?
Yes, even when maybe not completed (because some key-ins are hidden, some are not in normal list, some available are not "official").
Koog said:Could you give me an example of how to select a Line Type with a key-in command
The simplest way is probably to record VBA macro and check the result. But at first, you have to choose what tool you will use, because in some case the same or similar task can be done using more workflows or tools.
To select elements using their properties, you will probably use Select by Attributes tool. And for every tool, MicroStation documentation provides description including available key-ins.
The "key-ins chain" (command) in this case will be something like:
mdl load selectby dialog selectby level none selectby level "level to be included" selectby type none selectby type line selectby execute
It can be merged into one command:
mdl load selectby dialog;selectby level none;selectby level "level to be included";selectby type none;selectby type line;selectby execute
Koog said:and change the color and level?
It can be done using several different key-ins and tools, e.g.
' Assuming elements are selected co=10 'color number change color lv="new level" change level
Koog said:I am looking forward to trying it.
At first you have to be able to do it manually from Key-in dialog. When key-in works, the migration to Batch process is usually simple (but you have to ensure no key-in requires data point or other form of acceptance).
With regards,
Answer Verified By: Koog