<?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: Only allow NODE selection in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8417368#M24188</link>
    <description>&lt;P&gt;Thank you Norman, I will try this tonight or over the weekend. I'll let you know how it goes.&lt;/P&gt;
&lt;P&gt;I really appreciate the help!&lt;/P&gt;</description>
    <pubDate>Wed, 21 Nov 2018 19:57:45 GMT</pubDate>
    <dc:creator>David_Prontnicki</dc:creator>
    <dc:date>2018-11-21T19:57:45Z</dc:date>
    <item>
      <title>Only allow NODE selection</title>
      <link>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8416610#M24184</link>
      <description>&lt;P&gt;I have a pick point prompt and I want to limit it to allow only the selection of a node. How would I do this. I am in VB.net.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 15:43:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8416610#M24184</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2018-11-21T15:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Only allow NODE selection</title>
      <link>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8417084#M24185</link>
      <description>&lt;P&gt;You use system variable OSMODE to control Object Snap when selecting. SO, you would have code like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oldVal As Object=Application.GetSystemVariable("OSMODE")&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Application.SetSystemVariable("OSMODE", 8) '' 8 is the object snap mode for NODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; ''&amp;nbsp;Ask your user to select here&lt;/P&gt;
&lt;P&gt;Finally&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Application.SetSystemVariable("OSMODE", oldVal)&lt;/P&gt;
&lt;P&gt;End Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 18:19:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8417084#M24185</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2018-11-21T18:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Only allow NODE selection</title>
      <link>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8417271#M24186</link>
      <description>&lt;P&gt;Hi Norman, Thank you for the response. I should have been more specific. I have what you suggested in place already and it only allows the node onsap. But I can still click where there inst a node.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My program places labels, i want to limit the user to selecting only a node; any other point should not be excepted. As it stands and also with your suggestion, it will set the NODE osnap current, but a user can still pick a random spot on the screen. I want to allow for the label to be placed on a NODE only.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 19:14:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8417271#M24186</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2018-11-21T19:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Only allow NODE selection</title>
      <link>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8417324#M24187</link>
      <description>&lt;P&gt;Ah, I know what you mean.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Setting osnap mode only allows AutoCAD to provide visual hint for where is suggested position to pick, but user may still pick anywhere he/she wants. In the case of yours, besides setting "OSMODE" system variable, you can also use Editor.Snap() method in your code to locate the actual location of a Node. Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oldVal As Object=Application.GetSystemVariable("OSMODE")&lt;/P&gt;
&lt;P&gt;Dim nodePt as Point3d&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Application.SetSystemVariable("OSMODE", 8) '' 8 is the object snap mode for NODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Dim res = _editor.GetPoint(vbcr &amp;amp; "Select a node:") ''&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; If res.Status == PromptStatus.OK Then&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '' It is not guaranteed that user selects the location precisely&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '' but we can expect user click at the location, or very close to the location&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '' so, we use the selected point to find/snap to the nearest node point&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nodePt = _editor.Snap("NOD", res.Value)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '' You may need further validation code to make sure the point is what you want here&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; End If&lt;/P&gt;
&lt;P&gt;Finally&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Application.SetSystemVariable("OSMODE", oldVal)&lt;/P&gt;
&lt;P&gt;End Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see, after Editor.Snap() call, it should reasonably expect the point at target (NODE, or END, or whatever) is returned. If the drawing is very crowded at the expected location, you may want to zoom in enough first, or even freeze unwanted layers so the Snap() call can snap to the NODE/END... correctly. You may also need code after Snap() call to validate the returned point with your specific rules. But in most cases, setting OSMODE and calling Editor.Snap() would be good enough.&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;</description>
      <pubDate>Wed, 21 Nov 2018 19:35:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8417324#M24187</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2018-11-21T19:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Only allow NODE selection</title>
      <link>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8417368#M24188</link>
      <description>&lt;P&gt;Thank you Norman, I will try this tonight or over the weekend. I'll let you know how it goes.&lt;/P&gt;
&lt;P&gt;I really appreciate the help!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 19:57:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/only-allow-node-selection/m-p/8417368#M24188</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2018-11-21T19:57:45Z</dc:date>
    </item>
  </channel>
</rss>

