Kreaten_vhar Posted May 16, 2022 Posted May 16, 2022 Good morning/afternoon/evening everybody. I'm having a rather frustrating issue, and that issue is, it seems that I cannot get LM's WriteCSV function to actually write to a CSV Â The intent of the program is to create and populate field definitions such that, when called, a dialogue defined by a DCL file that contains a radio button column of field names (left with placeholder names for now) and then an editbox where the user can insert a string that corresponds to the field is opened. The user selects a field title and enters the string they desire then hit the okay button. When the user is satisfied with data inputted for each field label they can then press the Export to CSV button that will create the list of lists that will be the input to Lee Mac's Write CSV file and calls the function. The CSV will have a row for each field label and two columns, one column with the field label and the other with the data for that field label. (This is ultimately going to be used to update and populate multiple drawings with a few different tidbits of data like Titleblock data for example.) Everything runs, the list of lists is constructed but WriteCSV fails to output anything, including it's success/fail message. Attached is both the DCL file defining the dialogue box as well as the LISP file ultimately controlling it and making the LM:WriteCSV call. Thank you for any help resolving this issue. Sample5.dcl Sample5.lsp Quote
mhupp Posted May 16, 2022 Posted May 16, 2022 Make sure your picking a folder you have read/write permission. my work pc i can't create a file on C:\ but i can in documents 1 Quote
Kreaten_vhar Posted May 16, 2022 Author Posted May 16, 2022 @mhupp Thanks for taking the time to respond Well I feel like a bit of a fool! I Thought permissions were all sorted correctly but I made a bad assumption about BricsCAD's working directories. It's all working now! Thanks a million! Quote
Kreaten_vhar Posted May 16, 2022 Author Posted May 16, 2022 (edited) Well apparently I spoke too soon It ran and generated the csv once... Haven't been able to get it to output again Is there something I'm missing about setting directories? I have tried included the full filepath in the function call as well as just leaving a filename. I've also tried messing with vl-getcurrentdir and vl-setcurrentdir and saving the active drawing in different locations. 2nd edit: Boiled it down to something gone wrong in my LISP file. Just calling (LM:WriteCSV masterlist "filename") in the command line works fine. Edited May 16, 2022 by Kreaten_vhar Clarification Quote
Kreaten_vhar Posted May 16, 2022 Author Posted May 16, 2022 Hazzah, I commented out a (progn) while debugging and that threw the whole thing off. I'm good now lol 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.