I have a tool bar button that brings on Level 5 and sets the various colors, weight and style
Sub ActiveLayerSet5()' 110413 - Changed command, removed Dim commands and the Command CommandState.StartDefaultCommandStart command' 09/23/2013 - SetCExpressionValue "tcb->symbology.color", 5, "MGDSHOOK" {This sets the actual color a -1 uses the bylevel}' 021313 - Tested again,
' Start a command CadInputQueue.SendCommand "ACTIVE LEVEL ""Level 5""" ' Set a variable associated with a dialog box CadInputQueue.SendCommand "ACTIVE Color Violet" CadInputQueue.SendCommand "ACTIVE STYLE 0" CadInputQueue.SendCommand "ACTIVE WEIGHT 0" CadInputQueue.SendKeyin "level set lock ON Level 5" CadInputQueue.SendKeyin "m,msLevel 5 Lock = ON" CadInputQueue.SendCommand "m,ms Active Level=5 Color 5, Style 0, Weight 5" 'Send Msg Center Box End Sub
as soon as I turn on 5, my temporary level. I have to do the manual pull down and turn on the padlock to lock the layer. (I have a reason for all this) I tried to find a key-in to turn the lock on , searched in ask Inga, found several on locking other things. I want through an array of Key-in commands attempting to find mine?
If there is a Key-in I can make it work, or if a VBA command, that would be great. If I get the one I can figure out the other. I did try to copy this with the Basic Macro and it got nothing in-between
' Turn on Level 5 Lock
Sub main Dim startPoint As MbePoint Dim point As MbePoint, point2 As MbePointEnd Sub
I went through the pull-down step, went to 5 and turned on the lock symbol, but you can see none of it was recorded?
VBA Recording:
Sub Macro1() Dim startPoint As Point3d Dim point As Point3d, point2 As Point3d Dim lngTemp As Long
' Start a command CadInputQueue.SendCommand "ACTIVE LEVEL ""Level 5"""
CommandState.StartDefaultCommandEnd Sub
Still did not pickup setting the lock, can someone help on this one?
Hi RJB,
key-in to lock a level: level set lock on "my level"
key-in to unlock a level: level set lock off "my level"
MicroStation VBA code simulating key-on to lock a level: CadInputQueue.SendCommand "level set lock on ""my level"""
MicroStation VBA code simulating key-on to unlock a level: CadInputQueue.SendCommand "level set lock off ""my level"""
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Answer Verified By: RJB