TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jlogan02 on January 27, 2021, 01:28:38 PM

Title: BigAL ah:butts ?
Post by: jlogan02 on January 27, 2021, 01:28:38 PM
BigAl,

Thought I'd give your multi-buttons routines a shot with a simple line routine. It keeps telling me the linetype is loaded do I want to reload it.
I can't seem to find the way around that part.

I tried using
Code - Auto/Visual Lisp: [Select]
  1. setvar 'celtype ans
instead of
Code - Auto/Visual Lisp: [Select]
  1. (command "linetype" "S"...)
  and get...AutoCAD variable rejected...celtype

Also, in this routine I'm using the acad_colordlg to set the color, how would I used AH:Butts for two dialogs? One for color and one for linetype?

Code - Auto/Visual Lisp: [Select]
  1. (defun test22 ( / ans but p1 p2 )
  2.    (graphscr)
  3.    (setq scmde (getvar "cmdecho"))
  4.    (setvar "cmdecho" 0)
  5.    (setvar 'cecolor (rtos (acad_colordlg 1) 2 0))
  6. (if (not AH:Butts)(load "Multi Radio buttons-2.lsp"))
  7.   (if (not but)(setq but 1))
  8.     (setq ans (ah:butts but "v" '("Choose LineType" "ByBlock" "Bylayer" "CENTER" "Continuous" "PHANTOMA" "PULSE" "VOLTAGE")))
  9.  
  10.   (command "linetype" "s" ans)
  11.  (while (and (or p1 (setq p1 (getpoint "\nSpecify start point: ")))
  12.                      (setq p2 (getpoint p1 "\nSpecify next point: "))
  13.   )
  14.       (command "line" p1 p2 "")
  15.       (setq p1 p2)
  16.   )
  17. )
  18. )
Title: Re: BigAL ah:butts ?
Post by: d2010 on January 27, 2021, 04:17:23 PM
Do you need develop-Dynamically;DCL as Shadow of insideList?
Startup , you enter Q2[enter]
Title: Re: BigAL ah:butts ?
Post by: BIGAL on January 27, 2021, 11:03:22 PM
Linetype change (setvar 'celtype ans)

One of the things I did recently was to make a dcl with radio buttons and  toggles. But I hard coded it, it is on my list to make a two column multi radio buttons.

The colordlg lists all colours thats 256 or do you want only a few ? You can have like about 20+ appear on screen its a screen limitation. Pretty sure tested a version with A-Z.

I am hoping to do the 2 columns soon. Really it could do more than 2 columns (list (list1)(list2)(list3)) would mean 3 columns. (list (list1)) means 1 column.
Have to have a think about returning button pressed.

If you provide 2 lists will try to put something together to test that suits you.

I updated the multi radio by adding a line padding version (setq ans (ah:butts but "v" 2 '("Choose LineType" "ByBlock" "Bylayer" when small number the buttons would crowd so the "2" implies 2 blank lines between buttons.
Title: Re: BigAL ah:butts ?
Post by: jlogan02 on January 28, 2021, 12:10:28 PM
I would appreciate that.
Linetype change (setvar 'celtype ans)

One of the things I did recently was to make a dcl with radio buttons and  toggles. But I hard coded it, it is on my list to make a two column multi radio buttons.

The colordlg lists all colours thats 256 or do you want only a few ? You can have like about 20+ appear on screen its a screen limitation. Pretty sure tested a version with A-Z.

I am hoping to do the 2 columns soon. Really it could do more than 2 columns (list (list1)(list2)(list3)) would mean 3 columns. (list (list1)) means 1 column.
Have to have a think about returning button pressed.

If you provide 2 lists will try to put something together to test that suits you.

I updated the multi radio by adding a line padding version (setq ans (ah:butts but "v" 2 '("Choose LineType" "ByBlock" "Bylayer" when small number the buttons would crowd so the "2" implies 2 blank lines between buttons.


I would appreciate that.

Colors dialog list -  Bylayer,1,15,30,150


Code - Auto/Visual Lisp: [Select]
  1. (List1)("Choose Layer" "LINE0" "LINE1" "LINE2" "LINE3" "LINE4" "LINE5") ;;;these are generic layer names, I'll update when I get them all settled.
  2.  
  3. (List2)("Choose Linetype" "Bylayer" "CENTER" "Continuous" "PHANTOMA" "PULSE" "VOLTAGE")

Code - Auto/Visual Lisp: [Select]
  1. ("Choose LineType" "ByBlock" "Bylayer" "CENTER" "Continuous" "PHANTOMA" "PULSE" "VOLTAGE")
  2. (setvar 'celtype ans)
? I swear to god, I tried that. Just tested and it works. I don't know...

I like the spacing right now for the buttons but I'll be sure to test it out for future reference. Are you saying that's updated in the downloadable version, now?

Thanks again for looking into this. After testing (setvar 'celtype ans) I can see it all coming together.

J. Logan

 
Title: Re: BigAL ah:butts ?
Post by: BIGAL on January 28, 2021, 06:28:42 PM
Working on a dual column library radio buttons dcl. Version 2 with spacing, I have not put it anywhere yet will do as part of multi column.

Downloads at Cadtutuor
Multi getvals
Multi Radio Buttons
Multiple toggles
Multi getvals image
Title: Re: BigAL ah:butts ?
Post by: jlogan02 on January 29, 2021, 01:20:46 PM
It's looking good. Thanks for the update.
Working on a dual column library radio buttons dcl. Version 2 with spacing, I have not put it anywhere yet will do as part of multi column.

Downloads at Cadtutuor
Multi getvals
Multi Radio Buttons
Multiple toggles
Multi getvals image

Title: Re: BigAL ah:butts ?
Post by: BIGAL on January 30, 2021, 06:34:56 PM
Starting to get somewhere its 2 at moment but will probably do a as many as required 1, 2 or 3+ so will replace the default Multi radio buttons.

A couple of fixes is add a column heading, reduce gap in column spacing.

Code: [Select]
(if (= but nil)(setq but 1))
(if (= but2 nil)(setq but2 1))

(setq lst (list "Please Choose " "1" "2" "3" "4" "5" "6" "7" "8" "9" "10"))
(setq lst2 (list "A" "B" "C" "D"))
(ah:buttscol but but2  lst lst2)

; desirable
; (setq lst3 (list 'Yes" "No" ))
; (setq lst4 ......


Happy to accept requests for testing, just supply the lists as strings must be strings in a dcl but can convert numbers like a variables.
Title: Re: BigAL ah:butts ?
Post by: jlogan02 on February 01, 2021, 05:21:47 PM
Took a short look at it today. I haven't had time to test though. I'm hoping tomorrow to get some time. The screencap looks good though.
Title: Re: BigAL ah:butts ?
Post by: jlogan02 on February 02, 2021, 05:01:51 PM
HOLD ON...I just noticed the error message is call out a 00x.dcl not a .lsp. I'm looking at the wrong file.

Getting this error message when running the routine (see screen cap).

Since I don't have 112 lines of code, I'm assuming it's in the "Multi Radio buttons 2col.lsp" code. If it is there, I'm not seeing the error.


Code - Auto/Visual Lisp: [Select]
  1. (defun c:test12 ( / ans but2 lst lst2 p1 p2 )
  2.  
  3. (if (not ah:buttscol)(load "Multi Radio buttons 2col.lsp"))
  4.  (if (= but nil)(setq but 1))
  5.  (if (= but2 nil)(setq but2 1))
  6.  (setq lst (list "Select number" "256" "1" "15" "30" "150" ))
  7.  (setq lst2 (list "Choose Layer" "LINE0 (CENTER)" "LINE1 (PHANTOMA)" "LINE2 (CONTINUOUS)" "LINE3 (CONTINUOUS)" "LINE4 (CONTINUOUS)" "LINE5 (CONTINUOUS)" "LINE6 (VOLTAGE)" "LINE7 (DASHED)" "CLOUD (ZIGZAG)" ))
  8.  (ah:buttscol but but2 "Please choose" lst lst2)
  9.  (setvar 'cecolor lst)
  10.  (setvar 'clayer lst2)
  11.  
  12.  (while (and (or p1 (setq p1 (getpoint "\nSpecify start point: ")))
  13.                    (setq p2 (getpoint p1 "\nSpecify next point: "))
  14.            )
  15. (command "line" p1 p2 "")
  16.           (setq p1 p2)
  17.   )
  18.  )
Title: Re: BigAL ah:butts ?
Post by: BIGAL on February 02, 2021, 05:39:36 PM
The error is in the setvar you are setting a list not a single item (setvar 'cecolor (nth but lst))

I have changed the code will send you an update as I was using the same global variable for all multi's.

Better at this time to email me as have not posted code.
Title: Re: BigAL ah:butts ?
Post by: jlogan02 on February 02, 2021, 05:47:29 PM
Ahhh...yes. I see that now.

Email incoming.
Title: Re: BigAL ah:butts ?
Post by: d2010 on February 03, 2021, 02:49:08 AM
You customize radios.dcl direct inside.Lisp
Code: [Select]
/*c2s:
       d6=list( list("1.Jeff H",1),
                list("2.Mohnston",0),
                list("3.by d2010",1),
                list("4.by dubb",1),
                list("5.Wizman",1),
                list("6.by VovKa",0),
                list("7.John kaul",1),
                list("8.Greg B",1),
                list("9.LogicTools",1)
            );
       d6=append(list("You see here theSwampUser/s",0),d6);
       bigal=list("Title of DCL, you type here",1,list(2,1,1,3),d6,d6,d6,d6);
       bob=dfn_dcl_radios(bigal);
*/
:whistling:


The mainHint= You extract the list of STYLE wit
Code: [Select]
#region
dfn_layer_list1

;;Lst: (dfn_layer_list1 "*" 23 "0")
(Defun dfn_layer_list1(matchname SetMaxWidth autotblfmt / $rr dpr nam rstr nop cnt)
/*c2s: $rr=nil,
       rstr=autotblfmt,
       autotblfmt=(rstr=="0")?"APPID":
                  (rstr=="1")?"BLOCK":
                  (rstr=="2")?"LAYER":
                  (rstr=="3")?"LTYPE":
                  (rstr=="4")?"STYLE":
                  (rstr=="5")?"DIMSTYLE":
                  (rstr=="6")?"VIEW":
                  (rstr=="7")?"UCS":"LAYER";

#endregion
Biserica Azi. Īntāmpinarea Domnului - Sărbătoarea făgăduinței īmplinite.
Code - Auto/Visual Lisp: [Select]
  1. Command: (dfn_layer_list1 "a*" 23 "0");23=maxlength of list
  2. nil
  3.  
  4. Command: (dfn_layer_list1 "*" 23 "0")
  5. (("acad" 1) ("topolt" 1) ("contentblockicon" 1) ("ade" 1) ("acad_psext" 1)
  6. ("acad_exempt_from_cad_standards" 1) ("acad_mleaderver" 1))
  7.  
  8. Command: (dfn_layer_list1 "*" 23 "1");;BLOCK
  9. (("nord1" 1) ("stilbet" 1) ("putamer" 1) ("punct" 1) ("cvcan" 1) ("gager" 1)
  10. ("hidrant" 1) ("cvgaze" 1) ("cvtel" 1) ("ptstalp" 1) ("stlea" 1) ("stellin" 1)
  11. ("stlemn" 1) ("stillmn" 1) ("sttel" 1) ("stelcf" 1) ("lampadar" 1) ("proiector"
  12. 1) ("statie" 1) ("b12" 1) ("cvapa" 1) ("cismea" 1) ("cjxcoo" 1))
  13.  
  14. Command: (dfn_layer_list1 "*" 23 "2");;LAYER
  15. (("0" 1) ("text 0.35" 1) ("text 0.5" 1) ("contur" 1) ("defpoints" 1) ("contur
  16. tabel" 1) ("randuri" 1) ("fa4" 1) ("587_355" 1) ("t59_60" 1) ("0_pct_coduri" 1)
  17. ("0_pct_denumiri" 1) ("0_pct_linii_marcaj" 1) ("puncte" 1) ("punctec" 1)
  18. ("0_pct_simboluri" 1) ("0_pct_cote" 1) ("0_pct_texte_suprapuse" 1) ("caroiaj"
  19. 1) ("imagini_raster" 1) ("curbe_de_nivel" 1) ("model_3d" 1) ("plansa" 1))
  20.  
  21. Command: (dfn_layer_list1 "*" 23 "3");;LTYPE
  22. (("continuous" 1) ("acad_iso07w100" 1) ("dashed" 1) ("linprop" 1) ("lsect" 1)
  23. ("linpct" 1) ("linpdtuf" 1) ("lconstrsub" 1) ("grdlemn_st" 1) ("grdpl" 1)
  24. ("grdbet_st" 1) ("grdmet" 1) ("grdzidmet_st" 1) ("grdghimp" 1) ("lax" 1) ("cf"
  25. 1) ("tramvai" 1) ("grdlemn_dr" 1) ("grdbet_dr" 1) ("grdzidmet_dr" 1)
  26. ("talmic_st" 1) ("talmic_dr" 1) ("talmare_st" 1))
  27.  
  28.  
  29. Command: (dfn_layer_list1 "*" 23 "4");;TEXTSTYLE
  30. (("STANDARDT" 1) ("ROMANST" 1) ("TIMES_NEW_ROMANT" 1) ("NT" 1) ("ROMANTICT" 1)
  31. ("ROMANDT" 1) ("ROMANCT" 1) ("ITALICCT" 1) ("ARIALT" 1) ("MS_LINEDRAWT" 1)
  32. ("ROMAND_SHXT" 1) ("COURIER_NEWT" 1))
  33.  
  34. Command: (dfn_layer_list1 "*" 23 "5")
  35. (("STANDARDT" 1) ("ISO-25T" 1) ("LATURIT" 1) ("R1000T" 1) ("1T" 1))
  36.  
  37. Command: (dfn_layer_list1 "*" 23 "6")
  38. nil
  39.  
  40. Command: (dfn_layer_list1 "*" 23 "0")
  41. (("ACADT" 1) ("TOPOLTT" 1) ("CONTENTBLOCKICONT" 1) ("ADET" 1) ("ACAD_PSEXTT" 1)
  42. ("ACAD_EXEMPT_FROM_CAD_STANDARDST" 1) ("ACAD_MLEADERVERT" 1))
  43.  
  44. Command: (dfn_layer_list1 "*" 23 "1")
  45. (("Nord1T" 1) ("StilBetT" 1) ("PutAmerT" 1) ("PunctT" 1) ("CVCANT" 1) ("GAGERT"
  46. 1) ("HIDRANTT" 1) ("CVGAZET" 1) ("CVTELT" 1) ("PTSTALPT" 1) ("STLEAT" 1)
  47. ("STELLINT" 1) ("STLEMNT" 1) ("STILLMNT" 1) ("STTELT" 1) ("STELCFT" 1)
  48. ("LAMPADART" 1) ("PROIECTORT" 1) ("STATIET" 1) ("B12T" 1) ("CvApaT" 1)
  49. ("CismeaT" 1) ("CJxcooT" 1))
  50.