<?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: Control precision of exported properties in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125976#M26446</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&amp;nbsp;I've tried setting it to 5, and moved it to various places in the code, but didn't change the output.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2023 19:41:21 GMT</pubDate>
    <dc:creator>Gorra</dc:creator>
    <dc:date>2023-07-25T19:41:21Z</dc:date>
    <item>
      <title>Control precision of exported properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125954#M26444</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;With considerable assistance I have a functioning script that exports a specific block's properties and attributes. However, the x and y coordinates need to be to 5 decimal places. Currently the 'x' cuts off at the decimal, and the 'y' is coming out as scientific notation rounded to the nearest 10 (the value is in the 5-million range). I expect it's just a prefix I need to add to the relevant entities, but the code is here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;(defun c:splcblk ( / out)&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;(vl-load-com)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;(defun _writefile (fn lst / f)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; ;actually writing the attributes to the csv&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; (cond ((and (eq 'str (type fn)) (setq f (open fn "w")))&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;;as long as (argument fn's type=str) and (SPLCBLK.csv is open for writing) then&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;(foreach x lst&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;(if (= 'list (type x))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(write-line&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(apply 'strcat (mapcar '(lambda (z) (strcat (vl-princ-to-string z) ",")) x))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(vl-princ-to-string x)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;(close f)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;fn&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; )&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; )&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; (defun sb (/ e name n ss)&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(if (setq name "SPLICECLOSURE";;;selecting all dynamic blocks of this name&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ss (ssget "_X" '((0 . "INSERT")))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; n -1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out (ssadd)&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(while (setq e (ssname ss (setq n (1+ n))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(if (= :vlax-true (vla-get-IsDynamicBlock (vlax-ename-&amp;gt;vla-object e)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(if (= (strcase (vla-get-Effectivename (vlax-ename-&amp;gt;vla-object e))) (strcase name))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(ssadd e out)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(if (/= 0 (sslength out))(sssetfirst nil out)(princ (strcat "No Dynamic Block found by the Name - " name)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;;(princ)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; )&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; (defun core (/ s x a r)&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(sb) ;selecting all splice closure blocks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex out)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;(setq a (vlax-invoke (vlax-ename-&amp;gt;vla-object x) 'getattributes))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;(setq r (cons (append (cdr (assoc 10 (entget x))) (mapcar 'vla-get-textstring a)) r))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(princ (_writefile ;calling the write to file function&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; (strcat (getvar 'dwgprefix) "SPLCBLK.csv")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; (append '((x y z SPLICE_NUMBER ACTIVITY_NUMBER DROP_QTY DROP_FIBRE DROP_FIBRE_START DROP_FIBRE_END&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; SPARE_FIBRE SPARE_FIBRE_START SPARE_FIBRE_END&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; RES_1_ADDR RES_1_FIBRE RES_1_FIBRE_START RES_1_FIBRE_END RES_1_SPLC_ORDER&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; RES_2_ADDR RES_2_FIBRE RES_2_FIBRE_START RES_2_FIBRE_END RES_2_SPLC_ORDER&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; RES_3_ADDR RES_3_FIBRE RES_3_FIBRE_START RES_3_FIBRE_END RES_3_SPLC_ORDER&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; RES_4_ADDR RES_4_FIBRE RES_4_FIBRE_START RES_4_FIBRE_END RES_4_SPLC_ORDER&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; RES_5_ADDR RES_5_FIBRE RES_5_FIBRE_START RES_5_FIBRE_END RES_5_SPLC_ORDER&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; RES_6_ADDR RES_6_FIBRE RES_6_FIBRE_START RES_6_FIBRE_END RES_6_SPLC_ORDER&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; RES_7_ADDR RES_7_FIBRE RES_7_FIBRE_START RES_7_FIBRE_END RES_7_SPLC_ORDER&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; RES_8_ADDR RES_8_FIBRE RES_8_FIBRE_START RES_8_FIBRE_END RES_8_SPLC_ORDER&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; RES_9_ADDR RES_9_FIBRE RES_9_FIBRE_START RES_9_FIBRE_END RES_9_SPLC_ORDER&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; RES_10_ADDR RES_10_FIBRE RES_10_FIBRE_START RES_10_FIBRE_END RES_10_SPLC_ORDER&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; SPLICE_MODEL FDH_SPLICE SOURCE_SPLICEID POLEID SPLICE_TYPE NAPNUMBER LOCATION ADDRESS&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)) (reverse r))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; (core)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; (princ)&lt;/DIV&gt;&lt;DIV&gt;)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any help would be appreciated.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Gorra&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Jul 2023 19:26:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125954#M26444</guid>
      <dc:creator>Gorra</dc:creator>
      <dc:date>2023-07-25T19:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Control precision of exported properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125971#M26445</link>
      <description>&lt;P&gt;Does increasing your LUPREC System Variable setting help?&amp;nbsp; Or perhaps replacing:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(vl-princ-to-string z)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[which doesn't seem to have a precision argument, so I assume it's affected by LUPREC] with:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(rtos z 2 5)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[Maybe that last needs to be done only with a test of what it's looking at, and applied to numerical values but not text strings if Attributes are involved, but I haven't studied the code that closely.]&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 19:46:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125971#M26445</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-07-25T19:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Control precision of exported properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125976#M26446</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&amp;nbsp;I've tried setting it to 5, and moved it to various places in the code, but didn't change the output.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 19:41:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125976#M26446</guid>
      <dc:creator>Gorra</dc:creator>
      <dc:date>2023-07-25T19:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Control precision of exported properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125995#M26447</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;Replacing it gives bad argument type error&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 19:52:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125995#M26447</guid>
      <dc:creator>Gorra</dc:creator>
      <dc:date>2023-07-25T19:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Control precision of exported properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125998#M26448</link>
      <description>&lt;P&gt;It seems it must be related to the (vl-princ-to-string) function, but I don't know how to get it to use more decimal places, nor what controls how many it spits out if not the LUPREC setting.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 19:53:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12125998#M26448</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-07-25T19:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Control precision of exported properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12126000#M26449</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14002716"&gt;@Gorra&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;Replacing it gives bad argument type error&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yeah, I'm sure that would be when it hits an Attribute -- I was suggesting it for the X and Y coordinates, but there needs to be some differentiation.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 19:55:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12126000#M26449</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-07-25T19:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Control precision of exported properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12129461#M26450</link>
      <description>&lt;P&gt;Where is&amp;nbsp;&lt;SPAN&gt;(core) ? Maybe thats where decimals are being lost.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 01:22:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12129461#M26450</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-07-27T01:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Control precision of exported properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12132196#M26451</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;Hi, Core is defined in the second last paragraph(?) It's for calling the other functions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gorra&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 22:13:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12132196#M26451</guid>
      <dc:creator>Gorra</dc:creator>
      <dc:date>2023-07-27T22:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Control precision of exported properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12133243#M26452</link>
      <description>&lt;P&gt;Without being able to test your lisp code, I suggest you change in your code at line 42&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq r (cons (append (cdr (assoc 10 (entget x))) (mapcar 'vla-get-textstring a)) r))&lt;/LI-CODE&gt;&lt;P&gt;to&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq r (cons (append (mapcar '(lambda (x) (rtos x 2 5)) (cdr (assoc 10 (entget x))))  (mapcar 'vla-get-textstring a)) r))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Jul 2023 10:52:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12133243#M26452</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2023-07-28T10:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Control precision of exported properties</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12133818#M26453</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/524107"&gt;@CADaSchtroumpf&lt;/a&gt;&amp;nbsp; That worked, thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 15:36:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/control-precision-of-exported-properties/m-p/12133818#M26453</guid>
      <dc:creator>Gorra</dc:creator>
      <dc:date>2023-07-28T15:36:38Z</dc:date>
    </item>
  </channel>
</rss>

