TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Fishing4Lsp on January 22, 2009, 10:53:53 AM

Title: zip files with autolisp
Post by: Fishing4Lsp on January 22, 2009, 10:53:53 AM
Hello,

I'm new to this site and in autolisp. I am trying to
write a program that will select files from various locations
then copy them to desired locations. Then after all that
I need to "zip" them.

I have winzip installed in my computer. Can you access
winzip thru autolisp or visual lisp?

I would like to be able to zip a folder and/or a list of files.
Can somebody help. A link or some coding would be appreciated?
Title: Re: zip files with autolisp
Post by: JohnK on January 22, 2009, 12:40:54 PM
i actually prefer winrar ...but here is a link to a quick example i wrote a while back using 7zip.

[ http://www.theswamp.org/index.php?topic=14793.0 ]
Title: Re: zip files with autolisp
Post by: Fishing4Lsp on January 22, 2009, 02:28:27 PM
Thank you!. I ran the lisp. I saw it doing its thing (the dos command line)
but it did not create the zip file, or it created it in a different directory.
I'm still loking for it....But this is a good start for me. Thank you again.
Title: Re: zip files with autolisp
Post by: JohnK on January 22, 2009, 02:51:16 PM
Question:
Do you know Autolisp?
Title: Re: zip files with autolisp
Post by: Fishing4Lsp on January 22, 2009, 03:20:16 PM
Yes..A little more than basic. In a scale of 1 to 10. I think I'm a 5.
Title: Re: zip files with autolisp
Post by: deegeecees on January 22, 2009, 03:23:35 PM
I tried it as well and no go.
Title: Re: zip files with autolisp
Post by: JohnK on January 22, 2009, 03:43:15 PM
Yes..A little more than basic. In a scale of 1 to 10. I think I'm a 5.
good.

zip goes the current projects dir
zip-d goes to a dir of your choosing
zip-f ditto

Now if you issued the `zip' command its working on the current drawings directory. here's the problem with that one...well more like `7zip's' problem; If your in the drawing then 7z can not archive it -- it skips that drawing and any drawing anyone else is in-.  I recommend either the `zip-d' or `zip-f' functions.

With all that said; those functions are meant as a ``examples''. Their just quick hacks (that whole lisp file prolly took me 20 min to create).

We can roll a better one if you want.
Title: Re: zip files with autolisp
Post by: JohnK on January 22, 2009, 03:43:39 PM
I tried it as well and no go.

read the readme
Title: Re: zip files with autolisp
Post by: deegeecees on January 22, 2009, 03:47:13 PM
Quote
zip goes the current projects dir
zip-d goes to a dir of your choosing
zip-f ditto

Now if you issued the `zip' command its working on the current drawings directory. here's the problem with that one...well more like `7zip's' problem; If your in the drawing then 7z can not archive it -- it skips that drawing and any drawing anyone else is in-.  I recommend either the `zip-d' or `zip-f' functions.

That cleared things up for me. Thanks se8en.
Title: Re: zip files with autolisp
Post by: Fishing4Lsp on January 22, 2009, 04:08:45 PM
Se7en,

Yeah...That clear up things for me too. I'm okay with this for now.

Actually I was gearing more into interfacing with other applications.
I was hoping for an example like...(vlax-create-object "Winzip.Application").
I'm not even sure if its possible.
Title: Re: zip files with autolisp
Post by: JohnK on January 22, 2009, 04:35:45 PM
I seriously doubt it. You could attempt to use the built in windows one but your on your own with that one.

May i ask why? I mean there are plenty of great command line file archivers out there --7zip is a great example-.
Title: Re: zip files with autolisp
Post by: Fishing4Lsp on January 22, 2009, 05:29:47 PM
Se7en,

No special reason. I thought it could be done. (Thats why I'm a "5"). The more
examples, the more I learn.

But dont get me wrong. I'm going to treasure and use this little utility. Are you
kidding. It's a great find for me...Thank you again!
Title: Re: zip files with autolisp
Post by: JohnK on January 22, 2009, 05:50:51 PM
No problem guys; I get an idea and i just write it down as quick as i can so i can share it with theswamp.