<?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: rounding to nearest floor. in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7492322#M205295</link>
    <description>&lt;P&gt;that i knew. it doesn't change the way how autocad round numbers, it only gives limits. Rounding is still as regular: &amp;lt;0.5 down; and &amp;gt;=0.5 up.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2017 05:12:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-26T05:12:07Z</dc:date>
    <item>
      <title>rounding to nearest floor.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7492301#M205293</link>
      <description>&lt;P&gt;Hello, i want to achieve something like this when dimensioning my drawings.&lt;/P&gt;&lt;P&gt;i.e measurement 1.1 rounds to 1.&lt;/P&gt;&lt;P&gt;1.5 rounds to 1, not 2.&lt;/P&gt;&lt;P&gt;1.6 round also 1, not 2.&lt;/P&gt;&lt;P&gt;in programming it called nearest&amp;nbsp;floor.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 05:00:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7492301#M205293</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T05:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: rounding to nearest floor.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7492309#M205294</link>
      <description>&lt;P&gt;&lt;SPAN&gt;In the DIMSTYLE, go to Primary Units, Adjust Precision and Round off value that you want.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dimstyle.jpg" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/417903i9E7E3257A8F3FFBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dimstyle.jpg" alt="dimstyle.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 05:04:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7492309#M205294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T05:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: rounding to nearest floor.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7492322#M205295</link>
      <description>&lt;P&gt;that i knew. it doesn't change the way how autocad round numbers, it only gives limits. Rounding is still as regular: &amp;lt;0.5 down; and &amp;gt;=0.5 up.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 05:12:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7492322#M205295</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T05:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: rounding to nearest floor.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7492544#M205296</link>
      <description>&lt;P&gt;I can't found the Round down method anywhere.&lt;/P&gt;
&lt;P&gt;So I tried to make lisp code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun C:DIMROUNDDOWN (/)

(defun rounddown ( n m )
    ((lambda ( r ) (cond ((equal 0.0 r 1e-8) n) ((&amp;lt; n 0) (- n r m)) ((- n r)))) (rem n m))
)


(setvar "DIMASSOC" 2)
(setq m (getreal "\n Round off value : "))                   ;; Set round off
(setq p1 (getpoint "\n Specify First extension line : "))    ;; First Dim position
(setq p2 (getpoint "\n Specify Second extension line : "))   ;; Second Dim Position
(setq p3 (getpoint "\n Specify Third extension line : "))    ;; Dim Text position
(setq dist (distance p1 p2))
  
(command "DIMLINEAR" p1 p2 p3 dist)
(command ".explode" (entlast))
(setq ed (entget (entlast)))
(setq n (atof (cdr (assoc 1 ed))))

(setq res (rounddown n m))
(setq ed (subst (cons 1 (rtos res)) (assoc 1 ed) ed))
(entmod ed)
)&lt;/PRE&gt;
&lt;P&gt;When it prompts, Set round off value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then set dimension&amp;nbsp;coordinate.&lt;/P&gt;
&lt;P&gt;Finally, Just one click, You can get Rounddown value.&lt;/P&gt;
&lt;P&gt;But It is only for &lt;STRONG&gt;DIMLINEAR &lt;/STRONG&gt;command.&lt;/P&gt;
&lt;P&gt;If you want another dimension type, It needs to fix&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feel free Point out my Lisp code, please.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 07:27:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7492544#M205296</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T07:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: rounding to nearest floor.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7494397#M205297</link>
      <description>&lt;P&gt;In addition to allowing for different &lt;EM&gt;varieties&lt;/EM&gt;&amp;nbsp; of Dimensions [all the length-oriented kinds, not the angular kinds], the following works by imposing a &lt;EM&gt;text override&lt;/EM&gt;&amp;nbsp; on the Dimension, rather than &lt;EM&gt;Exploding&lt;/EM&gt;&amp;nbsp; it and modifying the resulting Text object.&amp;nbsp; [Besides, in Radius and Diameter Dimensions, which one presumably might also want to do this with, when you Explode,&amp;nbsp;(entlast) is &lt;EM&gt;not&lt;/EM&gt;&amp;nbsp; the Text, but the arrowhead, so the approach would need to be different.]&amp;nbsp; So&amp;nbsp;the Dimension&amp;nbsp;remains one thing, though bear in mind that the text content will &lt;EM&gt;not&lt;/EM&gt;&amp;nbsp; update with Stretching, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing that's much simpler is the rounding down part, because the measured distance of a Dimension is &lt;EM&gt;never negative&lt;/EM&gt;, eliminating that possibility in your rounding-down subroutine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It asks what kind of Dimension so that angular ones are not allowed.&amp;nbsp; It would be nice if the generic-sounding DIM command included all the various possibilities so you could just start that and check whether whichever type was drawn is not angular, but linearly DIM seems to&amp;nbsp;do only the Aligned variety.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It uses whatever the current Units mode and precision settings are for the text override [as does yours], regardless of what the current Dimension Style uses.&amp;nbsp; And it doesn't include the preceding diameter symbol or R for Diameter/Radius Dimensions.&amp;nbsp; But those shortcomings could be overcome if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun C:&lt;STRONG&gt;DIMRD&lt;/STRONG&gt; &lt;FONT color="#00ccff"&gt;; = &lt;STRONG&gt;Dim&lt;/STRONG&gt;ension and &lt;STRONG&gt;R&lt;/STRONG&gt;ound text value &lt;STRONG&gt;D&lt;/STRONG&gt;own&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; (/ floor dtype dobj)&lt;BR /&gt;&amp;nbsp; (if (= (getvar 'dimassoc) 0) (setvar 'dimassoc 2))&lt;FONT color="#00ccff"&gt;; [assuming 1 can be left alone]&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; (setq floor (getreal "\nRound value Down to the nearest multiple of: "))&lt;BR /&gt;&amp;nbsp; (initget "Linear Horizontal Vertical Aligned ROtated RAdius Diameter")&lt;BR /&gt;&amp;nbsp; (setq dtype (getkword "\nType of Dimension [Linear/Horizontal/Vertical/Aligned/ROtated/RAdius/Diameter]: "))&lt;BR /&gt;&amp;nbsp; (command (strcat "_.DIM" dtype))&lt;FONT color="#00ccff"&gt;; start command&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; (while (&amp;gt; (getvar 'cmdactive) 0) (command pause))&lt;FONT color="#00ccff"&gt;; wait for completion&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; (setq dobj (vlax-ename-&amp;gt;vla-object (entlast)))&lt;BR /&gt;&amp;nbsp; (vla-put-TextOverride dobj (rtos (* floor (fix (/ (vla-get-Measurement dobj) floor)))))&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;); defun&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Oct 2017 17:47:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7494397#M205297</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-10-26T17:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: rounding to nearest floor.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7494647#M205298</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to study more Visual lisp...&lt;/P&gt;
&lt;P&gt;I think that vlisp has the excellent function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 19:00:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/rounding-to-nearest-floor/m-p/7494647#M205298</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T19:00:47Z</dc:date>
    </item>
  </channel>
</rss>

