Author Topic: SSGET + INITGET  (Read 2513 times)

0 Members and 1 Guest are viewing this topic.

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
SSGET + INITGET
« on: October 14, 2016, 01:06:43 PM »
Hi, I need help please.
As I can add to ssget initget type options.   :sleezy:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:A31 (/ ObjSelect i)
  2. (setvar "cmdecho" 0)
  3. (setvar 'errno 0)
  4. (initget "Doble")
  5. (setq ObjSelect (LM:ssget "\nSelect Polyline Hatch Simple or [Doble]: " '("_:L")))
  6.  ((= 7 (getvar 'errno)) (princ "\nMissed, try again."))
  7.  
  8. ((= "Doble" ObjSelect)
  9. (command "_.hatch" "ANSI31" "0.025" "0" ObjSelect ""
  10.  "_hatchedit" (entlast) "_ASSOCIATE" "_s" ObjSelect "" "")
  11. (prompt "\nTerminado.."))
  12.  
  13. ((= (type ObjSelect) 'PICKSET)
  14. (repeat (setq i (sslength ObjSelect))
  15. (command "_.hatch" "ANSI31" "0.025" "0" ObjSelect ""
  16.          "_hatchedit" (entlast) "_ASSOCIATE" "_s" (ssname ObjSelect (setq i (1- i))) "" ""))
  17. ))
  18. (setvar "cmdecho" 1)
  19. (prompt (strcat "\n- Se modifico [ " (itoa (sslength ObjSelect)) " ] Objeto(s)"))
  20.  
  21.     ;; ssget  -  Lee Mac
  22.     ;; A wrapper for the ssget function to permit the use of a custom selection prompt
  23.     ;; msg - [str] selection prompt
  24.     ;; arg - [lst] list of ssget arguments
  25.      
  26.     (defun LM:ssget ( msg arg / sel )
  27.         (princ msg)
  28.         (setvar 'nomutt 1)
  29.         (setq sel (vl-catch-all-apply 'ssget arg))
  30.         (setvar 'nomutt 0)
  31.         (if (not (vl-catch-all-error-p sel)) sel)
  32.     )
  33.  
  34.  
  35.  
  36.  
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Re: SSGET + INITGET
« Reply #1 on: October 14, 2016, 02:34:51 PM »
Change some code of Lee mac, works example 1, the example 2 does not give me results.

Code - Auto/Visual Lisp: [Select]
  1. ;; ssget  -  Lee Mac
  2.     ;; A wrapper for the ssget function to permit the use of a custom selection prompt
  3.     ;; init - [lst] list of parameters
  4.     ;; Mens - [str] selection prompt
  5.     ;; arg - [lst] list of ssget arguments
  6.    
  7.      
  8.     (defun LM:ssget2 (init Mens arg / sel )
  9.         (if (not Mens)(setq Mens "\nSelecciona: "))
  10.         (if (not init) (setq init (list 0)))    
  11.         (princ Mens)
  12.         (setvar 'nomutt 1)
  13.         (apply (function initget) init)
  14.         (setq sel (vl-catch-all-apply 'ssget arg))
  15.         (setvar 'nomutt 0)
  16.         (if (not (vl-catch-all-error-p sel)) sel))
  17.  
  18. (setq example_1 (LM:ssget2 nil nil '("_:L")))
  19.  
  20. (setq example_2 (LM:ssget2 '( 6 "Todo Simple") "\nSelecciona Objeto(s) [Todo Simple] " '("_:L")))
  21.  
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: SSGET + INITGET
« Reply #2 on: October 14, 2016, 03:03:34 PM »

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: SSGET + INITGET
« Reply #3 on: October 14, 2016, 03:13:13 PM »
So the solution may be using (getpoint) and (getcorner) or (getpoint) with initget, or even (grread).
That idea is in my head right now.
(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

ChrisCarlson

  • Guest
Re: SSGET + INITGET
« Reply #4 on: October 14, 2016, 04:01:36 PM »
What are you trying to accomplish? Lee has a magnificent function

http://www.lee-mac.com/selectif.html

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Re: SSGET + INITGET
« Reply #5 on: October 14, 2016, 04:12:09 PM »
What are you trying to accomplish? Lee has a magnificent function

http://www.lee-mac.com/selectif.html

but it does not work with ssget  :no:
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

T.Willey

  • Needs a day job
  • Posts: 5251
Re: SSGET + INITGET
« Reply #6 on: October 15, 2016, 03:28:02 AM »
Maybe you can get some inpiration to create your own function that uses 'grread', 'getcorner' and 'ssget' from this thread.  No time to help more sorry.
https://www.theswamp.org/index.php?topic=19886.0
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: SSGET + INITGET
« Reply #7 on: October 23, 2016, 06:00:12 PM »
Maybe you can get some inpiration to create your own function that uses 'grread', 'getcorner' and 'ssget' from this thread.  No time to help more sorry.
https://www.theswamp.org/index.php?topic=19886.0
Another:
https://www.theswamp.org/index.php?topic=34804