<?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: 3 COND statement in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7393401#M114809</link>
    <description>&lt;P&gt;Your problem is not with the 3 conds, the "problem" is, the 3rd cond is never true, because YOU MAKE IT SO at the beginning:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(setq PNumber (nth 1 SplitDwgPrefix)) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; "\\100000\\"
(set_tile "jobnumber" PNumber)
(setq PNumber0 (get_tile "jobnumber"))&lt;/PRE&gt;&lt;P&gt;Here, you first retrieve the PNumber var. ("\\100000\\")&lt;/P&gt;&lt;P&gt;Then you set "jobnumber" tile&amp;nbsp;to PNumber var value. ("\\100000\\")&lt;/P&gt;&lt;P&gt;Then you read the "jobnumber" tile into PNumber0 var. (so, again: "\\100000\\")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, at cond 3 you get:&lt;/P&gt;&lt;P&gt;(/= PNumber PNumber0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, that's like saying:&lt;/P&gt;&lt;P&gt;(/= "\\100000\\" "\\100000\\") - which is &lt;EM&gt;never&lt;/EM&gt; going to be True.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Sep 2017 09:18:38 GMT</pubDate>
    <dc:creator>roland.r71</dc:creator>
    <dc:date>2017-09-20T09:18:38Z</dc:date>
    <item>
      <title>3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383180#M114799</link>
      <description>&lt;P&gt;Good day every one!!!..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need some help in some COND statement....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 3 COND statement to grab the project number from the path of the Dwg at the time I need to plot...&lt;/P&gt;
&lt;P&gt;the first 2 work OK, but the third is the one I can't make it work ....&lt;/P&gt;
&lt;P&gt;If the&amp;nbsp;user&amp;nbsp;change&amp;nbsp;the&amp;nbsp;project&amp;nbsp;number&amp;nbsp;I need to set&amp;nbsp;the&amp;nbsp;FLAG =&amp;nbsp;&lt;SPAN&gt;"!ALERT"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where is my error? please help...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun ProjectNumber ()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(setq SplitDwgPrefix (splitdirs (getvar "dwgprefix"))) &amp;nbsp; &amp;nbsp; &amp;nbsp;; ("U:" "100000" "elec")&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(setq GetDrive (nth 0 SplitDwgPrefix)) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; "U:"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(setq DWG_PATH (getvar "dwgprefix")) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; get the path of the files =&amp;gt; "U:/100000/elec/"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(setq user_name (getvar "loginname"))&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(setq PNumber (nth 1 SplitDwgPrefix)) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; "\\100000\\"&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp;(set_tile "jobnumber" PNumber)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(setq PNumber0 (get_tile "jobnumber"))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp; (cond&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; If is Drive "U" and Project Number is not changed manually&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ( &amp;nbsp;(and (= GetDrive "U:") (= PNumber0 PNumber)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (setq jobnumber PNumber)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (setq Flag "---")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (alert (strcat jobnumber " Cond1"))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; If Project number is NIL and is not in drive "U"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ( &amp;nbsp;(/= GetDrive "U:")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(progn&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(ProjectNumberDCL "Please... Enter Project Number... " " * Project Number *" "0000.00")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(setq jobnumber PrjNumber)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(setq Flag "!ALERT")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(alert (strcat jobnumber " Cond2")) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; for testing only&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;; if the Project Number is changed manually &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--- IS NOT WORKING.!!&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;( &amp;nbsp;(/= PNumber PNumber0)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (progn&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (setq PNumber1 (get_tile "jobnumber"))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (setq jobnumber PNumber1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (setq Flag "!ALERT") &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (alert (strcat jobnumber " Cond3")) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;; for testing only&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; ) &amp;nbsp;; cond&lt;BR /&gt;&amp;nbsp; jobnumber&lt;BR /&gt;) ; defun&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;at the OK button I have this.....to re-check the project number&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(action_tile "accept" "(mplt_chkl)(projectNumber)(mplt_Info)")&lt;BR /&gt;(action_tile "cancel" "(done_dialog)")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;at the DCL file that section is .....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;: boxed_column {&lt;BR /&gt;&amp;nbsp; fixed_width = true;&lt;BR /&gt;&amp;nbsp; fixed_height = true;&lt;BR /&gt;&amp;nbsp; label = "Job Number:";&lt;BR /&gt;&amp;nbsp; : edit_box {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; key = "jobnumber";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; width = 12;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; height = 1;&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;spacer;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 11:51:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383180#M114799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-15T11:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383269#M114800</link>
      <description>&lt;P&gt;Even though it's well commented, I haven't got the big picture. That said, in your second case, your comment says that the project number is nil but there is no test for that condition.&lt;/P&gt;
&lt;PRE&gt; ; If Project number is NIL and is not in drive "U"
      (  (/= GetDrive "U:")&lt;/PRE&gt;
&lt;P&gt;Your last check merely checks to see if the project number has been changed manually.&amp;nbsp; I'm not sure how the test justifies that assumption.&lt;/P&gt;
&lt;PRE&gt; ; if the Project Number is changed manually                  --- IS NOT WORKING.!!
     (  (/= PNumber PNumber0)&lt;/PRE&gt;
&lt;P&gt;In general a cond statement should always end with a default case (in your case a 4th case) where any assumptions made that might be false give feedback of an exceptional case.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 12:31:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383269#M114800</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2017-09-15T12:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383314#M114801</link>
      <description>&lt;P&gt;thank you &amp;nbsp;&lt;SPAN class="login-bold"&gt;&lt;A class="lia-link-navigation lia-page-link lia-user-name-link" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/411413" target="_self"&gt;dbroad&amp;nbsp;&lt;/A&gt;for you imput...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;at the beginning&amp;nbsp;of the &amp;nbsp;"defun&amp;nbsp;ProjectNumber", In the&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;(setq PNumber (nth 1 SplitDwgPrefix)) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; "\\100000\\" I get the number from the path &amp;nbsp;and then&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;(setq PNumber0 (get_tile "jobnumber")) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; I get the number from the "edit_box" if the user change the original number PNumber&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;I believe both of them are strings.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;in the 3rd COND, I compared those 2 statements to see if they are not equal...&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="forummessage_author_details" data-user-id="411413"&gt;
&lt;DIV class="forummessage_author_user_rank"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="forummessage_author_user_rank"&gt;(/= PNumber PNumber0)&lt;/DIV&gt;
&lt;DIV class="forummessage_author_user_rank"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="forummessage_author_user_rank"&gt;thanks...&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Sep 2017 12:49:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383314#M114801</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-15T12:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383355#M114802</link>
      <description>&lt;P&gt;If the drawing hasn't been saved, the dwgprefix&amp;nbsp;could be anything and splitdwgprefix&amp;nbsp;could be returning something other than what is assumed.&amp;nbsp; Thorough testing of splitdwgprefix&amp;nbsp;for unexpected cases is merited.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the person hadn't entered anything for the job number, I wouldn't say that it had been changed manually. Does your lisp pre populate the job number field?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You still need a 4th condition for debugging purposes.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 13:09:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383355#M114802</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2017-09-15T13:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383397#M114803</link>
      <description>&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;my comments between the lines...&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the drawing hasn't been saved, the dwgprefix&amp;nbsp;could be anything and splitdwgprefix&amp;nbsp;could be returning something other than what is assumed.&amp;nbsp; Thorough testing of&amp;nbsp;Thorough testing of splitdwgprefix&amp;nbsp;for unexpected cases is merited. .... ;;;&lt;FONT color="#0000FF"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;EM&gt;&lt;STRONG&gt;that where COND2 take place and is working OK. getting everything Outside of drive "U:\"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the person hadn't entered anything for the job number, I wouldn't say that it had been changed manually. Does your lisp pre populate the job number field?&lt;/P&gt;
&lt;P&gt;Does your lisp pre populate the job number field? &amp;nbsp;....&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;;;;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;Yes it is pre-populated and is working OK&lt;/FONT&gt;.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You still need a 4th condition for debugging purposes. ...&lt;FONT color="#0000FF"&gt; ....&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;;;;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&amp;gt;&amp;nbsp;I added the (T)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 13:24:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383397#M114803</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-15T13:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383465#M114804</link>
      <description>&lt;P&gt;Why do you need to use&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;(setq PNumber1 (get_tile "jobnumber")) if you just tested it and already know what it's value is. You just used PNumber0 for comparison purposes. Just use it. I don't know what is not working though.&amp;nbsp; What does it actually do?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 13:49:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383465#M114804</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2017-09-15T13:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383774#M114805</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please, can you or somebody&amp;nbsp;else just take the code, modify and show me, where is my mistake...?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help..&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 15:47:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383774#M114805</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-15T15:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383883#M114806</link>
      <description>&lt;P&gt;I don't see how anyone could "fix" such incomplete code.&amp;nbsp; Here is your code gutted of dialog calls and external routines.&amp;nbsp; Cond3 works fine as far as I can tell.&lt;/P&gt;
&lt;PRE&gt;(defun ProjectNumber (/ DWG_PATH FLAG GETDRIVE JOBNUMBER PNUMBER PNUMBER0 PNUMBER1 PRJNUMBER SPLITDWGPREFIX USER_NAME)
  (setq SplitDwgPrefix  '("U:" "100000" "elec"))
  (setq GetDrive "U:")
  (setq DWG_PATH "U:/100000/elec/")
  (setq user_name "Bob")
  (setq PNumber "\\100000\\")
  (setq PNumber0"\\100001\\")
   (cond
					; If is Drive "U" and Project Number is not changed manually
    ((and (= GetDrive "U:")
	  (= PNumber0 PNumber)
	  (setq jobnumber PNumber)
	  (setq Flag "---")
	  (alert (strcat jobnumber " Cond1"))
     )
    )

					; If Project number is NIL and is not in drive "U"
    ((/= GetDrive "U:")
     (progn
       (setq jobnumber PrjNumber)
       (setq Flag "!ALERT")
       (alert (strcat jobnumber " Cond2")) ; for testing only
     )

    )

					; if the Project Number is changed manually                  --- IS NOT WORKING.!!
    ((/= PNumber PNumber0)
     (progn
       (setq PNumber1 PNumber0)
       (setq jobnumber PNumber1)
       (setq Flag "!ALERT")
       (alert (strcat jobnumber " Cond3")) ; for testing only 
     )

    )
  )					; cond
  jobnumber
)					; defun&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 16:36:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383883#M114806</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2017-09-15T16:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383907#M114807</link>
      <description>&lt;P&gt;thanks, I will check it.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 16:44:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7383907#M114807</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-15T16:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7387142#M114808</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;Good day every one!!!..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help in some COND statement....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 3 COND statement to grab the project number from the path of the Dwg at the time I need to plot...&lt;/P&gt;&lt;P&gt;the first 2 work OK, but the third is the one I can't make it work ....&lt;/P&gt;&lt;P&gt;If the&amp;nbsp;user&amp;nbsp;change&amp;nbsp;the&amp;nbsp;project&amp;nbsp;number&amp;nbsp;I need to set&amp;nbsp;the&amp;nbsp;FLAG =&amp;nbsp;&lt;SPAN&gt;"!ALERT"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where is my error? please help...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---snip&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; (cond&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; If is Drive "U" and Project Number is not changed manually&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ( &amp;nbsp;(and (= GetDrive "U:") (= PNumber0 PNumber)&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (setq jobnumber PNumber)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (setq Flag "---")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (alert (strcat jobnumber " Cond1"))&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;---snip&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If this is the original code, the first one is &lt;EM&gt;not&lt;/EM&gt; ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only reason you don't get an error and it apears to work&amp;nbsp;is because they all return T(rue) for the AND statement.&lt;/P&gt;&lt;P&gt;The correct way would be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;((and (= GetDrive "U:")(= PNumber0 PNumber)&lt;STRONG&gt;&lt;FONT color="#0000ff"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp; (setq jobnumber PNumber)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(setq Flag "---")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(alert (strcat jobnumber " Cond1"))&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;p.s.: You don't need &lt;FONT face="courier new,courier"&gt;(progn&lt;/FONT&gt; inside a &lt;FONT face="courier new,courier"&gt;(cond&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 10:00:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7387142#M114808</guid>
      <dc:creator>roland.r71</dc:creator>
      <dc:date>2017-09-18T10:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7393401#M114809</link>
      <description>&lt;P&gt;Your problem is not with the 3 conds, the "problem" is, the 3rd cond is never true, because YOU MAKE IT SO at the beginning:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(setq PNumber (nth 1 SplitDwgPrefix)) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; "\\100000\\"
(set_tile "jobnumber" PNumber)
(setq PNumber0 (get_tile "jobnumber"))&lt;/PRE&gt;&lt;P&gt;Here, you first retrieve the PNumber var. ("\\100000\\")&lt;/P&gt;&lt;P&gt;Then you set "jobnumber" tile&amp;nbsp;to PNumber var value. ("\\100000\\")&lt;/P&gt;&lt;P&gt;Then you read the "jobnumber" tile into PNumber0 var. (so, again: "\\100000\\")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, at cond 3 you get:&lt;/P&gt;&lt;P&gt;(/= PNumber PNumber0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, that's like saying:&lt;/P&gt;&lt;P&gt;(/= "\\100000\\" "\\100000\\") - which is &lt;EM&gt;never&lt;/EM&gt; going to be True.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 09:18:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7393401#M114809</guid>
      <dc:creator>roland.r71</dc:creator>
      <dc:date>2017-09-20T09:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7395002#M114810</link>
      <description>&lt;PRE&gt;(defun ProjectNumber ()
&lt;FONT color="#FF0000"&gt;   (setq SplitDwgPrefix (splitdirs (getvar "dwgprefix")))      ; ("U:" "100000" "elec")
   (setq GetDrive (nth 0 SplitDwgPrefix))                           ; "U:"
   (setq DWG_PATH (getvar "dwgprefix"))                         ; get the path of the files =&amp;gt; "U:/100000/elec/"
   (setq user_name (getvar "loginname"))
   (setq PNumber (nth 1 SplitDwgPrefix))                          ; "\\100000\\"

   (set_tile "jobnumber" PNumber)&lt;BR /&gt;&lt;/FONT&gt;   (setq PNumber0 (get_tile "jobnumber"))


  (cond&lt;/PRE&gt;&lt;P&gt;The red lines should NOT be inside this function (which you call when user hits the "OK" button)&lt;/P&gt;&lt;P&gt;But BEFORE you test for user input (&amp;amp; the (set_tile ...) should of course be placed AFTER you create the dialog.)&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 16:48:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7395002#M114810</guid>
      <dc:creator>roland.r71</dc:creator>
      <dc:date>2017-09-20T16:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7395033#M114811</link>
      <description>&lt;P&gt;In fact, currently the user can not set it manually, even if he wanted to.&lt;/P&gt;&lt;P&gt;As soon as he hits "OK", whatever he typed into that "tile" get's overwritten by the project number derived from the files path.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something you should notice during testing. (ok, it might be in a bit of a fast flash &lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://forums.autodesk.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 16:57:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7395033#M114811</guid>
      <dc:creator>roland.r71</dc:creator>
      <dc:date>2017-09-20T16:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7396226#M114812</link>
      <description>&lt;P&gt;Of course the (alert ...) is within the (and ...), and since alert always returns nil, then the (and ...) will return nil.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And it seems that Pnumber is always made = Pnumber0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's a wonder that any of the conditions is met.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 01:42:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7396226#M114812</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-09-21T01:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: 3 COND statement</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7400137#M114813</link>
      <description>&lt;P&gt;thank you all...&amp;nbsp;dbroad,&amp;nbsp;roland.r71 and john.uhden.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did follow and made some changes to the&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;dbroad&lt;/EM&gt;&amp;nbsp;suggestion&amp;nbsp;and it work....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;thank a lot guys....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 01:20:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3-cond-statement/m-p/7400137#M114813</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T01:20:53Z</dc:date>
    </item>
  </channel>
</rss>

