Hi all,
I have a key-in script to select all elements on a locked level and then calculate the length of the selected elements:
fit view extended;lock level on;active level = ln_piling;choose all;measure length;xy=0,0;lock level off
When I run this key-in it is not only selecting all the elements on the locked level [ln_piling] but it also selects shared cells on a totally different level. When I drop the shared cells to normal cells everything works fine. Test file available via e-mail request.
Is this a bug or is something wrong with my key-in script.
MS:08.11.09.654 / Inroads 08.11.09.788
Jean Castro
Unknown said: Hi all, I have a key-in script to select all elements on a locked level and then calculate the length of the selected elements: fit view extended;lock level on;active level = ln_piling;choose all;measure length;xy=0,0;lock level off When I run this key-in it is not only selecting all the elements on the locked level [ln_piling] but it also selects shared cells on a totally different level. When I drop the shared cells to normal cells everything works fine. Test file available via e-mail request. Is this a bug or is something wrong with my key-in script. MS:08.11.09.654 / Inroads 08.11.09.788 Jean Castro
Alternatively just use the power selector to select the level and deselect shared cells from the type then use the measure length tool to give you the length of you selection of all elements on you chosen level excluding shared cells
or if you still want your script then modify your keyin takeout the measure part , run your script
then through the power selector unclick shared cells , then use the measure tool to get the measured length without the shared cells.
You could record a vba macro of what you just did including the modified keyin to select all and the level of choice ... or just use the select tool to modify your select all whilst running the vba macro recorder..MStn basic wont capture the steps... I tried so as to find the hidden keyins ... I did find one with basic to switch to remove mode
POWERSELECTOR MODE REMOVE, you could put that at the end of your script
fit view extended;lock level on;active level = ln_piling;choose all;xy=0,0;lock level off;POWERSELECTOR MODE REMOVE
then in the power selector manually toggle off the type ie shared cells
and now as everything you want is in a selection set you can select the measure length tool or key in manually measure length and data point and you'll get the length of your selection..
..
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
ok still run your keyin , but then look at the power selector and choose the remove option or just click off shared cells
the selection set should still be active so clicking on measure length tool or keyin measure length will still give you the answer you seek without shared cells dropped as they are unselected.. its only 3 or so clicks extra to your script not really going to slow your productivity for one file ...
You dont need VBA brain to record a vba macro it either does what you want or it doesnt and if you can read basic and can recognise a keyin command then in the vba editor you may just find the keyin you need about 8 out 10 times this works for most tasks...
my approach is look in help for a command
then look in the keyin window for keyin combinations or sequences then look for set item tool settings for number variables to the keyins ( search this forum for set item tool settings and Ask Inga )
then I try a simple basic macro recorder to see if I can get a keyin ( but Bentley will do away with basic sooner than later)
then last of all I try VBA macro recorder...
and if its something I need to do often I will take all the keyins and make and "action string " script and assign that to custom Function Key ...very very cool ...I love the F keys...I even use them to run macros , vba , mdls, script files etc
Very very big time saver...