Jump to content

Lisp Lisp path


jan_ek

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:)

Link to comment
Share on other sites

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\\")

Link to comment
Share on other sites

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