1
1

API.bas 875 B

123456789101112131415161718192021222324252627282930
  1. Attribute VB_Name = "API"
  2. Public Function BeginOpt(Name As String)
  3. EventsEnabled = False
  4. ActiveDocument.BeginCommandGroup Name
  5. ActiveDocument.SaveSettings
  6. ActiveDocument.unit = cdrMillimeter
  7. Optimization = True
  8. ' ActiveDocument.PreserveSelection = False
  9. End Function
  10. Public Function EndOpt()
  11. ' ActiveDocument.PreserveSelection = True
  12. ActiveDocument.RestoreSettings
  13. EventsEnabled = True
  14. Optimization = False
  15. EventsEnabled = True
  16. Application.Refresh
  17. ActiveDocument.EndCommandGroup
  18. End Function
  19. Public Function Create_Tolerance() As Double
  20. Dim text As String
  21. If GlobalUserData.Exists("Tolerance", 1) Then
  22. text = GlobalUserData("Tolerance", 1)
  23. End If
  24. text = InputBox("请输入容差值 0.1 --> 99.9", "容差值(mm)", text)
  25. If text = "" Then Exit Function
  26. GlobalUserData("Tolerance", 1) = text
  27. Create_Tolerance = Val(text)
  28. End Function