Stick non-sticky: install AutoCAD-a plugins on GStarCAD

    Hello.
    The article is a little spontaneous, but I hope this information is useful. I came across such an opportunity in moderation by accident, but it seemed to me useful, so I want to share an observation.
    It's about trying to install plugins from one CAD system to another. How and why this was done, and also what came of it (and what did not work) - under the cut.



    Let's start with the question “Why?”.
    But why:
    Autocad is a recognized leader in the CAD market for small and medium-sized businesses. Everything would be fine, but the company does not have a very user-friendly pricing policy, which, together with the difficult economic situation, helps to search (and find) alternatives. In fact, there are quite a few of them, inexpensive, and sometimes even free: from Nanocad to Bricscad , GstarCad and ZWcad , which, incidentally, fell slightly under the distribution from Autodesk. The trouble is that any transition from one tool to another requires getting used to, and sometimes even learning.
    Fortunately, manufacturers of alternative CAD systems strive to get as close as possible to the standards set by the flagship, and, admittedly, they often succeed. Both in functional terms and in the context of the interface, there are not many differences at all, so you definitely won’t have to relearn. But there is a hitch: in the process of work, the designer usually collects his “personal” set of tools, such as plug-ins, scripts and other auxiliary trifles, without which it is already difficult to work quickly and habitually. Moreover, advanced CAD systems allow you to create your own programs that perform one or another desired function.
    So, we will talk about the use of such tools in a "foreign" environment. Specifically, let's try to use plugins for AutoCAD in the GStarcad environment. I have a strong suspicion that the same story will be with other programs, but for now we will consider this particular couple.

    It's time to answer the question "how?".
    Here's how:
    Many CAD systems support programming languages. One of these languages ​​is Lisp , more precisely, its dialect: AutoLISP ( Wiki - English, Вікі - укр).
    There are many programs written for AutoCAD in Lisp. Here are some useful links:
    application LISP programs;
    service LISP programs;
    excellent selection of custom programs
    Naturally, all this (and much more) is easily found on the Internet.
    It is with Lisp plugins that porting is the easiest. Actually, no porting is required.
    Just open Gstarcad, execute the appload command on the command line and click on the “Load” button in the opened plug-in connection window.
    image
    Find the .lsp file that contains the Lisp code and attach it.
    Pay attention to the format of files that can be connected as plugins (framed on the screen).
    image
    CAD will report that the plug-in is successfully connected, and with which command you can access it.
    For example, we use a plugin that helps to select an arc on a circle when it intersects with other objects.
    image
    The process of working with the plugin is displayed on the command line.
    Such a connection activates the plugin for one working session. If you need it permanently, you can add it to the "startup" program by clicking on the "Contens" button or the "StartUp suite" icon and select the desired plug-in through the dialog that appears.

    I could not repeat a similar trick for VBA.
    Information for those who can program in .NET. Quote from an article comparing Autocad and ZWcad:
    ...

    First of all, you need to install .NET version 4.0 and replace all the links to the AcMgd.dll and AcDbMgd.dll files with the corresponding versions of these files for ZWCAD +. Naturally, this is not difficult. Next, you need to change the namespace accordingly. For example, my utility was written in VB.NET, and it was necessary to make the following changes to the list of imports at the beginning of the program code:
    image

    The project had several more similar points that needed to be adjusted, but, again, all these were just modifications of the namespace, as in the case shown above. Incredibly, in addition to these, very minor changes, nothing else needed to be done. All the properties and methods that I used in the original AutoCAD API seem to have valid equivalent equivalents in ZWCAD +, since there were no errors in the IDE.
    ...

    This excerpt leads to the idea that VBA and C # projects can also be ported, but still making some, albeit small, efforts.

    Having become interested in the issue, I found out that many serious add-on programs (their language doesn’t even turn into plug-ins), for example CadProfi , support “alternative” CAD systems.

    In general, I conclude that it is possible to use the auxiliary software developed for Autocad a on “alternative” CAD systems, and this may turn out to be even easier than it seems at first glance.
    In addition, I ask those who are in the subject or have experience in such experiments to comment on the article, because I personally do not work professionally with CAD systems, so I could have missed some important point.

    Also popular now: