Author Topic: help with a lisp  (Read 10749 times)

0 Members and 1 Guest are viewing this topic.

pedroantonio

  • Guest
Re: help with a lisp
« Reply #45 on: April 01, 2014, 02:09:57 PM »
I know thats why i write

Quote
The comment 2 i thing need 3 options
T1>Area>T2
T1>Area
T2< Area

ymg

  • Guest
Re: help with a lisp
« Reply #46 on: April 01, 2014, 02:22:03 PM »
Kerry,

Here somethig I use quite often as a test condition:

Quote
1$ (< 2 5 7)
T
_1$ (< 2 1 7)
nil

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #47 on: April 01, 2014, 02:31:14 PM »
Please Test this in isolation :

Code - Auto/Visual Lisp: [Select]
  1.  
  2. (defun _PrintComments ()
  3.   (setq T1 (- OLDARE ANOX))
  4.   (setq T2 (+ OLDARE ANOX))
  5.   (princ (strcat "\n ----------------"
  6.                  (strcat "\n Area = " (rtos AREA 2 2) " sqm")
  7.                  (strcat "\n Old Area = " (rtos oldare 2 2) " sqm")
  8.                  (strcat "\n Anotation Area = ± " (rtos ANOX 2 2) " sqm")
  9.                  "\n comments: "
  10.          )
  11.   )
  12.   (cond
  13.     ((<= T1 AREA T2)
  14.      (princ (strcat "\n ----------------\n "
  15.                     (strcat (rtos T1 2 2)
  16.                             " sqm <= "
  17.                             (rtos AREA 2 2)
  18.                             " <= "
  19.                             (rtos T2 2 2)
  20.                             " sqm"
  21.                     )
  22.                     "\n comment1:"
  23.             )
  24.      )
  25.     )
  26.     ((> T1 AREA T2)
  27.      (princ (strcat "\n ----------------\n "
  28.                     (strcat (rtos T1 2 2)
  29.                             " sqm > "
  30.                             (rtos AREA 2 2)
  31.                             " > "
  32.                             (rtos T2 2 2)
  33.                             " sqm"
  34.                     )
  35.                     "\n comment2:"
  36.             )
  37.      )
  38.     )
  39.     ((> T1 AREA)
  40.      (princ
  41.        (strcat "\n ----------------\n "
  42.                (strcat (rtos T1 2 2) " sqm > " (rtos AREA 2 2) " sqm")
  43.                "\n comment2:"
  44.        )
  45.      )
  46.     )
  47.     ((< T2 AREA)
  48.      (princ
  49.        (strcat "\n ----------------\n "
  50.                (strcat (rtos T2 2 2) " sqm < " (rtos AREA 2 2) " sqm")
  51.                "\n comment2:"
  52.        )
  53.      )
  54.     )
  55.     (t (princ "\n ----------------\n No suitable data."))
  56.   )
  57.   (princ "\n =======================\n")
  58.   (princ)
  59. )
  60.  

With these tests
.... and I'd suggest you write some tests of your own as well.
Code - Auto/Visual Lisp: [Select]
  1.  
  2. ;; TESTING CODE for (_PrintComments)
  3.  
  4. ;; for option 1 (comment 1)
  5. (setq area   8062
  6.       oldare 8000
  7.       anox   (* OLDARE 0.05)
  8.       var    (_PrintComments)
  9. )
  10. ;; for option 1 (comment 2)
  11. (setq area   9500
  12.       oldare 8000
  13.       anox   (* OLDARE 0.05)
  14.       var    (_PrintComments)
  15. )
  16.  
  17.  
  18.  
  19. ;; for option 2 (comment 1)
  20. (setq area   7500
  21.       oldare 8000
  22.       anox   (* OLDARE 0.10)
  23.       var    (_PrintComments)
  24. )
  25. ;; for option 2 (comment 2)
  26. (setq area   7100
  27.       oldare 8000
  28.       anox   (* OLDARE 0.10)
  29.       var    (_PrintComments)
  30. )
  31.  
  32. ;; for option 2 (comment 2)
  33. (setq area   8950
  34.       oldare 8000
  35.       anox   (* OLDARE 0.10)
  36.       var    (_PrintComments)
  37. )
  38.  
  39.  
  40.  


My Results :

Quote
----------------
 Area = 8062.00 sqm
 Old Area = 8000.00 sqm
 Anotation Area = ± 400.00 sqm
 comments:
 ----------------
 7600.00 sqm <= 8062.00 <= 8400.00 sqm
 comment1:
 =======================

 
 ----------------
 Area = 9500.00 sqm
 Old Area = 8000.00 sqm
 Anotation Area = ± 400.00 sqm
 comments:
 ----------------
 8400.00 sqm < 9500.00 sqm
 comment2:
 =======================

 
 ----------------
 Area = 7500.00 sqm
 Old Area = 8000.00 sqm
 Anotation Area = ± 800.00 sqm
 comments:
 ----------------
 7200.00 sqm <= 7500.00 <= 8800.00 sqm
 comment1:
 =======================

 
 ----------------
 Area = 7100.00 sqm
 Old Area = 8000.00 sqm
 Anotation Area = ± 800.00 sqm
 comments:
 ----------------
 7200.00 sqm > 7100.00 sqm
 comment2:
 =======================

 
 ----------------
 Area = 8950.00 sqm
 Old Area = 8000.00 sqm
 Anotation Area = ± 800.00 sqm
 comments:
 ----------------
 8800.00 sqm < 8950.00 sqm
 comment2:
 =======================










Then if you're happy try the combined code on real entitys.

Code - Auto/Visual Lisp: [Select]
  1.  
  2. (defun C:TEST (/         _PrintComments      _Option1  _Option2
  3.                OLDARE    AREA      DXF       ENT       ANOX
  4.                T1        T2
  5.               )
  6.   (defun _Option1 () (setq ANOX (* OLDARE 0.05)))
  7.   (defun _Option2 () (setq ANOX (* OLDARE 0.10)))
  8.   (defun _PrintComments ()
  9.     (setq T1 (- OLDARE ANOX))
  10.     (setq T2 (+ OLDARE ANOX))
  11.     (princ
  12.       (strcat "\n ----------------"
  13.               (strcat "\n Area = " (rtos AREA 2 2) " sqm")
  14.               (strcat "\n Old Area = " (rtos oldare 2 2) " sqm")
  15.               (strcat "\n Anotation Area = ± " (rtos ANOX 2 2) " sqm")
  16.               "\n comments: "
  17.       )
  18.     )
  19.     (cond
  20.       ((<= T1 AREA T2)
  21.        (princ (strcat "\n ----------------\n "
  22.                       (strcat (rtos T1 2 2)
  23.                               " sqm <= "
  24.                               (rtos AREA 2 2)
  25.                               " <= "
  26.                               (rtos T2 2 2)
  27.                               " sqm"
  28.                       )
  29.                       "\n comment1:"
  30.               )
  31.        )
  32.       )
  33.       ((> T1 AREA T2)
  34.        (princ (strcat "\n ----------------\n "
  35.                       (strcat (rtos T1 2 2)
  36.                               " sqm > "
  37.                               (rtos AREA 2 2)
  38.                               " > "
  39.                               (rtos T2 2 2)
  40.                               " sqm"
  41.                       )
  42.                       "\n comment2:"
  43.               )
  44.        )
  45.       )
  46.       ((> T1 AREA)
  47.        (princ
  48.          (strcat "\n ----------------\n "
  49.                  (strcat (rtos T1 2 2) " sqm > " (rtos AREA 2 2) " sqm")
  50.                  "\n comment2:"
  51.          )
  52.        )
  53.       )
  54.       ((< T2 AREA)
  55.        (princ
  56.          (strcat "\n ----------------\n "
  57.                  (strcat (rtos T2 2 2) " sqm < " (rtos AREA 2 2) " sqm")
  58.                  "\n comment2:"
  59.          )
  60.        )
  61.       )
  62.       (t (princ "\n ----------------\n No suitable data."))
  63.     )
  64.     (princ "\n =======================\n")
  65.     (princ)
  66.   )
  67.   ;; Main -----
  68.   (if
  69.     (and (setq ENT (car (entsel "\nSelect a close polyline: ")))
  70.          (wcmatch (cdr (assoc 0 (setq DXF (entget ENT)))) "*POLYLINE")
  71.          (member (cdr (assoc 70 DXF)) '(1 129))
  72.          (setq OLDARE (getreal "\ngive old area : "))
  73.     )
  74.      (progn
  75.        (initget 7)
  76.        (textpage)
  77.        (prompt "\n text1  :
  78.  
  79.   1. option 1
  80.   2. option 2
  81.        "
  82.        )
  83.        (setq AREA   (vlax-curve-getarea ENT)
  84.              OPTION (getint "choose 1 -->2: ")
  85.        )
  86.        (cond ((= OPTION 1) (_Option1))
  87.              ((= OPTION 2) (_Option2))
  88.              (t (alert "Select > 2 --> Auto select 2. ") (_Option2))
  89.        )
  90.        (_PrintComments)
  91.      )
  92.      (princ "\nError selection of polyline ...")
  93.   )
  94.   (princ)
  95. )
  96.  
« Last Edit: April 01, 2014, 02:37:58 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

pedroantonio

  • Guest
Re: help with a lisp
« Reply #48 on: April 01, 2014, 02:52:01 PM »
thank you kerry i will test it..

pedroantonio

  • Guest
Re: help with a lisp
« Reply #49 on: April 04, 2014, 03:48:29 AM »
Hello Kerry ..
I tried to add some comments on the results to the first code of this topic. The above method for showing me is difficult to use it  because the Oprtion  2 and Option 3  have the same area  2000, but different comments. So I decided to  add  the comments in the code of each option. But something is written wrong but  i  don't know what.I don't know how to use     (_PRINTCOMMENTS) .Could you help me with the code.
Thanks

Code - Auto/Visual Lisp: [Select]
  1.    C:DOMKAL (/ _PRINTCOMMENTS _OPTION1 _OPTION2 _OPTION3 _OPTION4 AREA
  2.              DXF ENT SDAREA SKAREA
  3.             )
  4.   (DEFUN
  5.      _OPTION1 ()
  6.     (COND
  7.       ((< AREA 200)
  8.        (SETQ
  9.          SDAREA AREA
  10.          SKAREA
  11.           (* AREA 0.7)
  12.        )
  13.        (PRINC
  14.          (STRCAT
  15.            "\n ---------------------\n "
  16.            "\n bla bla bla bla."
  17.            "\n bla bla bla bla."
  18.            "\n bla bla bla bla."
  19.            "\n bla bla bla bla."
  20.           )
  21.        )
  22.       )
  23.       ((< AREA 700)
  24.        (SETQ
  25.          SDAREA 240
  26.          SKAREA
  27.           (* AREA 0.6)
  28.          (PRINC
  29.            (STRCAT
  30.              "\n ---------------------\n "
  31.              "\n bla bla bla bla."
  32.              "\n bla bla bla bla."
  33.              "\n bla bla bla bla."
  34.              "\n bla bla bla bla."
  35.             )
  36.          )
  37.        )
  38.        ((>= AREA 700)
  39.          (SETQ
  40.            SDAREA 400
  41.            SKAREA
  42.             (* AREA 0.6)
  43.            (PRINC
  44.              (STRCAT
  45.                "\n ---------------------\n "
  46.                "\n bla bla bla bla."
  47.                "\n bla bla bla bla."
  48.                "\n bla bla bla bla."
  49.                "\n bla bla bla bla."
  50.               )
  51.            )
  52.          )
  53.        )
  54.       )
  55.       (DEFUN
  56.        _OPTION2
  57.        ()
  58.        (COND
  59.          ((<= AREA 2000)
  60.           (SETQ
  61.             SDAREA
  62.              (* AREA 0.8)
  63.             SKAREA
  64.              (* AREA 0.6)
  65.             (PRINC
  66.               (STRCAT
  67.                 "\n ---------------------\n "
  68.                 "\n bla bla bla bla."
  69.                 "\n bla bla bla bla."
  70.                 "\n bla bla bla bla."
  71.                 "\n bla bla bla bla."
  72.                )
  73.             )
  74.           )
  75.           ((> AREA 2000)
  76.             (SETQ
  77.               SDAREA
  78.                (+ 400 (* 0.05 (- AREA 2000)))
  79.               SKAREA
  80.                (* AREA 0.1)
  81.               (PRINC
  82.                 (STRCAT
  83.                   "\n ---------------------\n "
  84.                   "\n bla bla bla bla."
  85.                   "\n bla bla bla bla."
  86.                   "\n bla bla bla bla."
  87.                   "\n bla bla bla bla."
  88.                  )
  89.               )
  90.             )
  91.           )
  92.          )
  93.          (DEFUN
  94.           _OPTION3
  95.           ()
  96.           (COND
  97.             ((= AREA 750)
  98.              (SETQ
  99.                SDAREA 100
  100.                SKAREA
  101.                 (* AREA 0.1)
  102.                (PRINC
  103.                  (STRCAT
  104.                    "\n ---------------------\n "
  105.                    "\n bla bla bla bla."
  106.                    "\n bla bla bla bla."
  107.                    "\n bla bla bla bla."
  108.                    "\n bla bla bla bla."
  109.                   )
  110.                )
  111.              )
  112.             )
  113.             ((AND (> AREA 750) (<= AREA 1200))
  114.              (SETQ
  115.                SDAREA
  116.                 (+ 100 (/ (- AREA 750) 9))
  117.                SKAREA
  118.                 (* AREA 0.1)
  119.                (PRINC
  120.                  (STRCAT
  121.                    "\n ---------------------\n "
  122.                    "\n bla bla bla bla."
  123.                    "\n bla bla bla bla."
  124.                    "\n bla bla bla bla."
  125.                    "\n bla bla bla bla."
  126.                   )
  127.                )
  128.              )
  129.             )
  130.             ((AND (> AREA 1200) (<= AREA 2000))
  131.              (SETQ
  132.                SDAREA
  133.                 (+ 150 (/ (- AREA 1200) 16))
  134.                SKAREA
  135.                 (* AREA 0.1)
  136.                (PRINC
  137.                  (STRCAT
  138.                    "\n ---------------------\n "
  139.                    "\n bla bla bla bla."
  140.                    "\n bla bla bla bla."
  141.                    "\n bla bla bla bla."
  142.                    "\n bla bla bla bla."
  143.                   )
  144.                )
  145.              )
  146.             )
  147.             ((AND (> AREA 2000) (< AREA 4000))
  148.              (SETQ
  149.                SDAREA 0
  150.                SKAREA 0
  151.                (PRINC
  152.                  (STRCAT
  153.                    "\n ---------------------\n "
  154.                "\n bla bla bla bla."
  155.                 "\n bla bla bla bla."
  156.                "\n bla bla bla bla."
  157.                 "\n bla bla bla bla."
  158.              )
  159.             )
  160.           )
  161.          )
  162.          ((= AREA 4000)
  163.           (SETQ
  164.             SDAREA 200
  165.             SKAREA
  166.              (* AREA 0.1)
  167.             (PRINC
  168.               (STRCAT
  169.                 "\n ---------------------\n "
  170.                 "\n bla bla bla bla."
  171.                 "\n bla bla bla bla."
  172.                 "\n bla bla bla bla."
  173.                 "\n bla bla bla bla."
  174.                )
  175.             )
  176.           )
  177.          )
  178.          ((AND (> AREA 4000) (<= AREA 8000))
  179.           (SETQ
  180.             SDAREA
  181.              (+ 200 (* 0.02 (- AREA 4000)))
  182.             SKAREA
  183.              (* AREA 0.1)
  184.             (PRINC
  185.               (STRCAT
  186.                 "\n ---------------------\n "
  187.                 "\n bla bla bla bla."
  188.                 "\n bla bla bla bla."
  189.                 "\n bla bla bla bla."
  190.                 "\n bla bla bla bla."
  191.                )
  192.             )
  193.           )
  194.          )
  195.          ((> AREA 8000)
  196.           (SETQ
  197.             SDAREA
  198.              (+ 280 (* 0.01 (- AREA 8000)))
  199.             SKAREA
  200.              (* AREA 0.1)
  201.             (PRINC
  202.               (STRCAT
  203.                 "\n ---------------------\n "
  204.                 "\n bla bla bla bla."
  205.                 "\n bla bla bla bla."
  206.                 "\n bla bla bla bla."
  207.                 "\n bla bla bla bla."
  208.                )
  209.             )
  210.           )
  211.          )
  212.        )
  213.        (DEFUN
  214.           _OPTION4 ()
  215.          (INITGET 7)
  216.          (SETQ SDAREA (* AREA (GETREAL "\n Give sd (example 1.2) : ")))
  217.          (INITGET 7)
  218.          (SETQ SKAREA (* AREA (GETREAL "\nGive sk (example 0.70) : ")))
  219.        )
  220.        (PRINC
  221.          (STRCAT
  222.            "\n Print Results"
  223.            "\n -----------------------"
  224.            (STRCAT "\n Selected Area = " (RTOS AREA 2 2) " sq.m")
  225.            (STRCAT "\n D = " (RTOS SDAREA 2 2) " sq.m")
  226.            (STRCAT "\n K = " (RTOS SKAREA 2 2) " sq.m")
  227.            "\n"
  228.            "\n comments: "
  229.          )
  230.          (PRINC
  231.               (STRCAT
  232.                 "\n ---------------------\n "
  233.                 "\n bla bla bla bla."
  234.                 "\n bla bla bla bla."
  235.                 "\n bla bla bla bla."
  236.                 "\n bla bla bla bla."
  237.                )
  238.             )
  239.       )
  240.     )
  241.     (T
  242.       (PRINC
  243.         "\n ---------------------\nNo valid polyline selected..."
  244.       )
  245.     )
  246.   )
  247.   (PRINC
  248.     "\n ========================================================================\n"
  249.   )
  250.   (PRINC)
  251. )
  252. ;; Main -----
  253.       (SETQ ENT (CAR (ENTSEL "\nSelect a close polyline: ")))
  254.       (WCMATCH
  255.         (CDR (ASSOC 0 (SETQ DXF (ENTGET ENT))))
  256.         "*POLYLINE"
  257.       )
  258.       (MEMBER (CDR (ASSOC 70 DXF)) '(1 129))
  259.     )
  260.   (PROGN
  261.     (INITGET 7)
  262.     (TEXTPAGE)
  263.     (PROMPT
  264.       "\nChoose an option:
  265.  
  266.   1. Oprion 1
  267.   2. Option 2
  268.   3. Option 3
  269.   4. Option 4
  270.  
  271. "   )
  272.     (SETQ
  273.       AREA   (VLAX-CURVE-GETAREA ENT)
  274.       OPTION (GETINT "choose 1 -->4:  ")
  275.     )
  276.     (COND
  277.       ((= OPTION 1) (_OPTION1))
  278.       ((= OPTION 2) (_OPTION2))
  279.       ((= OPTION 3) (_OPTION3))
  280.       ((= OPTION 4) (_OPTION4))
  281.       (T (ALERT "Select > 4 --> Auto select 4. ") (_OPTION4))
  282.     )
  283.     (_PRINTCOMMENTS)
  284.   )
  285.   (PRINC "\nError selection of polyline ...")
  286. )
  287. )
  288. ;|«Visual LISP© Format Options»
  289. (72 2 40 2 nil "end of " 60 2 2 2 1 nil nil nil T)
  290. ;*** DO NOT add text below the comment! ***|;
  291.  
  292.  

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #50 on: April 04, 2014, 04:06:18 AM »

I don't have time to play.

Break the problem down  to about half a page of code so you understand what is happening.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #51 on: April 04, 2014, 04:47:02 AM »

This is probably the best advice I can offer.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

pedroantonio

  • Guest
Re: help with a lisp
« Reply #52 on: April 04, 2014, 09:31:42 AM »
show me one example from Option 1 and i will try the others

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: help with a lisp
« Reply #53 on: April 04, 2014, 05:30:35 PM »
show me one example from Option 1 and i will try the others

Really Pedro, did you not understand Kerry's GRAPH.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #54 on: April 04, 2014, 07:41:42 PM »
It seems to me that because of your the changed logic, the (_PRINTCOMMENTS) is no longer required. .. or perhaps you do .. I no longer understand what you want.

Perhaps something like this structure would suit better

Code - Auto/Visual Lisp: [Select]
  1.  
  2.  
  3. (defun c:MyRoutine ( / Routine_Functions Routine_variables)
  4.  
  5.   (defun *error* () (princ))
  6.   (defun _SelectBoundary () (princ))
  7.   (defun _PromptForOption () (princ))
  8.   (defun _PromptForOldArea () (princ))
  9.   (defun _OptionController () (princ))
  10.   (defun _ProcessOption1 () (princ))
  11.   (defun _ProcessOption2 () (princ))
  12.   (defun _ProcessOption3 () (princ))
  13.   (defun _ProcessOption4 () (princ))
  14.   (defun _CalculateAndPrintArea () (princ))
  15.   ;;
  16.   ;;-- Main
  17.   (if
  18.     (not (and (_SelectBoundary)
  19.               (_PromptForOption)
  20.               (_PromptForOldArea)))
  21.      (exit)
  22.   )
  23.   (_OptionController)
  24.   (princ)
  25. )
  26.  
  27.  

Just for giggles: If you renamed these variables to something that had obvious meaning, what would the new names be ?

ANOX
T1
T2
AREA    <-- is not a good name because it duplicates an AutoCAD command name.
OLDARE
SDAREA
SKAREA

How does the user know which option to choose.
« Last Edit: April 04, 2014, 07:46:39 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with a lisp
« Reply #55 on: April 04, 2014, 08:10:48 PM »
Then fill out the logic flow functionality.

Code - Auto/Visual Lisp: [Select]
  1.  
  2. (defun c:MyRoutine ()
  3.   (defun *error* () (princ))
  4.   (defun _SelectBoundary () (princ))
  5.   (defun _PromptForOption () (princ))
  6.   (defun _PromptForOldArea () (princ))
  7.   (defun _OptionController ()
  8.     ;; Calculate BoundaryArea
  9.     (cond ((= OPTION 1) (_ProcessOption1))
  10.           ((= OPTION 2) (_ProcessOption2))
  11.           ((= OPTION 3) (_ProcessOption3))
  12.           ((= OPTION 4) (_ProcessOption4))
  13.           (t (alert "Select > 4 --> Auto select 4. ") (_ProcessOption4))
  14.     )
  15.     (princ)
  16.   )
  17.   (defun _ProcessOption1 ()
  18.     (cond ((< AREA 200)
  19.            ;; Calculate area related values
  20.            ;; Print option comments
  21.           )
  22.           ((< AREA 700)
  23.            ;; Calculate area related values
  24.            ;; Print option comments
  25.           )
  26.           ((>= AREA 700)
  27.            ;; Calculate area related values
  28.            ;; Print option comments
  29.           )
  30.     )
  31.     (princ)
  32.   )
  33.   (defun _ProcessOption2 ()
  34.     (cond ((<= AREA 2000)
  35.            ;; Calculate area related values
  36.            ;; Print option comments
  37.           )
  38.           ((> AREA 2000)
  39.            ;; Calculate area related values
  40.            ;; Print option comments
  41.           )
  42.     )
  43.     (princ)
  44.   )
  45.   (defun _ProcessOption3 ()
  46.     (cond ((and (> AREA 750) (<= AREA 1200))
  47.            ;; Calculate area related values
  48.            ;; Print option comments
  49.           )
  50.           ((and (> AREA 1200) (<= AREA 2000))
  51.            ;; Calculate area related values
  52.            ;; Print option comments
  53.           )
  54.           ((and (> AREA 2000) (< AREA 4000))
  55.            ;; Calculate area related values
  56.            ;; Print option comments
  57.           )
  58.           ((= AREA 4000)
  59.            ;; Calculate area related values
  60.            ;; Print option comments
  61.           )
  62.           ((and (> AREA 4000) (<= AREA 8000))
  63.            ;; Calculate area related values
  64.            ;; Print option comments
  65.           )
  66.           ((> AREA 8000)
  67.            ;; Calculate area related values
  68.            ;; Print option comments
  69.           )
  70.     )
  71.     (princ)
  72.   )
  73.   (defun _ProcessOption4 ()
  74.     ;; Prompt for criteria
  75.     ;; Calculate area related values
  76.     ;; Print option comments
  77.     (princ)
  78.   )
  79.   (defun _CalculateAndPrintComments ()
  80.     ;; Similar to old  (_PrintComments)
  81.     (princ)
  82.   )
  83.   ;;
  84.   ;;-- Main
  85.   ;;
  86.   (if
  87.     (not (and (_SelectBoundary) (_PromptForOption) (_PromptForOldArea)))
  88.      (exit)
  89.   )
  90.   (_OptionController)
  91.   (_CalculateAndPrintComments)
  92.   (princ)
  93. )
  94.  

 
Print this because it is your roadmap.
If you change the logic, change this first.

Save and rename this then continue filling in functionality.

« Last Edit: April 04, 2014, 09:06:44 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

pedroantonio

  • Guest
Re: help with a lisp
« Reply #56 on: April 05, 2014, 12:28:24 PM »
i fix it thanks