Jump to content

Recommended Posts

Posted (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:

image.png.3128d882dbf5fee1359389aed1922d76.png

 

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 by Aftertouch
Posted

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

Posted

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)

 

  • Like 1

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...