Private Sub tybzys()
Dim i As Integer
Dim uudimStyle As AcadDimStyle
For i = 0 To (ThisDrawing.DimStyles.Count - 1)
ThisDrawing.ActiveDimStyle = ThisDrawing.DimStyles(i)
Set uudimStyle = ThisDrawing.ActiveDimStyle
ThisDrawing.SetVariable "DIMADEC", 2
ThisDrawing.SetVariable "DIMALTU", 2
ThisDrawing.SetVariable "DIMALTZ", 8
ThisDrawing.SetVariable "DIMASZ", 3#
ThisDrawing.SetVariable "DIMATFIT", 1
ThisDrawing.SetVariable "DIMAUNIT", 1
ThisDrawing.SetVariable "DIMAZIN", 2
ThisDrawing.SetVariable "DIMCEN", 0#
ThisDrawing.SetVariable "DIMDEC", 2
ThisDrawing.SetVariable "DIMDLI", 0.5
ThisDrawing.SetVariable "DIMEXE", 1#
ThisDrawing.SetVariable "DIMEXO", 0.5
ThisDrawing.SetVariable "DIMGAP", 1#
ThisDrawing.SetVariable "DIMLFAC", 2
ThisDrawing.SetVariable "DIMLUNIT", 2
ThisDrawing.SetVariable "DIMRND", 0#
ThisDrawing.SetVariable "DIMSCALE", 2
ThisDrawing.SetVariable "DIMTAD", 1
ThisDrawing.SetVariable "DIMTFAC", 0.8
ThisDrawing.SetVariable "DIMTIH", 0#
ThisDrawing.SetVariable "DIMTIX", 1
ThisDrawing.SetVariable "DIMTMOVE", 0
ThisDrawing.SetVariable "DIMTOFL", 1
ThisDrawing.SetVariable "DIMTOH", 0#
ThisDrawing.SetVariable "DIMTOLJ", 1
ThisDrawing.SetVariable "DIMTXSTY", ThisDrawing.ActiveTextStyle.Name
ThisDrawing.SetVariable "DIMTXT", 3.5
ThisDrawing.SetVariable "DIMTZIN", 8
ThisDrawing.SetVariable "DIMUPT", 1
ThisDrawing.SetVariable "DIMZIN", 8
uudimStyle.CopyFrom ThisDrawing
Next i
ThisDrawing.SendCommand ("regen ")
MsgBox "所有标注样式已统一风格" & Chr(13) & "谢谢使用!", vbInformation, "标注样式统一"
End Sub 你的程序是设置尺寸系统变量的设置问题.不知道在此循环的意思是什么?不明白. 图中的图元移动一点距离后,尺寸标注就会更新,这句话不明白?? 图元移动一点距离后,尺寸标注就会更新,这是尺寸关联的问题. 图元中一条线移动x,y后,dimension相应的变化. 如果图中的图元移动一点距离后,尺寸标注就同时移动x,y. |