I have a follow-up question. In general, can we modify built in commands using VBA? I would like 2 separate commands:
1. Drawing a line at a slope.
2. Annotate/Measure the slope of a line.
Both commands are almost available in Microstation and I just need a slight change.
1. Instead of defining angle for command place line. I want to define slope (1:x) or percentage (5%).
So I hope, that there is an option to make simple macro that modifies the command place a line at angle as follows. Macro opens a form similar to that below where user define his input and based on format a function in the macro calculates the angel that is send to build in command place a line at angle. The user would picked 2 points while accudraw and snap modes available and it's done.
2. Instead of labeling line with angle (element dimensioning -> label line). I want to label it with 1:x or 5%.
In this case we just need to multiply the value by right number (calculated in macro) and add prefix or suffix. It would remain associative.
Are both cases possible for ordinary users or it is somehow protected and only bentley's developers can do this slight changes?
I appologize if my question is too silly because I am a total VBA and Microstation beginer.
Tom
Tomáš Prokš said:Can we modify built in commands using VBA?
The precise answer is 'no'. However, it rather depends what you mean by 'modify'.
You may be able to adjust the settings of a MicroStation command. Start by recording a VBA macro while you excercise the command. The macro may capture the application variables that are changed. Once you know the app's variable names you can change them using VBA's SetCExpressionValue method.
SetCExpressionValue
Regards, Jon Summers LA Solutions