I want to create a custom button to modify a dimension.
I want to change the DIMGAP value of only a selected dimension.
What I'm doing now is I open the properties window (ctrl+1), I select the dimension I want changed in the drawing, and I change the value of "text offset" ("text offset" is the same as the system variable DIMGAP). What I want is to select the dimension, click the button, and enter the new DIMGAP value.
Does anyone know the line of macro that would be in the custom button. Is this possible? I don't want to change the default DIMGAP value for the whole drawing, only a selected few.
Here's a post on how to run a VBA macro from a toolbar button:
Here's the code:
Public Sub DimTxtGap()
Dim ssPick As AcadSelectionSet
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
Dim dblinput As Double
Dim ssObj As AcadEntity
Set ssPick = ThisDrawing.SelectionSets.Add("DimObjs")
.Prompt vbCrLf & "Select Dimension(s) :"
FilterType(0) = 0: FilterData(0) = "DIMENSION"
ssPick.SelectOnScreen FilterType, FilterData
.Prompt vbCr & ssPick.Count & " entities selected"
dblinput = .GetReal(vbCrLf & "Text offset value: ")
For Each ssObj In ssPick
ssObj.TextGap = dblinput
If Not ssPick Is Nothing Then