Jump to content

Cannot get Output from Lee Mac's WriteCSV


Recommended Posts

Posted

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

Posted

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

  • Like 1
Posted

@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! 🤟

Posted (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 by Kreaten_vhar
Clarification
Posted

Hazzah, I commented out a (progn) while debugging and that threw the whole thing off.

I'm good now lol 😀

  • Agree 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...