Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: How can I create a lisp protected file.

  1. #1
    I could stop if I wanted to
    Join Date
    2005-08
    Location
    Albania
    Posts
    423
    Login to Give a bone
    0

    Default How can I create a lisp protected file.

    Hello all.

    I want to protect a lisp file with suffix .lsp.
    How can I do it.

    Thanks for suggestion.

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Exclamation Re: How can I create a lisp protected file.

    If maintaining the .LSP file extension is a requirement, then grab protect.exe. It will "compile" a .lsp file, leaving the file extension the same. Note that unprotect.exe is readily available also.

    If you really just want to compile it (in a much more protected manner) and the file extension is not important, then compile the LSP file to FAS using the (vlisp-compile) function. -or- compile the a .VLX file using the Make Application tools in the VLIDE. (details on how to do both are available in HELP)
    R.K. McSwain | CAD Panacea |

  3. #3
    I could stop if I wanted to
    Join Date
    2005-08
    Posts
    378
    Login to Give a bone
    0

    Cool Re: How can I create a lisp protected file.

    Well it's not often tht I can assist with anything though here goes.
    I was wanting the exact same thing and decided to try write a routine that would convert the files to a ".fas" file for me. My attempt is below:

    Code:
    (defun c:FAS (/ name lispname outfilename findfas rewritefas)
      (setvar "cmdecho" 0)
      (setq name (strcase (getstring "Enter Lisp Name: ")))
      (setq lispname 
             (strcat "S:\\DSA CAD\\Lisp for AutoCad\\Used LISp Files\\" 
                     name 
                     ".LSP"
             ) ;_end strcat
      ) ;_end setq
      (setq	outfilename
    	 (strcat "S:\\DSA CAD\\Lisp for AutoCad\\Used LISp Files\\FAS Files\\"
    		 name
    		 ".FAS"
    	 ) ;_end strcat
      ) ;_end setq
      (setq findfas (findfile outfilename))
      (if (not findfas)
        (vlisp-compile 'st lispname outfilename)
        (progn
          (initget "Y N")
          (setq rewritefas
    	     (getkword "Save Over Existing FAS? [Yes or No]: ")
          ) ;_end setq
          (if (= rewritefas "Y")
    	(vlisp-compile 'st lispname outfilename)
    	(alert "FAS Compiling Aborted")
          ) ;_end if
        ) ;_end progn
      ) ;_end if
      (setvar "cmdecho" 1)
      (princ)
    ) ;_end defun

    So just save the file and load the routine. Type "FAS" and then just the lisp file name without the extension.
    Oh that reminds me, change the folder locations for the variables lispname & outfilename to your own directory paths.

    Stephen
    Last edited by Opie; 2007-08-13 at 04:53 PM. Reason: [CODE] tags added

  4. #4
    I could stop if I wanted to
    Join Date
    2005-08
    Location
    Albania
    Posts
    423
    Login to Give a bone
    0

    Default Re: How can I create a lisp protected file.

    Quote Originally Posted by rkmcswain
    If maintaining the .LSP file extension is a requirement, then grab
    protect.exe. It will "compile" a .lsp file, leaving the file extension the same. Note that unprotect.exe is readily available also.

    If you really just want to compile it (in a much more protected manner) and the file extension is not important, then compile the LSP file to FAS using the (vlisp-compile) function. -or- compile the a .VLX file using the Make Application tools in the VLIDE. (details on how to do both are available in HELP)
    Thanks for the answer.
    This file work in DOS Mode but function.

  5. #5
    Member
    Join Date
    2009-02
    Posts
    8
    Login to Give a bone
    0

    Default Re: How can I create a lisp protected file.

    Hi I try to do your sample, bat I get an error:
    ; error: no function definition: VLISP-COMPILE

    Do you know why?

    Thanks...

  6. #6
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: How can I create a lisp protected file.

    Quote Originally Posted by josea_diazm View Post
    Hi I try to do your sample, bat I get an error:
    ; error: no function definition: VLISP-COMPILE

    Do you know why?

    Thanks...
    you may need to run (vl-load-com) first
    R.K. McSwain | CAD Panacea |

  7. #7
    Member
    Join Date
    2009-02
    Posts
    8
    Login to Give a bone
    0

    Default Re: How can I create a lisp protected file.

    Thanks,
    I try to run both:
    (vl-load-com) first
    and then de function (VLISP-COMPILE), bat the error is the same.

    Im wait.

  8. #8
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: How can I create a lisp protected file.

    Quote Originally Posted by josea_diazm View Post
    Thanks,
    I try to run both:
    (vl-load-com) first
    and then de function (VLISP-COMPILE), bat the error is the same.

    Im wait.
    Run (vl-load-com) once, then execute FAS.

  9. #9
    Member
    Join Date
    2009-02
    Posts
    8
    Login to Give a bone
    0

    Default Re: How can I create a lisp protected file.

    Thanks...
    --------------------------------------------------
    Command: (vl-load-com)
    Command: FAS
    Enter Lisp Name: IGUALQUE
    ; error: no function definition: VLISP-COMPILE
    Command:
    --------------------------------------------------
    What's wrong?, my program?, i don't know.
    Thanks...

  10. #10
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: How can I create a lisp protected file.

    What does AutoCad return when you paste this into the commandline:
    Code:
    (member "vl.arx" (arx))
    What version of acad are you running?

Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 2014-06-02, 03:26 PM
  2. Protected AutoLISP File
    By vipin_nair in forum AutoLISP
    Replies: 4
    Last Post: 2011-06-06, 02:04 PM
  3. Breaking a protected LISP
    By design.9921 in forum AutoCAD Customization
    Replies: 5
    Last Post: 2009-06-06, 11:48 AM
  4. Create lisp to extract data from excel file
    By Lions60 in forum AutoLISP
    Replies: 7
    Last Post: 2008-01-30, 04:32 AM
  5. Write Protected File
    By Mac Demer in forum AutoCAD General
    Replies: 1
    Last Post: 2007-10-26, 11:49 AM

Posting Permissions

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