Repository navigation
Autolisp plugin (in progress) #1799
Replies: 16 comments 24 replies
|
Hola @yztink justo lo había comentado en otra discusión y recién encontré esto que estas haciendo. Avisame si puedo ayudarte de alguna manera. |
|
Nice. An AutoLISP layer is one of the most requested things. A few pointers for when you wire it to the host:
|
|
We may include it in the OCS when it gets mature |
|
Hello. I’ve attached a simple AutoLISP routine for AutoCAD; let’s see if we can get it to work within OpenCAD Studio. |
|
Attached a few LISP's for testing |
|
thanks for the real examples. I wasn't sure how much the vl* routines were actually used (the answer seems to be "a lot!") Those will be interesting to implement since most cad systems are for Windows and use com and activeX. But we need linux and mac-friendly ways of accomplishing those. Anyway, these are really good to test against. @ketonik I see your example uses dcl, I also was unsure how much of that was used. I'm curious, if you were able to push a button for a one-time translation of the dcl into something else, would that work for you? I've been working on a lispy way to do gui stuff in OCS to avoid dcl and i think it's pretty cool. |
|
Hi @yztink, Hakan pointed LISP routines to this thread (from #977), so here is what ours look like. I make two batch tools for AutoCAD users: Hurricane (runs scripts and LISP over hundreds of drawings) and Tornado (scans folders of drawings into a report). I can't post the routines themselves, but here is the LISP they depend on, in case it helps you pick what to cover first. Batch editing routines (run unattended, one drawing after another from a .scr)
Read-only scanning routines (Tornado, run in AutoCAD's headless console)
When you have a build to try, I'm happy to run it against these routines on a set of real drawings and report what breaks, with small repros. |
|
yztink, Good job... |
|
Hi @yztink, I have a set of production AutoLISP routines (blocks/attributes, Could you push your work-in-progress to a public branch or a draft PR, even if it isn't ready? I'd build it locally, run my routines, and report what breaks as minimal synthetic repros (issues), and send PRs for fixes where I can. Happy to wait for the |
|
When i set out to make the autolisp interpreter it's because i saw the need and i have familiarity with programming in that language. The start was super encouraging and seemed to be off to a quick start. As i dug deeper, i tested SSGET with the :L filter and found that OCS lacked a way through the plugin api to get info on if a layer was locked, so of course put in a PR that added that to OCS. That was the first hurdle. I found quite a few other things that were needed for true autolisp compatibility, but perhaps not for automation in general. I wanted to create an ide (screenshot above) and it's working really great. It has some quality of life features like auto-complete, and a way to see what function parameters are needed right on the same screen. it has debugging, breakpoints, watch lists, and stepping. I wanted to keep a similar feel to the ide and used iced like OCS, but I ran into some limitations with it, however I wrangled it enough that it seems to work fine for the editor now. I also found that vibe coding what is essentially a complete app does take someone with a lot more free time than i have or with a better agent than I'm able to use. What i have time for is better suited to finding a bug, working on it and submitting a PR, not a whole app. I never liked DCL so i wanted something I liked better. I have implemented a lispy way to create modal gui dialog boxes, and a way to construct custom panels all from lisp. As such i never planned to support DCL directly, but since i know people have DCL they want to use, I was going to create a one-time translator that would translate the DCL into this lispy way. (i'm sure someone could add direct DCL support if they desired) i'll tell you right now, a bunch of PR's or issues will be beyond my available time. What you will find is that basic things will probably run, but vla* and vlax probably won't and many other odd bugs due to interoperability with it and OCS. Plugin and IDE: https://github.com/yztink/opencad-autolisp-and-ide |
RUTINA LISP PARA UN SLICE DE OBJETOS 3DVeo que SLICE aun no esta implementado en el programa y dependo mucho de ese comando, investigue con Gemini IA para implementarlo via LISP neutro para Open Cad y me dio respuestas, lo anexo en archivo de texto para que lo analices, espero funcione. |
Rutina de arquitectura para hacer un grid de ejes, burbujas y cotasEste es una rutina que uso mucho para hacer una reticula de ejes con dimensiones y burbujas para estructurar proyectos de arquitectura, desde luego que hay que mejorarlo por que tengo que editar algunas cosas manualmente. las crujias de ejes (distancias) son variables y se ajustan perfectamente a edificios con columnas y muros regulares, como a edificios con entre ejes variables. ;) |
Estiramiento 3DHola, te paso una rutina lisp que uso mucho, es un estiramiento 3d, donde puedes hacer un estiramiento a sólidos regulares en lo individual o en grupo. :) espero te sirva. |
|
@martineztorresjosejuan-bit gracias por compartir las rutinas. Generated by Claude Code |
|
Honestly, I'd be fine with just an interpreter, and use Visual Studio Code for editing, but that's just my opinion. There are LISP linters and syntax checkers in the marketplace, so spending a lot of time on an IDE might be reinventing a wheel. Again, just my opinion. I would love to dive back into LISP after publishing a few books on the subject (when I was full-time CAD many years ago). I miss it. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I am working on a rust-based autolisp interpreter and IDE. I have now released an extreme alpha version.
I plan to make it as fully backward compatible with existing autolisp and visual lisp scripts as possible. I do not recommend it for ANY production files. That being said, if you try it and a script fails, please let me know which function doesn't work as it should.
Disclaimer, I have not tested it on Linux or macos and again do not recommend it for any production files. In OCS you can go to the plugin area and paste this repo path into the bottom and add it that way. https://github.com/yztink/opencad-autolisp-and-ide
Once installed, you can load scripts with APPLOAD or by placing them in the appdata/roaming/opencadstudio/scripts folder.
[Edit] A quick clip showing it running MUV, posted by @javierguidetto Thanks!
test vid.webm
(Ignore that the title bar says python. I pivoted and hadn't changed that yet)

All reactions