Returns a grid lineweight value for a grid linetype and row type.
Supported platforms: Windows only
Signature
VBA:
RetVal = object.GetGridLineWeight(gridLineType, rowType)
- object
-
Type: Table, TableStyle
The objects this method applies to.
- gridLineType
-
Access: Input-only
Type: AcGridLineType enum
The grid line type to check.
- acHorzBottom: Top or bottom horizontal grid line, based on the flow direction.
- acHorzInside: All horizontal grid lines, excluding the top and bottom lines.
- acHorzTop: Top or bottom horizontal grid line, based on the flow direction.
- acInvalidGridLine: An invalid grid line.
- acVertInside: All the vertical grid lines, excluding the farthest left and farthest right grid lines.
- acVertLeft: Farthest left grid line.
- acVertRight: Farthest right grid line.
- rowType
-
Access: Input-only
Type: AcRowType enum
The row type.
- acDataRow
- acHeaderRow
- acTitleRow
- acUnknownRow
Return Value (RetVal)
Type: ACAD_LWEIGHT enum
- acLnWt000
- acLnWt005
- acLnWt009
- acLnWt013
- acLnWt015
- acLnWt018
- acLnWt020
- acLnWt025
- acLnWt030
- acLnWt035
- acLnWt040
- acLnWt050
- acLnWt053
- acLnWt060
- acLnWt070
- acLnWt080
- acLnWt090
- acLnWt100
- acLnWt106
- acLnWt120
- acLnWt140
- acLnWt158
- acLnWt200
- acLnWt211
- acLnWtByLayer
- acLnWtByBlock
- acLnWtByLwDefault
Remarks
No additional remarks.
Examples
VBA:
Sub Example_GetGridLineWeight() ' This example creates a TableStyle object and sets values for ' the style name and other attributes. Dim dictionaries As AcadDictionaries Set dictionaries = ThisDrawing.Database.dictionaries Dim dictObj As AcadDictionary Set dictObj = dictionaries.Item("acad_tablestyle") ' Get the current TableStyle object Dim tableStyle As AcadTableStyle Set tableStyle = dictObj.Item(ThisDrawing.GetVariable("CTABLESTYLE")) Dim colGridCurrent As AcadAcCmColor, lwGridCurrent As ACAD_LWEIGHT, visGridCurrent As Boolean Set colGridCurrent = tableStyle.GetGridColor(acHorzBottom, acTitleRow) lwGridCurrent = tableStyle.GetGridLineWeight(acHorzBottom, acTitleRow) visGridCurrent = tableStyle.GetGridVisibility(acHorzTop, acTitleRow) MsgBox "Grid settings " & vbLf & _ "nColor (Bottom) = " & colGridCurrent.ColorIndex & vbLf & _ "nLineweight (Bottom) = " & lwGridCurrent & vbLf & _ "Visibility (Top) = " & visGridCurrent Dim col As AcadAcCmColor Set col = tableStyle.GetGridColor(acHorzBottom, acTitleRow) col.SetRGB 0, 0, 255 tableStyle.SetGridColor acHorzBottom, acTitleRow, col tableStyle.SetGridLineWeight acHorzBottom, acTitleRow, acLnWt025 If visGridCurrent = False Then tableStyle.SetGridVisibility acHorzTop, acTitleRow, True Else tableStyle.SetGridVisibility acHorzTop, acTitleRow, False End If Dim colGridNew As AcadAcCmColor, lwGridNew As ACAD_LWEIGHT, visGridNew As Boolean Set colGridNew = tableStyle.GetGridColor(acHorzBottom, acTitleRow) lwGridNew = tableStyle.GetGridLineWeight(acHorzBottom, acTitleRow) visGridNew = tableStyle.GetGridVisibility(acHorzTop, acTitleRow) MsgBox "Grid settings " & vbLf & _ "nColor (Bottom) = " & colGridNew.ColorIndex & vbLf & _ "nLineweight (Bottom) = " & lwGridNew & vbLf & _ "Visibility (Top) = " & visGridNew tableStyle.SetGridColor acHorzBottom, acTitleRow, colGridCurrent tableStyle.SetGridLineWeight acHorzBottom, acTitleRow, lwGridCurrent tableStyle.SetGridVisibility acHorzTop, acTitleRow, visGridCurrent MsgBox "Reset the table style back to its original values." End Sub
Visual LISP:
(vl-load-com) (defun c:Example_GetGridLineWeight() ;; This example creates a TableStyle object and sets values for ;; the style name and other attributes. (setq acadObj (vlax-get-acad-object) doc (vla-get-ActiveDocument acadObj)) (setq dictionaries (vla-get-Dictionaries doc) dictObj (vla-Item dictionaries "acad_tablestyle")) ;; Get the current TableStyle object (setq tableStyle (vla-Item dictObj (vla-GetVariable doc "CTABLESTYLE"))) (setq colGridCurrent (vla-GetGridColor tableStyle acHorzBottom acTitleRow) lwGridCurrent (vla-GetGridLineWeight tableStyle acHorzBottom acTitleRow) visGridCurrent (vla-GetGridVisibility tableStyle acHorzTop acTitleRow)) (alert (strcat "Grid settings" "\nColor (Bottom) = " (itoa (vla-get-ColorIndex colGridCurrent)) "\nLineweight (Bottom) = " (itoa lwGridCurrent) "\nVisibility (Top)= " (if (= visGridCurrent :vlax-true) "True" "False"))) (setq col (vla-GetGridColor tableStyle acHorzBottom acTitleRow)) (vla-SetRGB col 0 0 255) (vla-SetGridColor tableStyle acHorzBottom acTitleRow col) (vla-SetGridLineWeight tableStyle acHorzBottom acTitleRow acLnWt025) (vla-SetGridVisibility tableStyle acHorzTop acTitleRow (if (= visGridCurrent :vlax-true) :vlax-false :vlax-true)) (setq colGridNew (vla-GetGridColor tableStyle acHorzBottom acTitleRow) lwGridNew (vla-GetGridLineWeight tableStyle acHorzBottom acTitleRow) visGridNew (vla-GetGridVisibility tableStyle acHorzTop acTitleRow)) (alert (strcat "Grid settings" "\nColor (Bottom) = " (itoa (vla-get-ColorIndex colGridNew)) "\nLineweight (Bottom) = " (itoa lwGridNew) "\nVisibility (Top)= " (if (= visGridNew :vlax-true) "True" "False"))) (vla-SetGridColor tableStyle acHorzBottom acTitleRow colGridCurrent) (vla-SetGridLineWeight tableStyle acHorzBottom acTitleRow lwGridCurrent) (vla-SetGridVisibility tableStyle acHorzBottom acTitleRow visGridCurrent) (alert "Reset the table style back to its original values.") )