<?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: ActiveEditDocument.SelectSet Issue in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267908#M2839</link>
    <description>&lt;P&gt;Yes, I did a little local testing right after replying, and see what you mean.&amp;nbsp; I assumed it might be a 'context' related issue, or cross-document thing.&amp;nbsp; Besides the SelectSet.Select method, I also used a HighlightSet, and used its AddItem method on the same face, then showed a MsgBox for the user to review it, then used Clear method after message goes away, but still no indication / proof of the selection.&amp;nbsp; It is an odd situation to be using 'selection' on a non-active document, so I assume you are wanting to execute a command on something, in an effort to 'simulate' a manual user interaction sequence.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is a way to do what you want to do using Inventor API code then that is almost always the preferred route, instead of selection and command execution.&amp;nbsp; But there are a couple cases where it seems like the commands (ControlDefinitions) designed by Autodesk can 'process' certain tasks more efficiently than the API route can.&lt;/P&gt;
&lt;P&gt;What are you trying to do with the face, after it is selected?&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jan 2025 17:34:48 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2025-01-17T17:34:48Z</dc:date>
    <item>
      <title>ActiveEditDocument.SelectSet Issue</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267774#M2836</link>
      <description>&lt;P&gt;Hi, Could I get some help with&amp;nbsp;ActiveEditDocument.SelectSet? When working in a part document my script works fine, but when editing a part from an assembly it doesn't seem to work.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kAssemblyDocumentObject&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveEditDocument&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt;
			&lt;SPAN&gt;doc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveEditDocument&lt;/SPAN&gt;
		&lt;SPAN&gt;Else&lt;/SPAN&gt;
			&lt;SPAN&gt;Return&lt;/SPAN&gt;
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
	&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;doc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;IsNot&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;obj&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Object&lt;/SPAN&gt;
		&lt;SPAN&gt;obj&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;Pick&lt;/SPAN&gt;(&lt;SPAN&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kPartFaceFilter&lt;/SPAN&gt;, &lt;SPAN&gt;"Select Entity"&lt;/SPAN&gt;)
	 	&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oFace&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;SurfaceBodies&lt;/SPAN&gt;(1).&lt;SPAN&gt;Faces&lt;/SPAN&gt;
			&lt;SPAN&gt;If&lt;/SPAN&gt; (&lt;SPAN&gt;oFace&lt;/SPAN&gt;.&lt;SPAN&gt;SurfaceType&lt;/SPAN&gt; = &lt;SPAN&gt;CType&lt;/SPAN&gt;(&lt;SPAN&gt;obj&lt;/SPAN&gt;, &lt;SPAN&gt;Face&lt;/SPAN&gt;).&lt;SPAN&gt;SurfaceType&lt;/SPAN&gt;) &lt;SPAN&gt;And&lt;/SPAN&gt; (&lt;SPAN&gt;Math&lt;/SPAN&gt;.&lt;SPAN&gt;Round&lt;/SPAN&gt;(&lt;SPAN&gt;oFace&lt;/SPAN&gt;.&lt;SPAN&gt;Evaluator&lt;/SPAN&gt;.&lt;SPAN&gt;Area&lt;/SPAN&gt;, 6) = &lt;SPAN&gt;Math&lt;/SPAN&gt;.&lt;SPAN&gt;Round&lt;/SPAN&gt;(&lt;SPAN&gt;CType&lt;/SPAN&gt;(&lt;SPAN&gt;obj&lt;/SPAN&gt;, &lt;SPAN&gt;Face&lt;/SPAN&gt;).&lt;SPAN&gt;Evaluator&lt;/SPAN&gt;.&lt;SPAN&gt;Area&lt;/SPAN&gt;, 6))
			&lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;SelectSet&lt;/SPAN&gt;.&lt;SPAN&gt;Select&lt;/SPAN&gt;(&lt;SPAN&gt;oFace&lt;/SPAN&gt;)
			&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
		&lt;SPAN&gt;Next&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 16:34:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267774#M2836</guid>
      <dc:creator>jakevZWHTE</dc:creator>
      <dc:date>2025-01-17T16:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: ActiveEditDocument.SelectSet Issue</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267791#M2837</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11966508"&gt;@jakevZWHTE&lt;/a&gt;.&amp;nbsp; My memory in that area may be a little rusty, but I believe the 'active' document will always receive the selections, by default, when using the 'Pick' function, even when you are in-place editing a component representing a part, within an assembly, which would make that part the 'active editing' document, because the assembly will still be the 'active' document, as you already seem to know.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 16:44:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267791#M2837</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-01-17T16:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: ActiveEditDocument.SelectSet Issue</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267851#M2838</link>
      <description>&lt;P&gt;Thanks for your reply &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;, when I try to add a property to ActiveDocument.SelectSet when editing part from an assembly, then it throws error "The parameter is incorrect".&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;SelectSet&lt;/SPAN&gt;.&lt;SPAN&gt;Select&lt;/SPAN&gt;(&lt;SPAN&gt;oFace&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;The issue doesn't seem to be with parts getting added to doc.SelectSet. I can see parts are getting selected by adding MessageBox&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;SelectSet&lt;/SPAN&gt;.&lt;SPAN&gt;Count&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;" Selected"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The problem seems to be that the objects don't stay selected the way they do when part document is open.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 17:06:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267851#M2838</guid>
      <dc:creator>jakevZWHTE</dc:creator>
      <dc:date>2025-01-17T17:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: ActiveEditDocument.SelectSet Issue</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267908#M2839</link>
      <description>&lt;P&gt;Yes, I did a little local testing right after replying, and see what you mean.&amp;nbsp; I assumed it might be a 'context' related issue, or cross-document thing.&amp;nbsp; Besides the SelectSet.Select method, I also used a HighlightSet, and used its AddItem method on the same face, then showed a MsgBox for the user to review it, then used Clear method after message goes away, but still no indication / proof of the selection.&amp;nbsp; It is an odd situation to be using 'selection' on a non-active document, so I assume you are wanting to execute a command on something, in an effort to 'simulate' a manual user interaction sequence.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is a way to do what you want to do using Inventor API code then that is almost always the preferred route, instead of selection and command execution.&amp;nbsp; But there are a couple cases where it seems like the commands (ControlDefinitions) designed by Autodesk can 'process' certain tasks more efficiently than the API route can.&lt;/P&gt;
&lt;P&gt;What are you trying to do with the face, after it is selected?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 17:34:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267908#M2839</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-01-17T17:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: ActiveEditDocument.SelectSet Issue</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267927#M2840</link>
      <description>&lt;P&gt;after the faces are selected I will use Direct Edit to modify. The reason why I use this script is just to rapidly select all faces of the same type and area.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 17:48:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267927#M2840</guid>
      <dc:creator>jakevZWHTE</dc:creator>
      <dc:date>2025-01-17T17:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: ActiveEditDocument.SelectSet Issue</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267989#M2841</link>
      <description>&lt;P&gt;Ah, I see.&amp;nbsp; Although there are API objects for those types of features, and we can access the ones that already exist by API, we do not seem to be able to create new ones through the API, so unfortunately selection and command execution route may be the only way to automate a task like that.&amp;nbsp;&amp;nbsp;You may have to 'open' (rather than in-place edit) that part directly/visibly to make it work though, not sure.&amp;nbsp; Good luck with that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 18:20:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/activeeditdocument-selectset-issue/m-p/13267989#M2841</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-01-17T18:20:44Z</dc:date>
    </item>
  </channel>
</rss>

