Charpzy Posted December 17, 2022 Posted December 17, 2022 I'm looking to make a script which will display different item descripts and display them with slides, I'm creating a text file with all the info in but I'm not entirely sure on the best way to store to be able to grab the info and then categorise them from there, I want to put them into categories of: Carriageway > Speed > System > Description then once the description is selected it to display each slide my text document ATM is formatted as: (("SINGLE CARRIAGEWAY" "30" "TRAFFIC SIGNALS" "2-WAY TRAFFIC SIGNAL APPROACH") (("TRAFFICLIGHT" "0.0") ("7011A" "15.0") ("517L" "30.0") ("518" "30.0") ("543" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "30" "STOP AND GO" "STOP AND GO APPROACH") (("STOP_GO" "0.0") ("7011B" "15.0") ("517L" "30.0") ("518" "30.0") ("7010F" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "30" "PRIORITY" "L PRIORITY APPROACH") (("DATUM" "0.0") ("516" "15.0") ("516-1" "15.0") ("517L" "30.0") ("518" "30.0") ("7001" "45.0"))) (("SINGLE CARRIAGEWAY" "30" "TWO WAY TRAFFIC" "TWO WAY APPROACH") (("DATUM" "0.0") ("517L" "15.0") ("518" "15.0") ("7001" "30.0"))) the first list being the info to categorise, then the second list has a list of each slide & number value to also display (any slide with duplicate numbers would display below the other in another slide window) dialog display: if there is anything similar to this i could read/ learn from or any guidance that would be much appreciated Quote
BIGAL Posted December 17, 2022 Posted December 17, 2022 (edited) 3 ideas. You can do pop menu very easy and display slides that then call correct insert block command. Just make a custom mnu using notepad. You can also do custom dcl I have 2x2 3x3 4x4 etc they take a list of slide names and display then insert the block. The last option unfortunately can not get any more is to have TTF fonts of hundreds of traffic signs. They are grouped according to state signs. AS TTF can be used with word etc also. The software came with a menu so displays all the signs by group. They traded as HFS fonts, I have tried to find them again. Edited December 17, 2022 by BIGAL Quote
Charpzy Posted December 17, 2022 Author Posted December 17, 2022 I need to display them in a specific way being the only issue, I don't necessarily need in import/ insert them into cad its more for just display/ info for specifics I'd like to display each sign and below them specify a distance so it displays an approach for example a set of traffic lights with the correct meter markings, if possible id like to put all the info into one file rather than breaking it down into speed or carriageway type Quote
BIGAL Posted December 17, 2022 Posted December 17, 2022 (edited) Ok read the better explanation at TheSwamp. Ok 1 way very simple is to use my Multi radio buttons, the difference is you run a sequence of single dcl ending up with the images. (if (not AH:Butts)(load "Multi radio buttons.lsp")) ; loads the program if not loaded already (setq ans (ah:butts 1 "V" '("SELECT SPEED" "TRAFFIC SIGNALS" "STOP AND GO" "PRIORITY" "PRIORITY APPROACH" "TWO WAY TRAFFIC"))) You can do multi radio with 2 or more panels but you must preset can not be dynamic, if say carriageway and speed is always asked then would use the 2 column version to start. I have seen a 5 column version. Multi radio buttons.lspMulti radio buttons 2col.lsp Edited December 17, 2022 by BIGAL Quote
Charpzy Posted December 18, 2022 Author Posted December 18, 2022 Would it be possible to - from my DATA.ini file when the script is called to make 4 lists which grab all unique data (Carriageway, Speed, System & Desc) so I could use that data to populate dialog lists or radio buttons etc? then match that to the relevant data to the DATA file lists to then able to grab the slide & marker info DATA.ini: '( (("SINGLE CARRIAGEWAY" "30" "TRAFFIC SIGNALS" "2-WAY TRAFFIC SIGNAL APPROACH") (("TRAFFICLIGHT" "0.0") ("7011A" "15.0") ("517L" "30.0") ("518" "30.0") ("543" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "30" "TRAFFIC SIGNALS" "3-WAY TRAFFIC SIGNAL APPROACH") (("TRAFFICLIGHT" "0.0") ("7011-1A" "15.0") ("517L" "30.0") ("518" "30.0") ("543" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "30" "TRAFFIC SIGNALS" "4-WAY TRAFFIC SIGNAL APPROACH") (("TRAFFICLIGHT" "0.0") ("7011-1B" "15.0") ("517L" "30.0") ("518" "30.0") ("543" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "30" "TRAFFIC SIGNALS" "PEDESTRIAN TRAFFIC SIGNAL APPROACH") (("TRAFFICLIGHT" "0.0") ("7011_2" "15.0") ("517L" "30.0") ("518" "30.0") ("543" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "30" "TRAFFIC SIGNALS" "TRAFFIC UNDER SIGNAL APPROACH") (("7021" "0.0") ("7001" "15.0"))) (("SINGLE CARRIAGEWAY" "30" "STOP AND GO" "STOP AND GO APPROACH") (("STOP_GO" "0.0") ("7011B" "15.0") ("517L" "30.0") ("518" "30.0") ("7010F" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "30" "PRIORITY" "L PRIORITY APPROACH") (("DATUM" "0.0") ("516" "15.0") ("516-1" "15.0") ("517L" "30.0") ("518" "30.0") ("7001" "45.0"))) (("SINGLE CARRIAGEWAY" "30" "PRIORITY" "L PRIORITY APPROACH") (("DATUM" "0.0") ("811" "15.0") ("811-1" "15.0") ("517R" "30.0") ("518" "30.0") ("7001" "45.0"))) (("SINGLE CARRIAGEWAY" "30" "TWO WAY TRAFFIC" "TWO WAY APPROACH") (("DATUM" "0.0") ("517L" "15.0") ("518" "15.0") ("7001" "30.0"))) (("SINGLE CARRIAGEWAY" "40" "TRAFFIC SIGNALS" "2-WAY TRAFFIC SIGNAL APPROACH") (("TRAFFICLIGHT" "0.0") ("7011A" "15.0") ("517L" "30.0") ("518" "30.0") ("543" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "40" "TRAFFIC SIGNALS" "3-WAY TRAFFIC SIGNAL APPROACH") (("TRAFFICLIGHT" "0.0") ("7011-1A" "15.0") ("517L" "30.0") ("518" "30.0") ("543" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "40" "TRAFFIC SIGNALS" "4-WAY TRAFFIC SIGNAL APPROACH") (("TRAFFICLIGHT" "0.0") ("7011-1B" "15.0") ("517L" "30.0") ("518" "30.0") ("543" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "40" "TRAFFIC SIGNALS" "PEDESTRIAN TRAFFIC SIGNAL APPROACH") (("TRAFFICLIGHT" "0.0") ("7011_2" "15.0") ("517L" "30.0") ("518" "30.0") ("543" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "40" "TRAFFIC SIGNALS" "TRAFFIC UNDER SIGNAL APPROACH") (("7021" "0.0") ("7001" "15.0"))) (("SINGLE CARRIAGEWAY" "40" "STOP AND GO" "STOP AND GO APPROACH") (("STOP_GO" "0.0") ("7011B" "15.0") ("517L" "30.0") ("518" "30.0") ("7010F" "45.0") ("7001" "60.0"))) (("SINGLE CARRIAGEWAY" "40" "PRIORITY" "L PRIORITY APPROACH") (("DATUM" "0.0") ("516" "15.0") ("516-1" "15.0") ("517L" "30.0") ("518" "30.0") ("7001" "45.0"))) (("SINGLE CARRIAGEWAY" "40" "PRIORITY" "L PRIORITY APPROACH") (("DATUM" "0.0") ("811" "15.0") ("811-1" "15.0") ("517R" "30.0") ("518" "30.0") ("7001" "45.0"))) (("SINGLE CARRIAGEWAY" "40" "TWO WAY TRAFFIC" "TWO WAY APPROACH") (("DATUM" "0.0") ("517L" "15.0") ("518" "15.0") ("7001" "30.0"))) ) 2 hours ago, BIGAL said: Ok read the better explanation at TheSwamp. Ok 1 way very simple is to use my Multi radio buttons, the difference is you run a sequence of single dcl ending up with the images. (if (not AH:Butts)(load "Multi radio buttons.lsp")) ; loads the program if not loaded already (setq ans (ah:butts 1 "V" '("SELECT SPEED" "TRAFFIC SIGNALS" "STOP AND GO" "PRIORITY" "PRIORITY APPROACH" "TWO WAY TRAFFIC"))) You can do multi radio with 2 or more panels but you must preset can not be dynamic, if say carriageway and speed is always asked then would use the 2 column version to start. Multi radio buttons.lsp 3.38 kB · 43 downloads Multi radio buttons 2col.lsp 4.29 kB · 15 downloads Quote
BIGAL Posted December 18, 2022 Posted December 18, 2022 (edited) Ok started to put something together ends up with a list that can maybe be found in your big master list. (if (not ah:buttscol3)(load "Multi Radio buttons 3col.lsp")) (setq but1 1) (setq but2 1) (setq but3 1) (setq lst1 (list "Select TYPE" "SINGLE CARRIAGEWAY" "DUAL CARRIAGEWAY" "SINGLE+LEFT" "SINGLE+RIGHT" "DUAL CARRIAGEWAY+LEFT" "DUAL CARRIAGEWAY+rIGHT")) (setq lst2 (list "Select SPEED" "30" "40" "45" "50")) (setq lst3 (list "Select SIG TYPE " "TRAFFIC SIGNALS" "STOP AND GO" "PRIORITY" "TWO WAY TRAFFIC")) (ah:buttscol3 but1 but2 but3 "Please choose" lst1 lst2 lst3 "H") (setq lst '()) (setq lst (cons (list (nth but1 lst1)(nth but2 lst2)(nth but3 lst3)) lst)) Not sure where to go next Need say a few combos to understand have the 1st 3 worked out when get to 4th ? ("DUAL CARRIAGEWAY" "45" "STOP AND GO") Multi radio buttons 3col.lsp Edited December 18, 2022 by BIGAL Quote
Charpzy Posted December 19, 2022 Author Posted December 19, 2022 thank you, someone linked me to one of Lee Macs scripts which worked perfect for what m initial aim was so I've ended up with two files to make this work easier, one which controls the list of items for the dialog, and other which stores the "description" to be able to connect both lists as well as the slide info and marker info The only issue I'm having ATM is getting it work within a action_tile (defun c:SAPPROACH (/ *error* dch dcl des lst rtn) (defun *error* (msg) (if (= 'file (type des)) (close des) ) (if (< 0 dch) (unload_dialog dch) ) (if (and (= 'str (type dcl)) (findfile dcl)) (vl-file-delete dcl) ) (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))) (princ (strcat "\nError: " msg)) ) (princ) ) (setq lst (load (findfile "DATA\\SAPPROACHES.ini"))) (if (and (setq fn (findfile "MACROS\\DIALOGS\\APPROACH.dcl")) (setq dlg_id (load_dialog fn)) (new_dialog "SARRAY" dlg_id) ) (progn (setq rtn '(0 0 0)) ;(LM:dcld:action '( "speed-list" "sys-list" "desc-list") 'lst 'rtn) (action_tile "desc-list" "(SLIDERESET)(SLIDEIMAGE (caddr (LM:dcld:getitems rtn lst)))") (if (= 1 (start_dialog)) (princ (caddr (LM:dcld:getitems rtn lst))) ) ) ) (*error* nil) (princ) ) Link to Lee Macs script: http://lee-mac.com/listtiledependency.html 21 hours ago, BIGAL said: Ok started to put something together ends up with a list that can maybe be found in your big master list. (if (not ah:buttscol3)(load "Multi Radio buttons 3col.lsp")) (setq but1 1) (setq but2 1) (setq but3 1) (setq lst1 (list "Select TYPE" "SINGLE CARRIAGEWAY" "DUAL CARRIAGEWAY" "SINGLE+LEFT" "SINGLE+RIGHT" "DUAL CARRIAGEWAY+LEFT" "DUAL CARRIAGEWAY+rIGHT")) (setq lst2 (list "Select SPEED" "30" "40" "45" "50")) (setq lst3 (list "Select SIG TYPE " "TRAFFIC SIGNALS" "STOP AND GO" "PRIORITY" "TWO WAY TRAFFIC")) (ah:buttscol3 but1 but2 but3 "Please choose" lst1 lst2 lst3 "H") (setq lst '()) (setq lst (cons (list (nth but1 lst1)(nth but2 lst2)(nth but3 lst3)) lst)) Not sure where to go next Need say a few combos to understand have the 1st 3 worked out when get to 4th ? ("DUAL CARRIAGEWAY" "45" "STOP AND GO") Multi radio buttons 3col.lsp 4.84 kB · 2 downloads Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.