<?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: Help with Qselect LISP for quality control. in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685427#M90712</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The second (equal) function there is included because if a Line aims at [for example] 0 degrees, its 'ang' &lt;EM&gt;could&lt;/EM&gt;&amp;nbsp; sometimes come out at not truly 0, but something like 0.000000000000001 &lt;EM&gt;less than 2 pi&lt;/EM&gt;.&amp;nbsp; If so, its (rem) return won't be close to &lt;FONT color="#339966"&gt;0&lt;/FONT&gt;, but close to &lt;FONT color="#800080"&gt;the radian equivalent of 45 degrees&lt;/FONT&gt;.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Good catch Kent&lt;/P&gt;</description>
    <pubDate>Tue, 26 Mar 2019 19:51:29 GMT</pubDate>
    <dc:creator>dlanorh</dc:creator>
    <dc:date>2019-03-26T19:51:29Z</dc:date>
    <item>
      <title>Help with Qselect LISP for quality control.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685144#M90708</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have encountered a situation in which I know a LISP routine would be ideal, but I have yet to fully wrap my head around it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The situation I have is that my Job has me merging and reviewing drawings from multiple different drafters, an issue with this is some line work not matching to appropriate angles, think 45.10 degrees instead of 45.00.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently I can use QSELECT to select all the lines that are correct at 0, 45, 90, 135, 180, 225, 270, and 315 degrees individually and change their color to allow me to focus in on the lines that have not been drawn correctly. Unfortunately, I have to run QSELECT for each different angle, and I know that having a LISP to execute these 8 commands for me would be far more ideal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not worried about Poly lines as we do not utilize them. I am hoping someone can at least point me in the right direction, or maybe even enlighten me to a better method than I currently use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 18:13:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685144#M90708</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-26T18:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Qselect LISP for quality control.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685244#M90709</link>
      <description>&lt;P&gt;Maybe you can get a start from &lt;FONT color="#000000"&gt;&lt;STRONG&gt;LinesRegularizeAngles.lsp&lt;/STRONG&gt;&lt;/FONT&gt; with its &lt;STRONG&gt;&lt;FONT color="#000000"&gt;LRA&lt;/FONT&gt;&lt;/STRONG&gt; command, available &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-to-make-all-slightly-angled-lines-orthogonal-any-help/m-p/2590857/highlight/true#M283802" target="_blank" rel="noopener"&gt;&amp;gt;here&amp;lt;&lt;/A&gt;.&amp;nbsp; If you use that and give it 45 degrees for the angle-multiple value, it will force all selected Lines to fall on whichever of those angles is closest to its current direction, all at once for all such directions.&amp;nbsp; It has an option whether to do it to the original Lines or to copies on a new Layer.&amp;nbsp; It could be modified easily enough, I think, to instead identify those that are &lt;EM&gt;not&lt;/EM&gt;&amp;nbsp; already at one of those, and either select/grip/highlight only those, or&amp;nbsp;put and fix copies of&amp;nbsp;only those&amp;nbsp;on a different Layer [leaving alone those already at good angles], or something.&amp;nbsp; The latter may be preferable, because the way it regularizes a Line's angle is to Rotate the Line about its &lt;EM&gt;midpoint&lt;/EM&gt;, so you would want to know which ones it did, so you can check where their &lt;EM&gt;endpoints&lt;/EM&gt;&amp;nbsp; ended up and see the result in comparison to their original positions, and make any adjustments.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 18:53:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685244#M90709</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-03-26T18:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Qselect LISP for quality control.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685279#M90710</link>
      <description>&lt;P&gt;Try this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:test (/ *error* c_doc ang_lst ss obj ang)
  
  (defun *error* ( msg )
    (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
    (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nAn Error : " msg " occurred.")))
    (princ)
  );end_*error*_defun
	
  (setq c_doc (vla-get-activedocument (vlax-get-acad-object))
        ang_lst (list 0.0 (* pi 0.25) (* pi 0.5) (* pi 0.75) pi (* pi 1.25) (* pi 1.5) (* pi 1.75) (* pi 2))
        ss (ssget "_X" '((0 . "LINE")))
  );end_setq
	
  (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
  (vla-startundomark c_doc)

  (repeat (setq cnt (sslength ss))
    (setq obj (vlax-ename-&amp;gt;vla-object (ssname ss (setq cnt (1- cnt))))
          ang (vlax-get-property obj 'angle)
    );end_setq      
    (if (not (vl-position ang ang_lst)) (vlax-put-property obj 'color 192))
  );end_repeat
  (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
);end_defun &lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Mar 2019 18:55:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685279#M90710</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2019-03-26T18:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Qselect LISP for quality control.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685400#M90711</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5644077"&gt;@dlanorh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;PRE&gt;....&lt;BR /&gt;  (setq c_doc (vla-get-activedocument (vlax-get-acad-object))
        &lt;FONT color="#33cccc"&gt;ang_lst (list 0.0 (* pi 0.25) (* pi 0.5) (* pi 0.75) pi (* pi 1.25) (* pi 1.5) (* pi 1.75) (* pi 2))&lt;/FONT&gt;
....&lt;BR /&gt;   &lt;FONT color="#ff0000"&gt;&lt;FONT color="#000000"&gt;(if (not&lt;/FONT&gt; (vl-position ang ang_lst)&lt;FONT color="#000000"&gt;) (vlax-put-property obj 'color 192))&lt;/FONT&gt;&lt;/FONT&gt;
....&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That routine might suffer from the numerical-value comparison issue that sometimes comes up, where a number [such as the 'ang' variable for a given Line] is "good" but&amp;nbsp;strictly speaking is&amp;nbsp;off 14 or 15 or so&amp;nbsp;decimal places down, which will make it fail.&amp;nbsp; In addition to accounting for that, I think you could eliminate that &lt;FONT color="#33cccc"&gt;ang_lst&lt;/FONT&gt; list variable entirely, and use (rem), replacing the &lt;FONT color="#ff0000"&gt;red part quoted&lt;/FONT&gt; [which is going to want utter and precise&amp;nbsp;equality] with &lt;FONT color="#0000ff"&gt;this&lt;/FONT&gt;:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#99ccff"&gt;(if (not &lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;(or (equal (rem ang (/ pi 4)) &lt;FONT color="#339966"&gt;0&lt;/FONT&gt; 1e-6) (equal (rem ang (/ pi 4))&amp;nbsp;&lt;FONT color="#800080"&gt;(/ pi 4)&lt;/FONT&gt;&amp;nbsp;1e-6))&lt;/FONT&gt;&lt;FONT color="#99ccff"&gt;)&amp;nbsp;(vlax-put-property obj 'color 192))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could very likely get by with "cruder" precision, such as&amp;nbsp;1e-4 instead of 1e-6.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second (equal) function there is included because if a Line aims at [for example] 0 degrees, its 'ang' &lt;EM&gt;could&lt;/EM&gt;&amp;nbsp; sometimes come out at not truly 0, but something like 0.000000000000001 &lt;EM&gt;less than 2 pi&lt;/EM&gt;.&amp;nbsp; If so, its (rem) return won't be close to &lt;FONT color="#339966"&gt;0&lt;/FONT&gt;, but close to &lt;FONT color="#800080"&gt;the radian equivalent of 45 degrees&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 19:39:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685400#M90711</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-03-26T19:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Qselect LISP for quality control.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685427#M90712</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The second (equal) function there is included because if a Line aims at [for example] 0 degrees, its 'ang' &lt;EM&gt;could&lt;/EM&gt;&amp;nbsp; sometimes come out at not truly 0, but something like 0.000000000000001 &lt;EM&gt;less than 2 pi&lt;/EM&gt;.&amp;nbsp; If so, its (rem) return won't be close to &lt;FONT color="#339966"&gt;0&lt;/FONT&gt;, but close to &lt;FONT color="#800080"&gt;the radian equivalent of 45 degrees&lt;/FONT&gt;.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Good catch Kent&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 19:51:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685427#M90712</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2019-03-26T19:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Qselect LISP for quality control.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685440#M90713</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This with the small tweak is perfect.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 19:55:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685440#M90713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-26T19:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Qselect LISP for quality control.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685483#M90714</link>
      <description>&lt;P&gt;Tweaked lisp attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 20:08:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-qselect-lisp-for-quality-control/m-p/8685483#M90714</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2019-03-26T20:08:59Z</dc:date>
    </item>
  </channel>
</rss>

