+ Reply to Thread
Results 1 to 4 of 4

Thread: Lisp Lisp path

  1. #1
    Full Member
    Using
    AutoCAD 2008
    Join Date
    May 2010
    Posts
    48

    Default Lisp Lisp path

    Registered forum members do not see this ad.

    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

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    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.
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  3. #3
    Full Member
    Using
    AutoCAD 2008
    Join Date
    May 2010
    Posts
    48

    Default

    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

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Registered forum members do not see this ad.

    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:

    Code:
    (strcat (getvar 'DWGPREFIX) "Data\\")
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. a lisp to apply 3 different lisp to 3 obj types filtered from one selection
    By gilsoto13 in forum AutoLISP, Visual LISP & DCL
    Replies: 28
    Last Post: 5th Nov 2009, 05:28 am
  2. Full path to Relative Lisp/VBA
    By Emily_83 in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 12th May 2009, 11:48 am
  3. Lisp Call Lisp Problem
    By neekcotrack in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 23rd Aug 2008, 12:56 pm
  4. Path in LISP routines?
    By Kollargoll in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 25th Sep 2007, 01:30 pm
  5. problem, trying to running a list of lisp from within a lisp
    By twind2000 in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 20th Aug 2007, 04:27 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts