Author Topic: Select Option  (Read 1386 times)

0 Members and 1 Guest are viewing this topic.

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Select Option
« on: December 30, 2016, 11:59:16 AM »
Hi how is it going

I am looking forward to this with ssget:

Select objects to add or [option1 / option2]: <option1>

But as can not be done with ssget I want to do with grread I do not know if someone could give me an idea, thanks
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Select Option
« Reply #1 on: December 30, 2016, 12:24:40 PM »
But as can not be done with ssget I want to do with grread I do not know if someone could give me an idea, thanks

https://www.theswamp.org/index.php?topic=34804.0

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: Select Option
« Reply #2 on: December 30, 2016, 02:49:15 PM »
Simpliest I could think of:

Code: [Select]
(defun C:test ( / SS1 SS2 p1 p2 )
  (while
    (and
      (or (setq SS1 (ssget "_I")) T)
      (not (initget "A B C D"))
      (setq p1 (getpoint "\nSelect objects or [A/B/C/D] <exit>: "))
    )
    (cond
      ((vl-consp p1)
        (not (initget "A B C D"))
        (setq p2 (getcorner p1 "\nSelect objects or [A/B/C/D] <exit>: "))
        (cond
          ((vl-consp p2)
            (setq SS2 (ssget "_C" p1 p2))
            (sssetfirst nil (acet-ss-union (list SS1 SS2)))
          )
          ((= 'STR (type p2))
            (alert (strcat "\nOption \"" p2 "\" was chosen."))
          )
        ); cond
      )
      ((= 'STR (type p1))
        (alert (strcat "\nOption \"" p1 "\" was chosen."))
      )
    ); cond
  ); while
); defun
Must include DEselect Option.
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg