When selecting the 'Drop Element' command in a MicroStation session, the tool settings box offers a selection of element types for the command to operate on. By default, complex and shared cells are selected. To issue this command programmatically is not an issue, but I would like to also change the default selection types (Include linestrings & shapes). Is there structure available to set these selections automatically before issuing the command??
Labyrinth Technology | dev.notes() | cad.point
You can set the option using VBA SetCExpressionValue("dropOptions.strings",-1,"DROP") or using the BASIC editor ' Set a variable associated with a dialog box MbeSetAppVariable "DROP", "dropOptions.strings", -1& I did not try this, but it should work. Also, I am sure there is something available in MDL but I do not know if off the top of my head
Maury said:SetCExpressionValue("dropOptions.strings",-1,"DROP")I am sure there is something available in MDL...
VBA SetCExpressionValue is a wrapper around MDL's mdlCExpression_api. Probably mdlCExpression_setValueForApp would do the trick.
Many of MicroStation's settings are published in the header files, so you can twiddle the bits directly using MDL. However, an increasing number of commands is implemented as separate apps. where the header files are not published. Our recourse is to do as you advise: record a VBA macro and translate the result into MDL.
Regards, Jon Summers LA Solutions
Further to others' suggestions, you can also preset the "Drop Element" tool using key-in: "set item toolsettings <option> = <1|0>"
The only thing with using the "set item toolsettings" key in is that you can only use it after a tool has been run. So the sequence of key-in would be:
set item toolsettings <option1> = <1|0>
set item toolsettings <option2> = <1|0>
or to combine them into a singleline:
drop element;set item toolsettings <option1> = <1|0>;set item toolsettings <option2> = <1|0>;...
If you want more information on how to utilise the key in, you can refer to these 2 AskInga posts:
Note that there's a limit on the number of characters in a combined key-in, so you may not be able to preset all the tool options using just 1 keyin. If you find yourself there, VBA would be the best way to go.
For interests sake , what is the limit on characters in a key combination?
MicroStation user since 1990 Melbourne Australia.click link to PM me
Lorys said:For interests sake , what is the limit on characters in a key combination?
The answer is 42 :)
Tuan Le said:Seriously though, 255 is the limit that you can type into the key-in browser (at least that's what I see on SS3), I would imagine the same limit would apply for accudraw keyin shortcut, hotkeys etc.
if you run out of characters in a keyin then download the old keyins I just posted and substitute as many primitives and 2 letter keyins as you can get to still run in your current version of msnt....