<?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 Working with multiple Ordinate Dimension Sets in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/working-with-multiple-ordinate-dimension-sets/m-p/9862080#M118004</link>
    <description>&lt;P&gt;I am struggling to capture each ordinate dimension set. I can get it to work if I set the item number manually. Can someone help me automate it so it sets the item number for the sets that contain ordinate dimensions sets? or if there is a better method please teach me.&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 ss As SelectSet
Set ss = ThisApplication.ActiveDocument.SelectSet

Dim oDim As DrawingDimension
Dim ordDim As OrdinateDimension
Dim ordDim2 As OrdinateDimension
i=1
Set oOrdinateDims = ss.item(?????).OrdinateDimensionSet

For Each ordDim In ss
For Each ordDim2 In ordDim.OrdinateDimensionSet.Members
 If ordDim2.Text.Text &amp;lt;&amp;gt; 0 Then
  If ordDim2.IsInspectionDimension = True Then
  Else
  Call ordDim2.SetInspectionDimensionData(kRoundedEndsInspectionBorder)
  End If
 Else
 End If
Next
i = i + 1
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Nov 2020 15:32:11 GMT</pubDate>
    <dc:creator>inulobo</dc:creator>
    <dc:date>2020-11-11T15:32:11Z</dc:date>
    <item>
      <title>Working with multiple Ordinate Dimension Sets</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/working-with-multiple-ordinate-dimension-sets/m-p/9862080#M118004</link>
      <description>&lt;P&gt;I am struggling to capture each ordinate dimension set. I can get it to work if I set the item number manually. Can someone help me automate it so it sets the item number for the sets that contain ordinate dimensions sets? or if there is a better method please teach me.&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 ss As SelectSet
Set ss = ThisApplication.ActiveDocument.SelectSet

Dim oDim As DrawingDimension
Dim ordDim As OrdinateDimension
Dim ordDim2 As OrdinateDimension
i=1
Set oOrdinateDims = ss.item(?????).OrdinateDimensionSet

For Each ordDim In ss
For Each ordDim2 In ordDim.OrdinateDimensionSet.Members
 If ordDim2.Text.Text &amp;lt;&amp;gt; 0 Then
  If ordDim2.IsInspectionDimension = True Then
  Else
  Call ordDim2.SetInspectionDimensionData(kRoundedEndsInspectionBorder)
  End If
 Else
 End If
Next
i = i + 1
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 15:32:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/working-with-multiple-ordinate-dimension-sets/m-p/9862080#M118004</guid>
      <dc:creator>inulobo</dc:creator>
      <dc:date>2020-11-11T15:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Working with multiple Ordinate Dimension Sets</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/working-with-multiple-ordinate-dimension-sets/m-p/9862413#M118007</link>
      <description>&lt;P&gt;Maybe this will make more sense for you.&amp;nbsp; I've laid the code out a bit different.&amp;nbsp; As you can see, I've defined my variables right at the top. Then I'm checking the Type of each item within the SelectSet, before attempting to use them.&amp;nbsp; This is usually a good idea to help avoid potential errors.&amp;nbsp;&amp;nbsp; Once I know why Type of object it is, I then proceed to work with it as usual.&amp;nbsp; Some of the code is repetitive right now, but you could likely define and use an additional Sub routine to clean that up, if needed.&amp;nbsp; I didn't know what you were planning on doing if the object was a DrawingDimension Type object, so I just left a comment in there.&lt;/P&gt;&lt;P&gt;Here's the reformatted code:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub OrdDims()

    Dim oOrdDimSet As OrdinateDimensionSet
    Dim oOrdDim As OrdinateDimension
    Dim oDDim As DrawingDimension

    Dim oSelSet As Inventor.SelectSet
    Set oSelSet = ThisApplication.ActiveDocument.SelectSet
    If oSelSet.Count = 0 Then Exit Sub
    
    For Each oItem In oSelSet
        If TypeOf oItem Is OrdinateDimensionSet Then
            Set oOrdDimSet = oItem
            For Each oOrdDim In oOrdDimSet.Members
                If oOrdDim.Text.Text &amp;lt;&amp;gt; "0" Then
                    If oOrdDim.IsInspectionDimension = False Then
                        Call oOrdDim.SetInspectionDimensionData(kRoundedEndsInspectionBorder)
                    End If
                End If
            Next
        ElseIf TypeOf oItem Is OrdinateDimension Then
            Set oOrdDim = oItem
            If oOrdDim.IsOrdinateSetMember Then
                Set oOrdDimSet = oOrdDim.OrdinateDimensionSet
                For Each oOrdDim In oOrdDimSet.Members
                    If oOrdDim.Text.Text &amp;lt;&amp;gt; "0" Then
                        If oOrdDim.IsInspectionDimension = False Then
                            Call oOrdDim.SetInspectionDimensionData(kRoundedEndsInspectionBorder)
                        End If
                    End If
                Next
            Else
                If oOrdDim.Text.Text &amp;lt;&amp;gt; "0" Then
                    If oOrdDim.IsInspectionDimension = False Then
                        Call oOrdDim.SetInspectionDimensionData(kRoundedEndsInspectionBorder)
                    End If
                End If
            End If
        ElseIf TypeOf oItem Is DrawingDimension Then
            Set oDDim = oItem
            'do what you want with it
        End If
    Next
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If you have time, please... Vote For &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B166FEBB95D67CFA84899D32D8E17FC1/emoticons/1f4a1.png" alt=":light_bulb:" title=":light_bulb:" /&gt;&lt;/SPAN&gt;&lt;/A&gt;and Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/" target="_blank"&gt;Inventor 2021 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 17:33:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/working-with-multiple-ordinate-dimension-sets/m-p/9862413#M118007</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-11-11T17:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Working with multiple Ordinate Dimension Sets</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/working-with-multiple-ordinate-dimension-sets/m-p/9862426#M118008</link>
      <description>&lt;P&gt;I figured it out. I had a typo and I consolidated my information. See code block below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;For Each ordDim2 In oDim.OrdinateDimensionSet.Members
 If ordDim2.Text.Text &amp;lt;&amp;gt; 0 Then
  If ordDim2.IsInspectionDimension = True Then
  Else
  Call ordDim2.SetInspectionDimensionData(kRoundedEndsInspectionBorder)
  End If
 Else
 End If
Next
i = i + 1&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 11 Nov 2020 17:36:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/working-with-multiple-ordinate-dimension-sets/m-p/9862426#M118008</guid>
      <dc:creator>inulobo</dc:creator>
      <dc:date>2020-11-11T17:36:13Z</dc:date>
    </item>
  </channel>
</rss>

