<?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: Autolisp: OSNAP and dist command in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7450964#M113723</link>
    <description>&lt;P&gt;Thanks Danny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your solution worked on all computers we have at work (except mine).&lt;/P&gt;&lt;P&gt;If you have any idea why mine shows zero as distance it would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can i do some kind of Autocad "factory reset"? I can't remove it and reinstall it.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Oct 2017 12:18:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-11T12:18:49Z</dc:date>
    <item>
      <title>Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439074#M113698</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm back with this weird thing happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm measuring distance from a point on XY and the imprint of a line from that point (200 units tall) with a solid tall 152.40 units.&lt;/P&gt;&lt;P&gt;Strangely in my computer works just fine measuring 152.40 and on other two computers it shows 200.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think&amp;nbsp;OSNAP is not snapping on the solid&amp;nbsp;on theirs, but checked the options and they look the same to me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help? Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below is my code:&lt;/P&gt;&lt;P&gt;(defun C:DAVIDE(/ var val p c solidSS ent linevar)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq var '("Osmode" "Expert")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val&amp;nbsp; (mapcar 'getvar var))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (mapcar 'setvar var '(0 1))&lt;/P&gt;&lt;P&gt;; TURN OFF SOLID LAYER&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_.-layer" "OFF" "IMAGINARY SURFACE" "" "")&lt;/P&gt;&lt;P&gt;; ENTER LAT, LON OF THE POINT OF INTEREST&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "geomarklatlong" PAUSE PAUSE " ")&lt;/P&gt;&lt;P&gt;; SELECT NODE JUST CREATED&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq p (cdr (assoc 10 (entget(ENTLAST)))))&lt;/P&gt;&lt;P&gt;; DRAW LINE 200 UNITS TALL ORTHO TO XY FROM NODE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_.line" p (list (car p) (cadr p) (+ (caddr p) 200)) "")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq linevar (ssget "_L"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (mapcar 'setvar var val)&lt;/P&gt;&lt;P&gt;; TURN ON SOLID LAYER&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_.-layer" "ON" "IMAGINARY SURFACE" "")&lt;/P&gt;&lt;P&gt;; IMPRINT LINE WITH SOLID&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq solidSS (ssget "X" (list '(0 . "3DSOLID")(cons 8 "IMAGINARY SURFACE")))) ; this will get a selection set containing the solid&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq ent (ssname solidSS 0)) ; retrieve first entity in the list (there should be only 1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "_.imprint" ent linevar "_Y" "")&lt;/P&gt;&lt;P&gt;; SELECT IMPRINTED POINT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq c (getvar "lastpoint"))&lt;/P&gt;&lt;P&gt;; CALCULATE DISTANCE FROM ORIGINAL POINT TO THE IMPRINTED POINT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (command "dist" p c)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if (&amp;gt; (getvar 'distance) 152.40)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(alert (strcat "Error"))&lt;BR /&gt;&amp;nbsp;(alert (strcat "Max heigth is :&amp;nbsp; " (rtos (getvar 'distance) 2 3) " mt&amp;nbsp; or&amp;nbsp; " (rtos (* 3.2808399 (getvar 'distance)) 2 3) " ft")))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 08:20:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439074#M113698</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-06T08:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439178#M113699</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've added OSNAPCOORD to your system variables to be set to 1 (keyboard entry overrides running object snap at all time) and moved your restore of the system variables to the end of your code. In your own code you are currently measuring distance after you restored the system variables (incl. object snaps), which could mess things up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:DAVIDE(/ var val p c solidSS ent linevar)
    (setq var '("Osmode" "Expert" &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"Osnapcoord"&lt;/FONT&gt;&lt;/STRONG&gt;)
          val  (mapcar 'getvar var))
    (mapcar 'setvar var '(0 1 &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;))
; TURN OFF SOLID LAYER
    (command "_.-layer" "OFF" "IMAGINARY SURFACE" "" "")
; ENTER LAT, LON OF THE POINT OF INTEREST
    (command "geomarklatlong" PAUSE PAUSE " ")
; SELECT NODE JUST CREATED
    (setq p (cdr (assoc 10 (entget(ENTLAST)))))
; DRAW LINE 200 UNITS TALL ORTHO TO XY FROM NODE
    (command "_.line" p (list (car p) (cadr p) (+ (caddr p) 200)) "")
    (setq linevar (ssget "_L"))
    
; TURN ON SOLID LAYER
    (command "_.-layer" "ON" "IMAGINARY SURFACE" "")
; IMPRINT LINE WITH SOLID
    (setq solidSS (ssget "X" (list '(0 . "3DSOLID")(cons 8 "IMAGINARY SURFACE")))) ; this will get a selection set containing the solid
    (setq ent (ssname solidSS 0)) ; retrieve first entity in the list (there should be only 1)
    (command "_.imprint" ent linevar "_Y" "")
; SELECT IMPRINTED POINT
    (setq c (getvar "lastpoint"))
; CALCULATE DISTANCE FROM ORIGINAL POINT TO THE IMPRINTED POINT
    (command "dist" p c)
    (if (&amp;gt; (getvar 'distance) 152.40)
   (alert (strcat "Error"))
   (alert (strcat "Max heigth is :  " (rtos (getvar 'distance) 2 3) " mt  or  " (rtos (* 3.2808399 (getvar 'distance)) 2 3) " ft")))
   &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;(mapcar 'setvar var val)&lt;/FONT&gt;&lt;/STRONG&gt;
   (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 08:47:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439178#M113699</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-10-06T08:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439281#M113700</link>
      <description>&lt;P&gt;thanks Danny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now it is not working in mine either &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It's measuring to the end of the line instead to the imprint.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 09:29:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439281#M113700</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-06T09:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439360#M113701</link>
      <description>&lt;P&gt;That is strange. Almost sounds that your code is depending on some OSNAPS being set/used instead of bare coordinates.&lt;/P&gt;&lt;P&gt;The modification I've made didn't change a thing in measuring except to make sure you would use the exact coordinates instead of altered coordinates by OSNAPS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you post a sample drawing with before and after and exactly what should be measured, so I'm able to test the code on my side in the way you want it to be used?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 10:09:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439360#M113701</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-10-06T10:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439465#M113702</link>
      <description>&lt;P&gt;And this is exactly the problem. I need it to use the altered coordinates of the OSNAP.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 10:59:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439465#M113702</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-06T10:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439529#M113703</link>
      <description>&lt;P&gt;In your original code you also set OSMODE to 0 and this means you turn off all running object snaps. Also OSNAPCOORD needs to be 0 to ensure that OSNAPS are applied to used coordinates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the reason why it probably works (or worked) on your PC is because you have all the necessary settings by default and your colleagues probably don't. Never assume all PC's you want to run a routine on have the same settings, but always make sure to set these in the routine and restore the old values at exit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What are the OSNAPS you are depending on?&lt;/P&gt;&lt;P&gt;If that is clear we can set the value of OSMODE to the right setting it needs at the beginning of the routine.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 11:23:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439529#M113703</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-10-06T11:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439584#M113704</link>
      <description>&lt;P&gt;Thanks again Danny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not very familiar with AutoCAD, I'm a programmer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to measure the height of a solid in a point created with geomarklatlong.&lt;/P&gt;&lt;P&gt;That is why I create the first point with geomarklatlong, then create a vertical line (200 units tall) to imprint the solid.&lt;/P&gt;&lt;P&gt;And at the end measure the distance from the original point to the imprint.&lt;/P&gt;&lt;P&gt;For some reason in my computer it measure the right distance and in theirs it measure the distance do the end of the line instead of to the imprint.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need this to work for everyone so I probably need to set the OSNAPS and OSMODE in the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 11:44:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439584#M113704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-06T11:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439609#M113705</link>
      <description>&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK, that's no problem and we'll try to get the code working on any PC you want&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you maybe post a sample drawing for testing purposes (just erase everything if needed and only leave what is necessary for testing).&lt;/P&gt;&lt;P&gt;And do you know what value OSMODE has before you run the command? Just type in OSMODE on the command line and it will give you an integer value in return.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can guess what values are needed but with the sample drawing and OSMODE value I'll be able to know for sure.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 11:55:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439609#M113705</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-10-06T11:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439727#M113706</link>
      <description>&lt;P&gt;Below the drawing and the lisp code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 12:35:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7439727#M113706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-06T12:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7444911#M113707</link>
      <description>&lt;P&gt;I'm noticing Civil 3D proxy objects in the drawing. As I don't have Civil 3D available, any chance you can convert these to normal 3D solids?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 13:35:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7444911#M113707</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-10-09T13:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7446890#M113708</link>
      <description>&lt;P&gt;Never mind.....my graphics card was playing funny&amp;nbsp;tricks and switching to another visual style solved the display issues.&lt;/P&gt;&lt;P&gt;I'll try to look into it.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 06:55:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7446890#M113708</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-10-10T06:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7446921#M113709</link>
      <description>&lt;P&gt;Awesome , thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 07:10:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7446921#M113709</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-10T07:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7446964#M113710</link>
      <description>&lt;P&gt;Ok, I'm getting an error in the imprint step as the solid and line doe not intersect.&lt;/P&gt;&lt;P&gt;What values are you using for the GEOMARKLONG as whatever I'm trying the location point and line are drawn far away from the solid that exists in the drawing?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 07:34:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7446964#M113710</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-10-10T07:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7447072#M113711</link>
      <description>&lt;P&gt;try&lt;/P&gt;&lt;P&gt;37.407391&lt;/P&gt;&lt;P&gt;14.917833&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 08:29:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7447072#M113711</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-10T08:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7447602#M113712</link>
      <description>&lt;P&gt;Ok, I'm 99,.9% sure it has to do with the set OSNAP on your and your colleagues system. I'm not sure yet what the OSNAP setting should be, because I'm getting different results depending on how far I'm zoomed in to the solid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you tell me a bit more why you need to imprint the line in the solid?&lt;/P&gt;&lt;P&gt;Do you need it for reference later or do you just want to measure the height of the solid? Because in the example you provided the solid is 152.4 in height,&amp;nbsp; the line that is drawn is 200 and the imprinted line will get the same height of the solid of 152.4. So the measurement of the imprinted line/edge is the same as the height of the solid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you only need to get the height of the solid and all solids you are working with have a flat top surface like in the provided example, there may be an easier way to get the info you need.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:50:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7447602#M113712</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-10-10T11:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7447711#M113713</link>
      <description>&lt;P&gt;Hi Danny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you got the point. I need to know the height of the solid in any given point (given by the user with lat long coordinates). The max height is 152.40 but it is not all the same height (as you can see from the picture attached). that is why i was doing it this way.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 12:21:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7447711#M113713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-10T12:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7447996#M113714</link>
      <description>&lt;P&gt;If it helps you troubleshooting the issue, after running your code it is NOT working on my computer anymore. Even after using&amp;nbsp; my original code. So we must have set some variable back to default (like on my coworkers computers) and we have to figure out which ones were and what were the values that made the code work.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:41:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7447996#M113714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-10T13:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7448079#M113715</link>
      <description>&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now knowing what you are exactly looking for I'm not sure if there is a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I can tell the times you did get the right height were just a lucky shot. I'm not able to get any reliable measurement each and every time as the distance measured will be heavily dependent on how far you are zoomed in or not.&lt;/P&gt;&lt;P&gt;The LASTPOINT variable doesn't have the right coordinate at any point during execution and never holds a coordinate which will measure a height of 152.4 as in the example. So the times you did get the right height reported were basically a coincidence and can not be trusted 100% in all circumstances.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although the endpoints of the imprinted edge can be selected manually with the endpoint object snap, so far I'm unable to do so automatically as there is no LISP way to select an edge in a solid without any user interaction.&lt;/P&gt;&lt;P&gt;I'll look a bit further but this is something that might be impossible to achieve with LISP and will need some more powerful .NET coding.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 14:06:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7448079#M113715</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-10-10T14:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7448265#M113716</link>
      <description>&lt;P&gt;OK, new approach and I think I have a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As it is not possible to select an edge within a solid with LISP, I've switched from using a line to a second solid. The code below will draw a cylinder at the marker point with a height of 500. A copy of the original existing solid is subtracted from this new cylinder. I know the original height and the new height of the cylinder. By subtracting these values you know the height of the original solid at that location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should work independent on zoom factor and/or object snaps. Please let me know if you see any problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:DAVIDE(/ var val p base_height ref temp_copy solidSS height)
    (setq var '("Osmode" "Expert")
          val  (mapcar 'getvar var))
    (mapcar 'setvar var '(0 1))
; ENTER LAT, LON OF THE POINT OF INTEREST
    (command "geomarklatlong" PAUSE PAUSE " ")
; SELECT NODE JUST CREATED
    (setq p (cdr (assoc 10 (entget(ENTLAST)))))
; DRAW REFERENCE CYLINDER WIT BASE HEIGHT
    (setq base_height 500)
    (command "_cylinder" p 0.1 base_height)
    (setq ref (entlast))
; RETRIEVE SOLID
    (setq solidSS (ssget "X" (list '(0 . "3DSOLID")(cons 8 "IMAGINARY SURFACE")))) ; this will get a selection set containing the solid
; COPY ORIGINAL SOLID TO TEMPORARY SOLID TO EXTRACT    
    (vla-Copy (vlax-ename-&amp;gt;vla-object (ssname solidSS 0))) ; retrieve first entity in the list (there should be only 1)
    (setq temp_copy (entlast))
; SUBTRACT COPIED SOLID FROM REFERENCE CYLINDER
    (command "subtract" ref "" temp_copy "")
; GET HEIGHT OF REMAINING REFERENCE CYLINDER AND SUBTRACT FROM BASE HEIGHT
    (vla-GetBoundingBox (vlax-ename-&amp;gt;vla-object ref) 'BoxPoint1 'BoxPoint2)
    (setq height (- base_height (- (nth 2 (vlax-safearray-&amp;gt;list BoxPoint2)) (nth 2 (vlax-safearray-&amp;gt;list BoxPoint1)))))
; ERASE REFERENCE CYLINDER   
    (command "_erase" ref "")
; DISPLAY MEASURED HEIGHT OR ERROR IF &amp;gt; 152.4   
    (if (&amp;gt; height 152.40)
      (alert (strcat "Error"))
      (alert (strcat "Max heigth is :  " (rtos height 2 3) " mt  or  " (rtos (* 3.2808399 height) 2 3) " ft"))
    )
    (mapcar 'setvar var val)
    (princ)
)&lt;/PRE&gt;&lt;P&gt;f&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:01:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7448265#M113716</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-10-10T15:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp: OSNAP and dist command</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7450022#M113717</link>
      <description>&lt;P&gt;Hi Danny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot for investing your time to help me&amp;nbsp;out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just tried your code and no matter what point I use in my drawing it keeps showing zero distance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what is going on? Anything I have to set?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 05:49:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-osnap-and-dist-command/m-p/7450022#M113717</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-11T05:49:49Z</dc:date>
    </item>
  </channel>
</rss>

