Aftertouch Posted September 25 Posted September 25 Hello all, I am working on a nice feature for AutoCAD MAP 3D. Attached is a CSV and a LSP file. When i run the command: IMPORTOBJECTDATA, 'Object Data' tables are created from the Excelfile. this works perfect. Now... when i attach the table to a polyline, all properties are visible. By default, AutoCAD-MAP-3D Object Data does not have a pick-list function. I am trying to create it, and am VERY close. When i run the command: MODIFYOBJECTDATA and select the polyline, a dynamic DCL is created with picklists, based off the Excelfile. Reading the values and creating the picklists works fine.. BUT... The (get_tile "accept" function is giving me some hard issues: In the snippet below, the 'Verhardingen-Verband_options' is hard codes, but needs to be a variable field... (action_tile "accept" "(progn (setq nr 0) (repeat (length obattlist) (set (read (strcat \"value\" (itoa nr))) (nth (atoi (get_tile (strcat (nth nr obattlist) \"_list\"))) Verhardingen-Verband_options)) (setq nr (+ 1 nr)) ) (done_dialog 1) )") I tried to replace it with: (strcat (nth nr obattlist) \"_options\") But gives errors... Also: (read (strcat (nth nr obattlist) \"_options\")) ... results in errors Closest i get is: ;; Define actions for the dialog (action_tile "accept" "(progn (setq nr 0) (repeat (length obattlist) (set (read (strcat \"value\" (itoa nr))) (nth (atoi (get_tile (strcat (nth nr obattlist) \"_list\"))) (read (strcat (nth nr obattlist) \"_options\")))) (setq nr (+ 1 nr)) ) (done_dialog 1) )") But gives this error: The name VERHARDINGEN-MATERIAAL_OPTIONS is EXACTLY the same result as the first 'hard-coded' example... so.... why does it give a error with a dynamic code... but works when it is hardcoded? So for some reason... i cannot get it to work... stuck here for a few days now... Please help! IMPORTOBJECTDATA - kopie (3).lsp ObjectData.csv Quote
Steven P Posted September 25 Posted September 25 Consp generally means that the argument isn't a list. Have a test and use (type Verhardingen-Verband_options) in a princ or alert line to show what Verhardingen-Verband_options is. Let us know if it is a list because there is something else wrong otherwise 1 Quote
Aftertouch Posted September 25 Author Posted September 25 Oh, for god sake..... Sometimes you need to take a break at the right time.... I forgot to EVAL function, after the read, to actualy get the list, and not just the symbol name.... Problem solved! ;; Define actions for the dialog (action_tile "accept" "(progn (setq nr 0) (repeat (length obattlist) (set (read (strcat \"value\" (itoa nr))) (nth (atoi (get_tile (strcat (nth nr obattlist) \"_list\"))) (eval (read (strcat (nth nr obattlist) \"_options\"))))) (setq nr (+ 1 nr)) ) (done_dialog 1) )") 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.