<?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 Re: Check whether the Sketch is Auxiliary in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8209678#M87836</link>
    <description>&lt;P&gt;I think its worth to dig in the direction of re-checking Sketch visibility in browser.&lt;/P&gt;&lt;P&gt;Till now I can read only first-level browser nodes:&lt;/P&gt;&lt;PRE&gt;Dim oDoc As Document
oDoc = ThisDoc.Document
Dim oTopNode As BrowserNode
oTopNode = oDoc.BrowserPanes.ActivePane.TopNode
Dim MsgBody As String
' Dim TotBN_Count As Integer=0 ' total 1st level nodes Count
Dim VisBN_Count As Integer=0 ' visible 1st level nodes Count
For Each oNode As BrowserNode In oTopNode.BrowserNodes
	TotBN_Count=TotBN_Count+1
	' Trace.WriteLine("iLogicVB" &amp;amp; oNode.FullPath)
	if oNode.Visible then VisBN_Count=VisBN_Count+1 : MsgBody=MsgBody &amp;amp; Right(oNode.FullPath,Len(oNode.FullPath)-(Len(oTopNode.FullPath)+1)) &amp;amp; VBcrlf
Next
MsgBox(MsgBody,,oTopNode.FullPath &amp;amp; " has " &amp;amp; VisBN_Count &amp;amp;" visible 1st-level nodes:    ")&lt;/PRE&gt;&lt;P&gt;Could somebody help to expand this code to get lidt of all visible nodes (mean after "expand all" command).&lt;/P&gt;</description>
    <pubDate>Sun, 19 Aug 2018 17:12:17 GMT</pubDate>
    <dc:creator>Maxim-CADman77</dc:creator>
    <dc:date>2018-08-19T17:12:17Z</dc:date>
    <item>
      <title>Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8204484#M87761</link>
      <description>&lt;P&gt;When creating Sheet Metal flanges (and probably in some other cases) Inventor does create some sketches by itself.&lt;/P&gt;&lt;P&gt;Those sketches are not visible in the model tree thus let me call them "auxiliary".&lt;/P&gt;&lt;P&gt;I need ьн app treat those auxiliary sketches separately from others (skip).&lt;/P&gt;&lt;P&gt;How could I separate them from normal sketches (those user can edit directly)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 15:49:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8204484#M87761</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2018-08-16T15:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8204909#M87768</link>
      <description>&lt;PRE&gt;Dim oCompdef As PartComponentDefinition
oCompdef = ThisDoc.Document.ComponentDefinition
Dim MsgBody As String
Dim AboveEoP_SkCount As Integer=0 
For each oSketch As Sketch in oCompDef.Sketches
	If oSketch.HealthStatus&amp;lt;&amp;gt;HealthStatusEnum.kBeyondStopNodeHealth then 
		AboveEoP_SkCount=AboveEoP_SkCount+1
		MsgBody=MsgBody &amp;amp; "                     " &amp;amp; oSketch.Name &amp;amp; vbCrLf
	Else
Exit For
	End If
Next
MsgBox (MsgBody,,"Out of " &amp;amp; oCompDef.Sketches.Count &amp;amp; " sketches " &amp;amp; AboveEoP_SkCount &amp;amp; " are placed above EoP:     ")&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Безымянный.png" style="width: 516px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/535540i6EFFE99E1E59CCFB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Безымянный.png" alt="Безымянный.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;See attached IPT.&lt;/P&gt;&lt;P&gt;Sketch1 to my mind is normal&lt;/P&gt;&lt;P&gt;Sketch2 to my mind is auxiliary.&lt;/P&gt;&lt;P&gt;How could I sort them out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 18:14:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8204909#M87768</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2018-08-16T18:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8205718#M87781</link>
      <description>&lt;P&gt;Any Ideas, please...&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 03:51:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8205718#M87781</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2018-08-17T03:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8206712#M87799</link>
      <description>&lt;P&gt;The "auxiliary" sketch is created by the feature, now they should not be accessible via API in latest Inventor(I don't check from which Inventor we hide it from API), but if your Inventor still can get it via API, I suggest to check its &lt;STRONG&gt;IsOwnedByFeature&lt;/STRONG&gt; to see if this returns True, you can ignore the sketches which is created by feature.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 13:42:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8206712#M87799</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2018-08-17T13:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8207790#M87803</link>
      <description>&lt;P&gt;You are right regarding latest versions (2018 don't "see" auxiliary Sketch at all)&lt;/P&gt;&lt;P&gt;yet... Inventor 2014 returns False value of IsOwnedByFeature for all sketches (seems not very useful property).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim oCompdef As PartComponentDefinition
oCompdef = ThisDoc.Document.ComponentDefinition
Dim MsgBody As String
Dim AboveEoP_SkCount As Integer=0 
For Each oSketch As Sketch In oCompDef.Sketches
	If oSketch.HealthStatus&amp;lt;&amp;gt;HealthStatusEnum.kBeyondStopNodeHealth Then 
		AboveEoP_SkCount=AboveEoP_SkCount+1
		MsgBody=MsgBody &amp;amp; "                     " &amp;amp; oSketch.Name &amp;amp; " - " &amp;amp; oSketch.IsOwnedByFeature &amp;amp; vbCrLf
	Else
Exit For
	End If
Next
MsgBox (MsgBody,,"Out of " &amp;amp; oCompDef.Sketches.Count &amp;amp; " sketches " &amp;amp; AboveEoP_SkCount &amp;amp; " are placed above EoP:     ")&lt;/PRE&gt;&lt;P&gt;I guess you then have no other recommendation but move to newest Inventor, right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 19:38:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8207790#M87803</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2018-08-17T19:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8209500#M87832</link>
      <description>&lt;P&gt;I wonder if it possible to use absence of auxiliary sketch in browser tree (haven't found the particular way yet)?&lt;/P&gt;</description>
      <pubDate>Sun, 19 Aug 2018 14:06:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8209500#M87832</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2018-08-19T14:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8209678#M87836</link>
      <description>&lt;P&gt;I think its worth to dig in the direction of re-checking Sketch visibility in browser.&lt;/P&gt;&lt;P&gt;Till now I can read only first-level browser nodes:&lt;/P&gt;&lt;PRE&gt;Dim oDoc As Document
oDoc = ThisDoc.Document
Dim oTopNode As BrowserNode
oTopNode = oDoc.BrowserPanes.ActivePane.TopNode
Dim MsgBody As String
' Dim TotBN_Count As Integer=0 ' total 1st level nodes Count
Dim VisBN_Count As Integer=0 ' visible 1st level nodes Count
For Each oNode As BrowserNode In oTopNode.BrowserNodes
	TotBN_Count=TotBN_Count+1
	' Trace.WriteLine("iLogicVB" &amp;amp; oNode.FullPath)
	if oNode.Visible then VisBN_Count=VisBN_Count+1 : MsgBody=MsgBody &amp;amp; Right(oNode.FullPath,Len(oNode.FullPath)-(Len(oTopNode.FullPath)+1)) &amp;amp; VBcrlf
Next
MsgBox(MsgBody,,oTopNode.FullPath &amp;amp; " has " &amp;amp; VisBN_Count &amp;amp;" visible 1st-level nodes:    ")&lt;/PRE&gt;&lt;P&gt;Could somebody help to expand this code to get lidt of all visible nodes (mean after "expand all" command).&lt;/P&gt;</description>
      <pubDate>Sun, 19 Aug 2018 17:12:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8209678#M87836</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2018-08-19T17:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8210007#M87840</link>
      <description>&lt;P&gt;Can you try below code if it helps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oCompdef As PartComponentDefinition
oCompdef = ThisDoc.Document.ComponentDefinition

Dim oPane As BrowserPane
oPane = ThisDoc.Document.BrowserPanes("PmDefault")
    
Dim MsgBody As String
Dim AboveEoP_SkCount As Integer=0
For Each oSketch As Sketch In oCompDef.Sketches
    
    Dim oNode As BrowserNode
    oNode = oPane.GetBrowserNodeFromObject(oSketch)
    
    If oNode.Visible And oSketch.HealthStatus &amp;lt;&amp;gt; HealthStatusEnum.kBeyondStopNodeHealth Then
        SkCount = AboveEoP_SkCount + 1
        MsgBody = MsgBody &amp;amp; "                     " &amp;amp; oSketch.Name &amp;amp; " - " &amp;amp; oSketch.IsOwnedByFeature &amp;amp; vbCrLf
    Else
        Exit For
    End If
Next
MsgBox (MsgBody,,"Out of " &amp;amp; oCompDef.Sketches.Count &amp;amp; " sketches " &amp;amp; AboveEoP_SkCount &amp;amp; " are placed above EoP:     ")&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Aug 2018 02:18:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8210007#M87840</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2018-08-20T02:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8210113#M87850</link>
      <description>&lt;P&gt;I'm getting&amp;nbsp;HRESULT: 0x80004005&amp;nbsp; if attempt to run this on&amp;nbsp;B123W511111.ipt.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 05:11:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8210113#M87850</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2018-08-20T05:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8210115#M87851</link>
      <description>&lt;P&gt;How do I modify my latest code to get not only 1st level browser nodes?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 05:17:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8210115#M87851</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2018-08-20T05:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8210152#M87853</link>
      <description>&lt;P&gt;Does the error happen to the line:&lt;/P&gt;
&lt;PRE&gt;oNode = oPane.GetBrowserNodeFromObject(oSketch)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so seems the browser node for the hidden sketch is not available, so you can try below code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oCompdef As PartComponentDefinition
oCompdef = ThisDoc.Document.ComponentDefinition

Dim oPane As BrowserPane
oPane = ThisDoc.Document.BrowserPanes("PmDefault")
    
Dim MsgBody As String
Dim AboveEoP_SkCount As Integer=0
For Each oSketch As Sketch In oCompdef.Sketches
	On Error Resume Next
    Dim oNode As BrowserNode
    oNode = oPane.GetBrowserNodeFromObject(oSketch)
    
	If Err.Number=0 Then
	    If oSketch.HealthStatus &amp;lt;&amp;gt; HealthStatusEnum.kBeyondStopNodeHealth Then
	        SkCount = AboveEoP_SkCount + 1
	        MsgBody = MsgBody &amp;amp; "                     " &amp;amp; oSketch.Name &amp;amp; " - " &amp;amp; oSketch.IsOwnedByFeature &amp;amp; vbCrLf
	    Else
	        Exit For
	    End If
	Else
		Err.Clear 
		On Error GoTo 0
	End If
Next
MsgBox (MsgBody,,"Out of " &amp;amp; oCompdef.Sketches.Count &amp;amp; " sketches " &amp;amp; AboveEoP_SkCount &amp;amp; " are placed above EoP:     ")&lt;/PRE&gt;
&lt;P&gt;If you want to get the deeper level browser nodes, you can iterate the BrowserNode.BrowserNodes. But if the browser node for the sketch is not available you may not find it via API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 05:55:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8210152#M87853</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2018-08-20T05:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Check whether the Sketch is Auxiliary</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8210384#M87862</link>
      <description>&lt;P&gt;For older Inventor versions (ex. 2014) this code will return only real sketches (skip auxiliary):&lt;/P&gt;&lt;PRE&gt;Dim oCompdef As PartComponentDefinition
oCompdef = ThisDoc.Document.ComponentDefinition
Dim oPane As BrowserPane
oPane = ThisDoc.Document.BrowserPanes("PmDefault")
Dim MsgBody As String
Dim RealSketchCount As Integer=0
For Each oSketch As Sketch In oCompdef.Sketches
	On Error Resume Next
    Dim oNode As BrowserNode
    oNode = oPane.GetBrowserNodeFromObject(oSketch)&lt;BR /&gt;    If Err.Number=0 Then
	If oSketch.HealthStatus &amp;lt;&amp;gt; HealthStatusEnum.kBeyondStopNodeHealth Then			
	    RealSketchCount=RealSketchCount + 1
	    MsgBody = MsgBody &amp;amp; oSketch.Name &amp;amp; vbCrLf
	End If
    End If
Next
MsgBox (MsgBody,,"Out of " &amp;amp; oCompdef.Sketches.Count &amp;amp; " sketches " &amp;amp; RealSketchCount &amp;amp; " are real:         ")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 08:09:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/check-whether-the-sketch-is-auxiliary/m-p/8210384#M87862</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2018-08-20T08:09:58Z</dc:date>
    </item>
  </channel>
</rss>

