Aftertouch Posted September 23 Posted September 23 (edited) Hello all, I am working on a datafile, wich allows me to create 'AutoCAD Map 3D objectdata tables' from an external Excel File. But... i run in a small issue. I got this list: ("Verhardingen" ("tablename" . "Verhardingen") ("tabledesc" . "Verhardingen") ("columns" ("colname" . "Formaat") ("coldesc" . "Formaat") ("coltype" . "Character") ("defaultval" . "-"))) and need to a few lines in the 'colums' section.: ("Verhardingen" ("tablename" . "Verhardingen") ("tabledesc" . "Verhardingen") ("columns" ("colname" . "Formaat") ("coldesc" . "Formaat") ("coltype" . "Character") ("defaultval" . "-")("colname" . "Test") ("coldesc" . "Test") ("coltype" . "Character") ("defaultval" . "-"))) so i can add 2 values to a table: But..... how can i add the lines on the place i need it? When i use the CONS function, the extras are added on the last position, but needs to be witin the last brackets. Edited September 23 by Aftertouch Quote
Aftertouch Posted September 23 Author Posted September 23 Got it working! (if datalist (progn (if (member tablename datalist) (setq datalist (list (nth 0 datalist) (nth 1 datalist) (nth 2 datalist) (nth 3 datalist) (append (nth 4 datalist) (list (list (cons "colname" columname)(cons"coldesc" columdesc)(cons "coltype" columtype)(cons "defaultval" defaultval)))))) (setq datalist (list tablename (cons "tablename" tablename)(cons "tabledesc" tabledesc)(list "columns" (list (cons "colname" columname)(cons"coldesc" columdesc)(cons "coltype" columtype)(cons "defaultval" defaultval))))) ) ) (progn (setq datalist (list tablename (cons "tablename" tablename)(cons "tabledesc" tabledesc)(list "columns" (list (cons "colname" columname)(cons"coldesc" columdesc)(cons "coltype" columtype)(cons "defaultval" defaultval))))) ) ) Append did the trick Quote
Tsuky Posted September 23 Posted September 23 With your list (setq lst '("Verhardingen" ("tablename" . "Verhardingen") ("tabledesc" . "Verhardingen") ("columns" ("colname" . "Formaat") ("coldesc" . "Formaat") ("coltype" . "Character") ("defaultval" . "-")))) (setq l_add '(("colname" . "Test") ("coldesc" . "Test") ("coltype" . "Character") ("defaultval" . "-"))) (setq nw_tab (append (list (cadr lst) (caddr lst)) (list (list "columns" (cdr (cadddr lst)) l_add)))) (ade_oddefinetab nw_tab) 1 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.