<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Selection with Picklist in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/selection-with-picklist/m-p/13056602#M5683</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;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&lt;/LI-CODE&gt;
&lt;P&gt;Hi all, &lt;BR /&gt;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. &lt;BR /&gt;I want to expand it so that you can start the macro, select the measurements, and continue in the macro. &lt;BR /&gt;I have seen this somewhere, but unfortunately, I can no longer find the post. &lt;BR /&gt;Maybe you could help me there. &lt;BR /&gt;I'm no real programmer, so the code probably looks simple. &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Oct 2024 08:21:56 GMT</pubDate>
    <dc:creator>j_weber</dc:creator>
    <dc:date>2024-10-01T08:21:56Z</dc:date>
    <item>
      <title>Selection with Picklist</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selection-with-picklist/m-p/13056602#M5683</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;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&lt;/LI-CODE&gt;
&lt;P&gt;Hi all, &lt;BR /&gt;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. &lt;BR /&gt;I want to expand it so that you can start the macro, select the measurements, and continue in the macro. &lt;BR /&gt;I have seen this somewhere, but unfortunately, I can no longer find the post. &lt;BR /&gt;Maybe you could help me there. &lt;BR /&gt;I'm no real programmer, so the code probably looks simple. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 08:21:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selection-with-picklist/m-p/13056602#M5683</guid>
      <dc:creator>j_weber</dc:creator>
      <dc:date>2024-10-01T08:21:56Z</dc:date>
    </item>
    <item>
      <title>Betreff: Selection with Picklist</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selection-with-picklist/m-p/13056861#M5684</link>
      <description>&lt;P&gt;I found it by myself&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oSet As HighlightSet

If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("Es ist keine Zeichnung geöffnet. Bitte öffnen Sie eine Zeichnung")
	Exit Sub
Else
	MsgBox("Sie befinden sich in einer Zeichnung")
End If

Dim oDrawing As DrawingDocument
oDrawing = ThisApplication.ActiveDocument

oSet = oDrawing.CreateHighlightSet

While True
	Dim oDim As Object
	oDim = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Bitte Bemaßung wählen. Auswahl mit ESC beenden")
	If IsNothing(oDim) Then Exit While
		
	oSet.AddItem(oDim)

End While

'Zugriff auf Zeichnung
Dim osheet As Sheet
osheet = oDrawing.ActiveSheet

'Zugriff auf aktives Blatt
'Dim oSSet As SelectSet
'oSSet = oDrawing.SelectSet

'Zugriff auf Bemaßungs in der Zeichnung
Dim oDims As DrawingDimensions
oDims = osheet.DrawingDimensions

'Zugriff auf generelle Bemaßungen
Dim oGenDims As GeneralDimensions
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
'oTolUpper = 0.01

'Toleranzwert unten festlegen
Dim oTolLower As Double
oTolLower = InputBox("Geben Sie den unteren Toleranzwert an", "Unteres Abmaß", -0.2)
oTolLower = oTolLower / 10
'oTolLower = -0.02


Dim oDimSelect As LinearGeneralDimension

For Each oDimSelect In oSet
	Call oDimSelect.Tolerance.SetToDeviation(oTolUpper, oTolLower)
Next&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;End with ECS is okay, but End Selection with Return would be better.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it is ok, and that is what I want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 10:59:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selection-with-picklist/m-p/13056861#M5684</guid>
      <dc:creator>j_weber</dc:creator>
      <dc:date>2024-10-01T10:59:56Z</dc:date>
    </item>
  </channel>
</rss>

