I have read this article: communities.bentley.com/.../how-to-string-keyins-together-or-create-keyin-scripts
and found it very helpfull. But I am not able to do key-ins that will wait for the user to give input. The closest so far is eg. this:
"
rotate view element;%d;hatch element
I wanted to rotate the view to match the element to hatch, so the hatch would appear alike in all elements. The key-in above activates the tool Rotate view, and it waits for the user to select a element, BUT it does not rotate the view. Afterwards the hatch element dialog is activated as desired. So why is the rotate element command not executed?
under help look up action strings to have a better understand of strings, some need to wait for user input others are terminated and other simulate user input..
There are examples of these and is most helpful for scripting...
The fault with your script is after rotate view element it needs a data point in the to accept view to know which view to rotate..
and wont work with shapes where as
E,ROTATE VIEW EXTENDED;%d;%d;e,hatch
rotates view by 2 points ( which also works with shapes) , uses the data point to know which view is to be rotated by 2 points, the, E then hatch tells
whatever keyin is specified, it is always activated regardless of the state of the current tool so it ends the rotation command and no need for a reset comand
then runs the hatch...
I have tested this in 2 d environment and script works great but you may want to work out what settings for you hatching .. if you want keyins for hatching
then macro programming is better like vba or basic ,remember basic is not good at catching all scripts from dialogs and will be discontinued in next version release of mstn...
Lorys
Started msnt work 1990 - Retired Nov 2022 ( oh boy am I old )
But was long time user V8iss10 (8.11.09.919) dabbler CE update 16 (10.16.00.80)
MicroStation user since 1990 Melbourne Australia.click link to PM me