Тема: Как создать изначально размерный стиль?

Как создать изначально размерный стиль через VBA со всеми необходимыми значениями, стрелки, высота текста и т.д.?

Re: Как создать изначально размерный стиль?

С помощью изменения системных переменных - DIM*
Потом создаешь свой стиль как копию текущего.

Private Function fDimensionToScale(dTH As Double, cStyle As String)
    On Error Resume Next
    Dim SavedDimStyle As AcadDimStyle
    Dim newDimStyle As AcadDimStyle
    Dim iPrec As Integer
    iPrec = Len(cDimPrec) - InStr(1, cDimPrec, ".")
 
    
    ' Create a dimension style and makes it current
    Set newDimStyle = ThisDrawing.DimStyles.Add("XSECDIM")
    
    ThisDrawing.ActiveDimStyle = newDimStyle    ' set current dimension style to newDimStyle
    ThisDrawing.SetVariable "DIMTXSTY", cStyle '' text style for dimensions
    ThisDrawing.SetVariable "DIMTAD", 1 '' Text Above dimension line
    ThisDrawing.SetVariable "DIMDEC", iPrec '' Text precision
    ThisDrawing.SetVariable "DIMTOFL", 1 '' Dimension line
    ThisDrawing.SetVariable "DIMTIX", 0 '' CEnter Text
    ThisDrawing.SetVariable "DIMTMOVE", 2 '' Text Movement
    ThisDrawing.SetVariable "DIMTIH", 0 ''Aligns text with the dimension line
    ThisDrawing.SetVariable "DIMTOH", 0 ''Aligns text with the dimension line
    
    ThisDrawing.SetVariable "DIMSAH", 1
    ThisDrawing.SetVariable "DIMDLI", dTH
    ThisDrawing.SetVariable "DIMEXE", dTH / 2
    ThisDrawing.SetVariable "DIMTXT", dTH
    ThisDrawing.SetVariable "DIMTSZ", (dTH / 2)
    ThisDrawing.SetVariable "DIMASZ", (dTH / 2)
    ThisDrawing.SetVariable "DIMGAP", (dTH / 2)
  
   Call newDimStyle.CopyFrom(ThisDrawing)
   ThisDrawing.ActiveDimStyle = newDimStyle    ' set current dimension style to newDimStyle
End Function