I used to have a cell placement tool that when i picked a cell, i could right click and it would rotate 90, then 90 again. I can't figure out how to do this in the button assignments. Does anybody know an easy way to do this? or an easy key in that will allow something like active angle=90+90+90, etc
When pasting in the Immediate Window, you don't need the VBA Execute part
only this:
ActiveSettings.Angle = ActiveSettings.Angle + Pi / 2
When you paste in the Key-in, you use this:
vba execute ActiveSettings.Angle = ActiveSettings.Angle + Pi / 2
Answer Verified By: Cole DeBolt
Great! Please mark this thread as Answered.
Regards, Jon Summers LA Solutions
Cole DeBolt said: How do I run it from the immediate window?
The Immediate window is part of the VBA IDE. You can type a VBA statement and see the immediate result. For example, try this in either MicroStation VBA or Excel VBA...
? "My name is Cole"
The Immediate window is part of VBA, and doesn't understand a MicroStation command such as VBA Execute . Barry Lothian and I have both provided screenshots of the Immediate window.
Cole DeBolt said:I don’t get why it won’t work in the key in window
The key-in window is a MicroStation window. MicroStation doesn't understand VBA statements unless prefixed VBA Execute. MicroStation VBA help documents the available key-ins. I gave you a hint about that earlier in this thread.
VBA Execute
vba execute VBA statement
vba run macro-name
Hi Cole,
I know the answer is answered and I join the discussion lately.
In my opinion to call VBA is overkill for the discussed purpose. My solution is to use MicroStation calculator instead, which is standard functionality:
calculator tcb->actangle = (tcb->actangle + 90)
In fact, I treat both solutions (VBA and calculator) as not perfect, because the active angle value is increased with every use. It is not error, but I would prefer to really cycle values in 0 - 360 range. But it requires more complex VBA code and probably cannot be achieved using simple key-in.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr said:I would prefer to really cycle values in 0 - 360 range. But it requires more complex VBA code and probably cannot be achieved using simple key-in.
CONNECT key-in...
macro vba execute ActiveSettings.Angle = IIf(ActiveSettings.Angle > (2 * Pi), 0, ActiveSettings.Angle + Pi / 4);aa=
V8 key-in...
vba execute ActiveSettings.Angle = IIf(ActiveSettings.Angle > (2 * Pi), 0, ActiveSettings.Angle + Pi / 4);aa=
calculator tcb->actangle = (tcb->actangle >= 360)? 0: (tcb->actangle + 90);aa=
The key-in has ;aa= appended, which echoes the new active angle (AA) in MicroStation's status bar.
;aa=
AA