Through this forum, we want to create a Francophone exchange place on Bentley Systems products.
Good humour and courtesy are of course to be given. We reserve the right to exclude members who would be contrary to the objectives pursued.
If a section does not exist and you wish to be present, ask us via the form at the bottom of the page.
Type a command in the keyboard input
Citation of GUYON Dominique on 12 December 2018, 9 h 35 minHello.
I want to create an order that will either be in the cell selector or a command in the Tasks menu of the "personalized" workspace.
This command is:
Select a level to assign it a new color or trait style of the genre:
select level 10;co=96; change color
Thank you in advance,
Regrettably,
Dominica
Hello.
I want to create an order that will either be in the cell selector or a command in the Tasks menu of the "personalized" workspace.
This command is:
Select a level to assign it a new color or trait style of the genre:
select level 10;co=96; change color
Thank you in advance,
Regrettably,
Dominica
Citation of Philippe HALET on 12 December 2018, 11 h 32 minHello, Dominique.
To my knowledge, there is no way of redefining the level symbology parameters via a keyboard command (key-in). However, the VBA can save you with a very simple code:
Sub ModifyLevel()
Dim strArgs() As String' The arguments to provide will be: level name, color, style, thickness
strArgs = Split(KeyinArguments, ",")If UBound(strArgs) <> 3 Then
MsgBox "Number of incorrect arguments!", vbExclamation, "Alert"
Else
Dim strLevel As String
Dim iColour As Integer
Dim strLineStyle As String
Thickness As IntegerstrLevel = strArgs(0)
iColor = Cint(strArgs(1))
strLineStyle = strArgs(2)
iWidth = Cint(strArgs(3))Application.ActiveDesignFile.Levels(strLevel).ElementColor = iColor
Application.ActiveDesignFile.Levels(strLevel).ElementLineStyle = Application.ActiveDesignFile.LineStyles(strLineStyle)
Application.ActiveDesignFile.Levels(strLevel).ElementLineWeight = iWidth
Application.ActiveDesignFile.Levels.Rewrite
End IfEnd Sub
To use the VBA macro, simply enter the following command:
VBA RUN ModifyLevel [Level Name],[Color],[Line Style],[Width]
For example: VBA RUN ModifyLevel 1, 3,( Border ), 4
I hope this can help you!
Philippe
Hello, Dominique.
To my knowledge, there is no way of redefining the level symbology parameters via a keyboard command (key-in). However, the VBA can save you with a very simple code:
Sub ModifyLevel()
Dim strArgs() As String
' The arguments to provide will be: level name, color, style, thickness
strArgs = Split(KeyinArguments, ",")
If UBound(strArgs) <> 3 Then
MsgBox "Number of incorrect arguments!", vbExclamation, "Alert"
Else
Dim strLevel As String
Dim iColour As Integer
Dim strLineStyle As String
Thickness As Integer
strLevel = strArgs(0)
iColor = Cint(strArgs(1))
strLineStyle = strArgs(2)
iWidth = Cint(strArgs(3))
Application.ActiveDesignFile.Levels(strLevel).ElementColor = iColor
Application.ActiveDesignFile.Levels(strLevel).ElementLineStyle = Application.ActiveDesignFile.LineStyles(strLineStyle)
Application.ActiveDesignFile.Levels(strLevel).ElementLineWeight = iWidth
Application.ActiveDesignFile.Levels.Rewrite
End If
End Sub
To use the VBA macro, simply enter the following command:
VBA RUN ModifyLevel [Level Name],[Color],[Line Style],[Width]
For example: VBA RUN ModifyLevel 1, 3,( Border ), 4
I hope this can help you!
Philippe