Author Topic: create a VLX from Lisp  (Read 813 times)

0 Members and 1 Guest are viewing this topic.

domenicomaria

  • Swamp Rat
  • Posts: 725
create a VLX from Lisp
« on: February 01, 2024, 04:04:01 AM »
Is it possible to create a VLX from Lisp?

not a FAS, ... but a VLX !

didier

  • Newt
  • Posts: 48
  • expatrié
Re: create a VLX from Lisp
« Reply #1 on: February 01, 2024, 07:35:22 AM »
Bonjour

When you pass by "create an application" the two types of files are created simultaneously, FAS and VLX.
It is not the case on your computer ??

Amicalement
eternal beginner ...
my english is not fluent ...

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: create a VLX from Lisp
« Reply #2 on: February 01, 2024, 07:52:30 AM »
I want bypass "create an application"
using a vlisp instruction
...
Is my question not clear?

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine

dexus

  • Bull Frog
  • Posts: 208
Re: create a VLX from Lisp
« Reply #4 on: February 01, 2024, 10:45:19 AM »
https://www.theswamp.org/index.php?topic=58097.msg613328#msg613328
I'm still confused about what that code actually does.
Did you manage to use it VovKa?

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: create a VLX from Lisp
« Reply #5 on: February 01, 2024, 10:49:04 AM »
https://www.theswamp.org/index.php?topic=58097.msg613328#msg613328

thanks vovka

I downloaded the files
but I can't get them to work

the GML command asks me for a FAS file
and then it gives me an error...

... in Chinese ! ! !

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: create a VLX from Lisp
« Reply #6 on: February 01, 2024, 11:29:23 AM »
vlx is just a container
if you compare both files side by side you'll see that vlx = header + fas(s) + footer
for me baitang's code looks overcomplicated
i'd use MP's _WriteStream (or smth alike) function to write header and footer into two separate files then just repeat (vl-file-copy src dst t) to join them with fas(s)

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: create a VLX from Lisp
« Reply #7 on: February 01, 2024, 12:23:07 PM »
vlx is just a container
if you compare both files side by side you'll see that vlx = header + fas(s) + footer
for me baitang's code looks overcomplicated
i'd use MP's _WriteStream (or smth alike) function to write header and footer into two separate files then just repeat (vl-file-copy src dst t) to join them with fas(s)

MP's _WriteStream where is it?

And can you share an example?


ronjonp

  • Needs a day job
  • Posts: 7529

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC


BIGAL

  • Swamp Rat
  • Posts: 1417
  • 40 + years of using Autocad
Re: create a VLX from Lisp
« Reply #10 on: February 01, 2024, 07:43:52 PM »
You can create fas for multiple files have not tried to make a VLX but should be similar approach, will try to do.

Code: [Select]
; must have vlide open to work
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "Vlide ")
(setq loads (list "Lisp1" "Lisp2" "Lisp3"))
(setq loc1 "F:\\") ;;change dirs to where ever you want them saved
(setq loc2 "F:\\Compiled Lisp\\")
(foreach lisp loads
(vlisp-compile 'st (strcat loc1 lisp ".lsp") (strcat loc2 lisp ".fas"))
)

A man who never made a mistake never made anything

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: create a VLX from Lisp
« Reply #11 on: February 01, 2024, 10:21:29 PM »
You can create fas for multiple files have not tried to make a VLX but should be similar approach, will try to do.

Code: [Select]
; must have vlide open to work
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "Vlide ")
(setq loads (list "Lisp1" "Lisp2" "Lisp3"))
(setq loc1 "F:\\") ;;change dirs to where ever you want them saved
(setq loc2 "F:\\Compiled Lisp\\")
(foreach lisp loads
(vlisp-compile 'st (strcat loc1 lisp ".lsp") (strcat loc2 lisp ".fas"))
)

Creating multiple FAS files from multiple LSP files is easy
with vlisp-compile (or vlisp-compile-lst ?)

the problem is how to assemble them into a single VLX file

vovka says that FAS and VLX files are very similar
and that you just need to add the header and footer to the VLX
vlx = header + fas(s) + footer

has anyone done it?

and what is the header like?
and how is the footer?

and do we need to put something between the fas files ?

kozmos

  • Newt
  • Posts: 114
Re: create a VLX from Lisp
« Reply #12 on: February 02, 2024, 04:05:11 AM »
If the VLX only has only one FAS, then it is easier to pack the FAS into VLX by adding simple header and footer, however, when you have multiple FAS files or DCL or other resource files need to be packed in VLX, I didn't see any way to do it programmingly. On AutoCAD 2021+, you may try using makelispapp command to get vlx from prv but in lower version, there is no way but VLIDE's menu.
KozMos Inc.

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: create a VLX from Lisp
« Reply #13 on: February 02, 2024, 05:22:46 AM »
and what is the header like?
and how is the footer?
just open vlx and side by side
https://imgur.com/Kj68V0N
and do we need to put something between the fas files ?
when vlide creates vlx it also puts file name and its length before every fas, but we can skip this and pretend we have only one fas inside vlx.
we will specify the total size before the first file only