<?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: Setting OSnap to Node after EntSel in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11942939#M30598</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13854371"&gt;@greglcroth&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I think your property of node depends on the type of object you are picking.&amp;nbsp; If it's only a block insertion (reference) then (assoc 10) should be enough.&amp;nbsp; And if you are looking for an elevation (Z) only then (last (assoc 10)).&lt;/P&gt;
&lt;P&gt;If it's a Civl3D CogoPoint object, then (vlax-get object 'Elevation).&lt;/P&gt;
&lt;P&gt;BTW, I love all the IDs we see around here.&amp;nbsp; You could be...&lt;BR /&gt;Greg Lcroth, OR&lt;/P&gt;
&lt;P&gt;Gregl Croth, OR&lt;/P&gt;
&lt;P&gt;Greg L. Croth.&lt;/P&gt;
&lt;P&gt;I'm guessing the last.&lt;/P&gt;
&lt;P&gt;Anyway, I haven't seen that ID before, so welcome to a new group of friends, where almost no question is stupid (as long as Tony T isn't responding).&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2023 01:11:56 GMT</pubDate>
    <dc:creator>john.uhden</dc:creator>
    <dc:date>2023-05-05T01:11:56Z</dc:date>
    <item>
      <title>Setting OSnap to Node after EntSel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11934067#M30594</link>
      <description>&lt;P&gt;This is what I want to do ... point blocks are at zero elevation in the drawing (but have elevations stored in the attribute list), so I want to select the point and read the elevation from the point attribute and get the elevation and coordinate as separate variables.&amp;nbsp; &amp;nbsp; It works, except for one thing ... I want the "node" snap turned on to reduce the chances I pick the wrong entity.&amp;nbsp; Apparently, preset osnaps are ignored with entsel.&amp;nbsp; Any way to turn it bank on mid command?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(command "-osnap" "node")&lt;BR /&gt;(setq PT1 (car (entsel "\nPick Point: "))) ; Pick Point&lt;BR /&gt;(setq attlist (entget PT1))&lt;BR /&gt;(setq elpnt1 (cadddr (assoc 11 attlist))) ; Gets Elevation only&lt;BR /&gt;(setq snappt (cdr (assoc 10 attlist)))&amp;nbsp; &amp;nbsp; &amp;nbsp;; Gets Full XYZ Coord&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm at my wit's end here, and tried a lot of different ideas I've seen here and elsewhere, but can't seem to get it to work.&amp;nbsp; The code above is my original sort of working plan.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 18:40:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11934067#M30594</guid>
      <dc:creator>greglcroth</dc:creator>
      <dc:date>2023-05-01T18:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Setting OSnap to Node after EntSel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11934208#M30595</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13854371"&gt;@greglcroth&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;. ... I want the "node" snap turned on to reduce the chances I pick the wrong entity.&amp;nbsp; ...&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't think having it on will do what you're asking.&amp;nbsp; You could have it on and use (getpoint) instead of (entsel), and use the result of that to select, but while it would then pick at exactly that &lt;EM&gt;location&lt;/EM&gt;, there could still be something else there that it might "see" instead of what you're after.&amp;nbsp; Consider using (ssget) in which you can filter for object type to ensure it doesn't see some other kind of thing.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 19:42:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11934208#M30595</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-05-01T19:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Setting OSnap to Node after EntSel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11934638#M30596</link>
      <description>&lt;P&gt;You are correct.&amp;nbsp; Even when I tested it by manually setting the osnap to node for the selection, it would still pick up lines around or near the node.&amp;nbsp; I took your advice and went with SSget and filtered everything that wasn't point blocks.&amp;nbsp; Works pretty well.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 23:38:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11934638#M30596</guid>
      <dc:creator>greglcroth</dc:creator>
      <dc:date>2023-05-01T23:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Setting OSnap to Node after EntSel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11942407#M30597</link>
      <description>&lt;P&gt;You can temporarily turn on the "node" osnap during your Lisp routine using the "osnap" function with the "node" argument, then turn it off again after the routine completes. Here is an example of how to modify your code to include the "osnap" function: ``` (setq oldosmode (getvar 'osmode)) ; Save current osmode (setvar 'osmode 512) ; Turn on "node" osnap (command "-osnap" "node") (setq PT1 (car (entsel "\nPick Point: "))) ; Pick Point (setq attlist (entget PT1)) (setq elpnt1 (cadddr (assoc 11 attlist))) ; Gets Elevation only (setq snappt (cdr (assoc 10 attlist))) ; Gets Full XYZ Coord (setvar 'osmode oldosmode) ; Restore previous osmode ``` In this modified code, the "osmode" variable is saved before turning on the "node" osnap, and then restored to its previous value after the "entsel" command completes. Note that some AutoCAD versions may have different values for "node" osnap, so you may need to check the AutoCAD documentation or use the "osnapmode" function to determine the correct value for your version.&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Jayhar M J&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 18:48:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11942407#M30597</guid>
      <dc:creator>jayhar</dc:creator>
      <dc:date>2023-05-04T18:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Setting OSnap to Node after EntSel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11942939#M30598</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13854371"&gt;@greglcroth&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I think your property of node depends on the type of object you are picking.&amp;nbsp; If it's only a block insertion (reference) then (assoc 10) should be enough.&amp;nbsp; And if you are looking for an elevation (Z) only then (last (assoc 10)).&lt;/P&gt;
&lt;P&gt;If it's a Civl3D CogoPoint object, then (vlax-get object 'Elevation).&lt;/P&gt;
&lt;P&gt;BTW, I love all the IDs we see around here.&amp;nbsp; You could be...&lt;BR /&gt;Greg Lcroth, OR&lt;/P&gt;
&lt;P&gt;Gregl Croth, OR&lt;/P&gt;
&lt;P&gt;Greg L. Croth.&lt;/P&gt;
&lt;P&gt;I'm guessing the last.&lt;/P&gt;
&lt;P&gt;Anyway, I haven't seen that ID before, so welcome to a new group of friends, where almost no question is stupid (as long as Tony T isn't responding).&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 01:11:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-osnap-to-node-after-entsel/m-p/11942939#M30598</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2023-05-05T01:11:56Z</dc:date>
    </item>
  </channel>
</rss>

