Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Sub SetTol()
'Ändert die Toleranz für vorher markierte Maße
'Zugriff auf aktuelle Zeichnung
Dim oDrawing As DrawingDocument
Set oDrawing = ThisApplication.ActiveDocument
'Zugriff auf Zeichnung
Dim osheet As Sheet
Set osheet = oDrawing.ActiveSheet
'Zugriff auf aktives Blatt
Dim oSSet As SelectSet
Set oSSet = oDrawing.SelectSet
'Zugriff auf Bemaßungs in der Zeichnung
Dim oDims As DrawingDimensions
Set oDims = osheet.DrawingDimensions
'Zugriff auf generelle Bemaßungen
Dim oGenDims As GeneralDimensions
Set oGenDims = oDims.GeneralDimensions
'Toleranzwert Oben festlegen
Dim oTolUpper As Double
oTolUpper = InputBox("Geben Sie den oberen Toleranzwert an", "Oberes Abmaß", 0.1)
oTolUpper = oTolUpper / 10
'Toleranzwert unten festlegen
Dim oTolLower As Double
oTolLower = InputBox("Geben Sie den unteren Toleranzwert an", "Unteres Abmaß", -0.2)
oTolLower = oTolLower / 10
Dim oDimSelect As LinearGeneralDimension
For Each oDimSelect In oSSet
Call oDimSelect.Tolerance.SetToDeviation(oTolUpper, oTolLower)
Next
End Sub
Hi all,
I have developed a code that allows me to add a tolerance to measurements. However, you must first select the measurements and then execute the macro.
I want to expand it so that you can start the macro, select the measurements, and continue in the macro.
I have seen this somewhere, but unfortunately, I can no longer find the post.
Maybe you could help me there.
I'm no real programmer, so the code probably looks simple.

Jörg Weber
CAD Systemtechniker für AutoCAD, Inventor, Vault
Solved! Go to Solution.