Started by Peter2 ·
2016-11-06 16:45 UTC ·
9 replies · SMF topic #2445
Peter2
2016-11-06 16:45 UTC
Usually I open an ODCL with Editor and click "Save as LSP" to create a Lisp-file which can be integrated into the main-Lisp-code.
Is it possible to do it with command-line, without opening the Editor?
Peter
marcoheuer
2016-11-07 08:56 UTC
hello peter,
with "dcl-Project-SaveAs".
best regards
marco
owenwengerd
2016-11-07 16:53 UTC
author=Peter2 link=topic=2445.msg12196#msg12196 date=1478450748 wrote:
Is it possible to do it with command-line, without opening the Editor?
You mean, by specifying a command line argument to Studio it should insert the specified Lisp file name into a new project? That's not currently possible, but it's a good idea.
Peter2
2016-11-09 16:09 UTC
Hi
thanks for comments, but I'm searching in another direction.
We have many LSP and many ODCL, and I think that the solution like shown in "Samples", DistSample1.lsp and DistSample1.prv is good for us.
The only question is now (see above): How to "convert" many ODCL-files to odcl.lsp-files?
If there was a command line like
OpenDCL Studio.exe /in "my.odcl" /out "my.odcl.lsp"
I could create a batch and "convert" them without problems.
Owens idea is rather the same, just from odcl.lsp to ODCL ...
marcoheuer
2016-11-10 08:04 UTC
(setq path "e:\\MyProgram\\")
(odcl->lsp path)
(defun odcl->lsp (path)
(mapcar
'(lambda(filename)
(dcl_project_load (strcat path (vl-filename-base filename)) T)
(if (not (dcl_Project_SaveAs (vl-filename-base filename) (strcat path filename ".lsp")))
(print (strcat "Error: " filename))
)
)
(vl-directory-files path "*.odcl")
)
)
Peter2
2016-11-10 08:35 UTC
Hi Marco
thanks for the code - it does exactly what I want, but it does it with Lisp and therefore inside AutoCAD. :)
If it could be done (sometimes) with Editor and without AutoCAD, it would be perfect.
owenwengerd
2016-11-20 04:33 UTC
What you want is a way to automate opening and saving an .odcl project by script. The OpenDCL Studio IDE is interactive by design, but I suppose there could be some separate command line conversion tool for this purpose. AutoLISP is a proven and familiar way to script just about anything, so I'd say it's a pretty good solution in any case.
Peter2
2016-11-20 11:03 UTC
author=owenwengerd link=topic=2445.msg12244#msg12244 date=1479616384 wrote:
... but I suppose there could be some separate command line conversion tool for this purpose....
So do you mean the feature could be added some time to Studio - or not?
owenwengerd
2016-11-20 15:47 UTC
OpenDCL Studio is interactive by design, but you want something that is _not_ interactive. Therefore, it is not an appropriate feature for OpenDCL Studio. I hope that clarifies.
Peter2
2016-11-20 17:40 UTC
Thanks Owen, now it's clear.