jan_ek Posted May 10, 2010 Share Posted May 10, 2010 Hey I have this problem. I use my LISP that imports data to a txt file. The problem is that the path where the record taken from another txt file. And I would like to save the data in a directory called Data just that: If the file is dwg eg C: \ fig \ something \ beam is that the data exported to the directory C: \ thousand \ cos \ data Can I do something like this? I read something about Dwgprefix, Dwgname, Dwgtitlet but I do not know how it linked with Lisp Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 10, 2010 Share Posted May 10, 2010 If you want to write to a new directory, you can create it using perhaps vl-mkdir, else if the directory exists, depending on the mode used with the open function, the file will be created automatically. I'm not sure I completely understand your query however. Quote Link to comment Share on other sites More sharing options...
jan_ek Posted May 10, 2010 Author Share Posted May 10, 2010 The point is that: I would like to check the path in which it is dwg file (sometimes in different places depending on the project) Saves a path to the variable cut for a number of characters, namely: If the path looks like C: \ Pro1 \ Fig \ 01.dwg after truncation would look like C: \ Pro1 \ And now add to the path expression data. So the path looks like this: C: \ Pro1 \ Data \. (This exists). And further, this variable is used as the path to write to the data exported by LISP. I do not know how write properly but I hope that you understand:) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 10, 2010 Share Posted May 10, 2010 Oh I see Certainly look into DWGPREFIX which will get you the filepath that the drawing is saved to. Then, you can concatenate the string data using the strcat function. Bear in mind that you need to use double backslashes to indicate a single backslash, as a single backslash indicates the beginning of an escape character sequence. I would think something like this: (strcat (getvar 'DWGPREFIX) "Data\\") Quote Link to comment Share on other sites More sharing options...
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.