Our Friends: Leaflet Printing , Presented by: Talia Cad Software

Sign In

Subscribe

Subscribe to Daily Autocad.


Oct 02
Thursday
Visual LISP
Protecting your AutoLISP codes

If you are writing VisualLISP codes professionally, then you should prevent people to read your codes. Thanks to VisualLISP, there is a way of doing this. You do not have to buy a separate program like Microsoft Visual Studio .NET.

Now, let’s have a look at how to convert a single LISP file into a FAS (protected code) file. For example, let’s assume that we have a file in our hand named as HEAL.LSP. You cannot directly make this file with FAS extension. First, you have to put your AutoLISP file into a project.

Those who are familiar with programming know very well that a project is a combination of all of the files like codes, libraries and interface files that are related to the subject. By this way, the compiler keeps all of the files together in one place.

After giving some brief information about project, now let’s have a look at how to create a new project in VisualLISP editor. You can easily do this from “Project/New Project…” menu. Fig.1

Fig.1
Fig.1

You will come up with standard “file open/save” dialog box. You can create and give your project any name that you want (I named it as “sample“). After this you will come up against a dialog box.

Fig.2
Fig.2

In this dialog box, you can select the files that you would like to add to your project. In this example, our project is made up of one single AutoLISP file only. If the file is already inside the directory where you saved your project, then it will automatically be seen. Our LISP file was HEAL.LSP. Select this file and send it yo right side.

Fig.3
Fig.3

As soon as you create the project, “Project Explorer” window will appear on your screen. In this window, you can see a list of codes that are used in you project and a small toolbar. What we are interested is that when you double-click on the code, the code is opened and “Build Project FAS” options. I will explain about the other options when I prepare another article about project.

You can encrypt your project by using “Build Project FAS” option. VisualLISP will create a file named as HEAL.FAS. Code of this file will not be able to be read. However, you will be able to load it as a LSP file and use it.

Viewed 6,017 times so far... This week: 49 Today: 2 Latest: 5 July 2009, 4:55

Post Tags: ,

9 Responses to “ Protecting your AutoLISP codes ”
  1. hello…
    your web site help me alot.
    thaks.
    from
    Dilshad(Pakistan)

  2. Zubair Mughal

    Jan 17, 2008
    Reply

    Code protection is great. Out lspname.fas is good for distribution.

  3. Thanks
    Your information will help me a lot.

  4. hi tohar!
    your tutorial very useful!then i need one help with you!can give some maodel projects!now i know bit of alisp programs!how i can utilize this one!so planed to do some small projects!if u have some modal project can send me through my mail!

  5. Hello Krish,

    please take a look at our download page. I think you can find a lot of lisp samples. Also check out AutoLISp page.

  6. woog(china)

    Oct 21, 2008
    Reply

    thanks。rate 5 star

  7. Hello Sir,
    If it is possible, give an explanation how to Rebuilt fas compile to original lsp format. ie. Readable format. Thanks in advance.

  8. Hello Sir,
    Some autolisp file is not run in autocad, why?

  9. Dear Sir,
    i need a pgm that
    1. prompts for Radius of circle
    2. when Radius is given, all the cirlces of similar diameter ( tolerance of  +/- .05 ,
    precision two decimal places) in the dwg should be grip selected
    3. so that i can change the selected (Grip highlited) circles to different layer with
    layer name being their diameter.
     
    i had almost done, except that, each time i have to alter the radius value in the code,
    below is the code
    (defun c:SIMRAD ()
     (setq rad (cdr (assoc 40 (entget (car (entsel))))))
     (alert (strcat “Radius = ” (rtos rad 2)))
     (princ)
     
     (cadr(sssetfirst nil(setq ss_grip (ssget “_X”‘((0 . “CIRCLE”)(-4 . “=”)(40 . 4.0
    ))))))  
     
    )

    can somebody suggest a solution


Post a Comment



All content and source © 2008 Daily Autocad | News Plus wordpress theme brought to you by Zidalgo.