Category Archives: LISP

How to obtain a digital signature to sign your LISP files

In an earlier post, I explained why you might want to digitally sign your LISP files. If you decide to go ahead with that, then this post explains how you can obtain and install the digital signature you will need to sign your files. This is the most difficult part of the process and it involves spending money.

Getting a digital signature

Although you can make your own digital signature (there’s an Autodesk Knowledgebase article describing the process), there’s little point in doing this. You can sign your files, sure, but that signature won’t be seen as trusted by software that checks for it. Anybody can create a signature like that, including one that impersonates you, and it doesn’t prove anything. The only purpose for such a home-made signature would be to test the methods you’ll be using to apply a proper trusted signature later.

Edit: if you do want to make your own signature, BlackBox informs me that the MakeCert tool in the Windows SDK mentioned in the Knowledgebase article is deprecated. He suggests using this PowerShell Cmdlet instead.

You’re going to need a signature that is trusted. That means you’re going to have to pay somebody trustworthy to trust you. There are a set of certifying authorities, trusted by Microsoft, Autodesk, etc. who can issue code signing certificates to companies and people. You need to prove who you are to one of those authorities and pay them to certify that you are who you say you are. So before you start, make sure you or your business are visible in terms of directory listings, publicly visible phone numbers, etc. If you are representing a company asking for a certificate, you can expect to be asked to produce evidence that you really represent that company. You can expect to confirm that your email and phone number are really under your control.

You only need to do this once a year, or even once every several years if you pay in advance. You might find that the evidence you need to provide changes at renewal time; for example a Yellow Pages listing that was OK in 2015 was no longer accepted when I renewed in 2017, so I had to register my business with another listing.

In my search for a certifying authority, I found that K Software, a reseller for Comodo, was the cheapest source for a code signing certificate, see here. An OV certificate will be fine for signing LISP.

K Software takes your money (USD $67 to $84 a year depending on the length of time you need), gets Comodo to provide the certificate, and provides a handy tool (KSign) that allows you to simply apply the certificate to various files without some of the messing about that’s otherwise required. It’s not useful for LISP files, though. Comodo also provides the support, and I’m happy to report that in my experience their customer service is excellent.

Note: it’s important that you pay close attention to the instructions when applying for your certificate. For example, the browser you use to apply for the certificate is vital. Choose one that’s suggested (e.g. Firefox) and which you expect to use later to obtain the certificate.

Installing a digital signature

Once your evidence is accepted and your payment has gone through, you will be sent an email with a special code, allowing you to obtain the certificate. It’s important that you’re using the same browser on the same computer that you used when applying for the certificate.

Once you click the link and obtain the certificate, you’ll want to export it. In Firefox 58.0, use Options > Privacy & Security and scroll to the bottom to see View Certificates. Select the certificate and pick Export. This will create a .P12 file that you can back up and install on this or another computer. To install the certificate, double-click the .P12 file and follow the prompts to assign it to the current user in the default location (Personal).

That’s it. You should now have a certificate installed that you will be able to use to sign LISP and other files. To check this, start the Windows Certificate Manager (C:\Windows\System32\certmgr.msc). Have a look in Current User > Personal > Certificates and you should find your newly installed certificate.

The next post in this series will explain how to apply this digital signature to your LISP files. That’s the easy bit.

Why digitally sign your LISP files?

After I mentioned in an earlier post that I had digitally signed the sample LISP file I had provided, this generated some interest. In this post, I’ll explain why you might want to sign your LISP files. In a later post, I’ll explain how to do it.

These days it is standard practice for developers to digitally sign their code. Operating systems and applications are displaying increasingly scary warnings when coming across unsigned code. Here is an example of the sort of message you get when you load an unsigned LISP file into AutoCAD from a location that has not been explicitly configured as a trusted location:

If you’re a CAD Manager dealing with your own internal code, it’s not too onerous to configure AutoCAD in Options > Files such that a folder is trusted by AutoCAD and place your code in there. The folder should be read-only; if it isn’t, AutoCAD warns you when you try to configure it. If you do this, the scary warnings don’t appear to bother and confuse your users, even if your code is unsigned.

Another way a CAD Manager can avoid the warnings is to set the SECURELOAD system variable to 0. That’s generally not recommended because it turns off AutoCAD’s security features. While you’ll probably get away with this, there’s always a chance that a user will load some malware and then you’ll have to explain yourself to management.

If you’re not just using your code internally and it’s going to be used by other parties, then you’re not going to have that level of control over the user environment. In recent AutoCADs it’s possible to set up the installation deployment such that users can’t turn off the security settings. If the CAD Manager at the location using your code has done this, your potential users are going to be presented with unprofessional-looking scary warnings.

If you sign your code, users might still get a warning, but it’s less scary. It identifies you as the verified source of the code so they will have more confidence in picking the Always Load button. Once they’ve done this, other signed code of yours will be automatically trusted.

There’s another important reason you might want to sign your code, and that’s protection against other people’s modification of your code. If somebody edits your LSP file and then gives it to someone who tries to load it, the user is presented with an even scarier warning:

Note that this warning no longer has your name on it. This means it’s possible to protect yourself from people (internal or external) who well-meaningly hack about with your code and then try to blame you when it goes wrong. It also gives a level of protection against your code being infected by malware.

Note that all of the above only applies to AutoCAD 2016 and later. AutoCAD 2014 introduced some LISP loading security measures, but the signature stuff came a couple of releases later. Earlier AutoCAD releases, along with compatibles such as BricsCAD and ZWCAD, will just ignore the digital signature. It’s just a comment in the code as far as they’re concerned.

LISP files with the LSP, MNL, FAS, or VLX file extensions can be digitally signed. There’s a bug in the original iterations of AutoCAD 2016 and AutoCAD 2018 that prevents signed VLX files from working. This was patched later in both releases (2016 SP1 and 2018.0.2), but if you’re distributing your code externally there’s always a chance that your VLX might end up in the hands of somebody using a broken release. Also, VLX files that are digitally signed cannot be loaded into AutoCAD 2015 and earlier, broken or not. You should bear that in mind before distributing signed VLX files. I don’t do it and would advise against it. Thanks, Autodesk.

Given this information, if you decide that signing your LISP is a good idea, watch this space for information on how to do it.

Setting your application or document window size using LISP

I intend to produce a few videos containing tips, tutorials, product comparisons and the like. I’ve set up a cad nauseam YouTube channel, but don’t bother visiting it yet because it’s empty.

One of the things I need to do for these videos make sure I’m capturing the screen at an appropriate resolution. I knocked up a bit of Visual LISP to take care of this task quickly and accurately, and you might as well have it. It’s a simple routine that allows you to accurately size either the main AutoCAD application window or the current document window (drawing area) within the main window.

The file is WindowSize.lsp. It should work in all full AutoCAD releases (not counting LT and AutoCAD for Mac) and AutoCAD-based verticals from 2000 on.

It works in recent BricsCAD releases (except the free and LISPless BricsCAD Shape). I’ve only tested it in Windows, but it should also work in the Mac and Linux versions due to the high degree of LISP compatibility provided even across platforms. It also works in ZWCAD 2018 for the main application window, but don’t use it on the document window because that doesn’t work.

Download it, put it in a location of your choice and load it into your CAD application (for example by dragging and dropping it from Explorer onto the drawing window).

Note: In AutoCAD 2014 and later, loading any LISP or other executable file may result in a warning depending on the release, the security settings, whether the file is located in one of AutoCAD’s trusted locations, and whether the file is digitally signed. I’ve digitally signed the file to reduce the incidence of warnings, but you could still see something like this:

The verified publisher should be cad nauseam as shown above. If you pick Always Load then you shouldn’t see the warning again for this file or any others signed by cad nauseam. Feel free to edit the file for your own needs, but if you do the signature will become invalid and you’ll be warned again when loading the file.

Once it’s loaded, enter the command WindowSize. The prompt sequence goes like this:

Command: WINDOWSIZE
Window to size [Application/Document] :
Width in pixels <1280>:
Height in pixels <720>:

Now, back to work on the first of those videos.

BricsCAD’s LISP kicks sand in the face of AutoCAD’s

If you’re a power user or CAD Manager transitioning from AutoCAD to BricsCAD, one of the things you’ll like is that almost all of your LISP routines will just work. That’s not an statement that can be made about various Autodesk products that bear the AutoCAD name, such as AutoCAD 360, AutoCAD LT and AutoCAD for Mac.

It’s not just simple old AutoLISP code that runs in BricsCAD, but complex dialog routines that use DCL, and Visual LISP stuff that uses ActiveX. Yes, even on the Mac and Linux platforms. Some DOSLib functions are built in and the rest can be loaded, as with AutoCAD. Even OpenDCL is supported. It’s a quite astonishingly high level of compatibility.

But it’s not 100%. There are minor incompatibilities, system variable and command-line differences that cause problems in a handful of cases. It’s often possible to work around these and still retain the same code that works in both AutoCAD and BricsCAD. Reporting LISP bugs and incompatibilities to Bricsys generally gets them fixed super-quick.

Also super-quick is the speed at which your code will run. It’s immediately noticeable when running any LISP code that needs to do a bit of processing that it just gets done faster in BricsCAD than AutoCAD. Fast enough to extract the following comment from one of my AutoCAD users trying out a linework cleanup routine in BricsCAD:

Wow.

 
User impressions are one thing, but how about measurements? Today, I had a support job to do that involved running one of my LISP routines. I ran it on both AutoCAD 2017 and BricsCAD V17 on the same PC. AutoCAD took 2970 seconds (about 49 minutes), BricsCAD 1030 seconds (about 17 minutes). Over half an hour saved on one operation. That’s 2.88 times faster, which is consistent with my previous observations with a variety of routines.

Upshot: if you’re doing work where there’s a lot of LISP processing going on, switching to BricsCAD is going to save you a shedload of time.

There is a downside to BricsCAD’s LISP, and it’s a big one; no VLIDE. No equivalent, either. There are various programming editors around that can help with editing code, but no substitute for integrated debugging. It means if you’re a power user, CAD Manager, developer or support person, you’re probably going to have to keep one working copy of AutoCAD around even after you’ve completed the transition to BricsCAD.

Because VLIDE has been in maintenance mode for over 15 years it remains virtually unchanged year after year (including ancient bugs). So it doesn’t matter that much which AutoCAD release you have hanging around. Assuming you’re a perpetual license holder, when you drop the maintenance contract on one of your AutoCAD licenses, you’re entitled to keep using the software as long as you wish, albeit only the current release at the time the contract ends. How long the software will keep working is another matter, depending as it does on factors not entirely within your control.

This is an imperfect solution. Even keeping a copy of AutoCAD around won’t help much if you’re debugging a problem caused by something specific to BricsCAD. Filling the VLIDE hole is something Bricsys needs to work on.

BricsCAD startup LISP bug fixed

In my previous post I have a real problem with BricsCAD, I related my then-latest interaction with the Bricsys support system:

Steve Johnson
05-12-2016 05:30 UTC

I don’t know if this is a BricsCAD problem or a DOSLib one, so I am reporting it to both Bricsys and Dale at McNeel. I’m also not sure if this was happening in earlier versions.

If I load DOSLib during an S::STARTUP call and then use the (dos_msgbox) function later in that call, this fails the first time round because BricsCAD things the function is not defined. Opening a second drawing results in the call working as expected. I’ve chopped down our startup routine so you have an example.

; error : no function definition ; expected FUNCTION at [eval]

Awesome Bricsys Person
05-12-2016 12:32 UTC

Hi Steve,

There was a regression introduced in V17.1.10 that caused startup code to execute too early under certain conditions, before the lisp engine document context was properly initialized. This has been fixed now for the next update.

Steve Johnson
06-12-2016 02:43 UTC

I must say, the responses I’ve been getting to my support requests have been absolutely bloody brilliant. Cheers!

Let’s just finish the sequence, shall we?

Second Excellent Bricsys Person
13-12-2016 19:18 UTC

Hi Steve,

I have very good news. The fix is included in BricsCAD V17.1.11, available for download.
Thank you for your help.

Following a fast and straightforward download and install, I can confirm that the bug is fixed. The elapsed time from my bug report to the fix being publicly available and me being informed personally of the fact was 8.5 days. Note that this isn’t a workaround, patch or service pack, it’s a permanent fix that is now automatically in place for everybody who downloads the software.

Edit: the new version was actually released at 4 PM on 9 December, so it was less than 4.5 days from report to fix. Outstanding!

I should mention that I also received a prompt and relevant response from Dale at McNeel, despite the fact that the problem was nothing to do with him!

For somebody used to dealing with Autodesk, this is a breath of fresh air. Bricsys team, take a bow!

So what’s actually new in BricsCAD V17?

A big problem I have in communicating the improvements to BricsCAD in V17 is that there are such a huge number of them. This isn’t an AutoCAD 201x-style touch-up masquerading as serious progress, this is a real  upgrade. You know, an AutoCAD V12-style upgrade that veteran AutoCAD users will remember from the good old days before Autodesk got bored and distracted. Dozens upon dozens of new features, improvements to existing features, performance improvements and bug fixes. Lots of stuff that’s genuinely useful.

I could write three posts a week on the changes and not be finished by this time next year. So I’m going to be lazy. I’ll pick out a few features for future posts but for the big picture I’ll point you to the official list. This isn’t a marketing document, it’s a technical list of terse descriptions of changes (to the Windows version only – remember BricsCAD supports Mac and Linux too), and it’s large. To give you some idea of the scale of changes, there are 3,200 words describing new V17 features, for example:

DMDISTANCE3D Specific measuring modes for cylinders, circles, and spheres have been introduced. Distance can be specified between boundaries (nearest points), central points or axes of the corresponding geometries.

 
There are 1,600 words describing improvements, such as:

IMAGEATTACH Multiple selection of images from a single folder is supported now so multiple images can be attached in one go. This is especially useful for images with geo-information attached.

 
There are 1,450 words describing fixes, like:

MATCHPROP When the source entity was non-annotative and the target annotative, the target undesiredly remained annotative.

 
There are 1,100 words describing API changes and fixes, e.g.:

BRX/LISP/SDS wcmatch() now supports the (undocumented) space character as a pattern key to match any contiguous sequence of whitespace characters (space, tab)

 
That last one is a fix for a bug that I reported in V16. Within ten days of submitting my report, I was informed directly by the developer that the fix had been done and would be available in V17. Here’s another one of mine:

BRX/LISP Improved sds_getFiled() / (getfiled) behavior during a Save operation when default filename argument is empty.

 
Elapsed time between my report and acknowledgement by the developer that a fix would be forthcoming? Just under 12 hours. Less than 3.5 hours after that, I was informed that the fix had been implemented. Hands up all those people who have had similar experiences with Autodesk?

Any BricsCAD users out there? v.2016

Back in 2010 I asked the question Any BricsCAD users out there? and there were a few of you who had tried to replace AutoCAD with BricsCAD. Most who responded had made the change successfully, others not so much.

Six years on, the situation is different. The fact that you can’t buy a permanent AutoCAD license any more has prompted some Autodesk customers to look more seriously at alternative vendors who do provide that option. Bricsys is one of those vendors, and their DWG-based AutoCAD alternative BricsCAD has improved way more rapidly than AutoCAD over the same time period. No, that isn’t a guess, I’ve been keeping an active eye on things. BricsCAD today is by no means perfect, but it’s impressive in many ways. LISP compatibility and performance are excellent, for example. BricsCAD v16 superior to the also imperfect AutoCAD 2017 in several areas, despite the total cost of ownership being significantly lower.

Here’s the question I asked back then:

I would be very interested to hear from any of you who have adopted BricsCAD (either partially or fully replacing AutoCAD or AutoCAD LT in your organisation), or at least seriously investigated using the product.
 
Why did you investigate changing over? How far have you gone? What are your experiences? What are the pros and cons? How is performance? Reliability? Bugs? Ease of use? Familiarity? Support and other aspects of customer service? Total cost of ownership? Are you experiencing interoperability problems when exchanging drawings with Autodesk software users? How did you go with incorporating in-house customisation and third party tools?

How would you answer that question today? Would you be interested in me providing more posts about BriscCAD, such as practical experiences with attempting a transition from AutoCAD?

Shout out to Robert McNeel & Associates

Let’s start the rebirth of this blog on a positive note. I’d like to express my gratitude to Robert McNeel & Associates for what must surely be the most outstanding example of long-term customer service in the CAD industry.

These days, McNeel is best known for the 3D modelling software Rhino. I have heard good things about this product, but have never used it. However, I am a long-term user of another McNeel product, DOSLib. This is an extensive set of functions that adds greatly to the functionality of AutoLISP. It all works very well and has saved me many hours of work that I would have spent reproducing that functionality. Of course, many LISP programmers could write functions to calculate a cube root, or read a text file, or display a date in whatever format you like, or copy files, or generate a GUID, or toggle the Caps Lock status, or display an HTML file, or return a list of OLE objects in the drawing, or display a multi-select file dialog, or return a list of Windows printers, or a hundred other handy things. The point is, they don’t have to because all that has been done for them and handed over for nothing.

The documentation is straightforward and accurate, and is provided in the form of a good old-fashioned local CHM file. This Help system may be unfashionable, but it remains infinitely superior to the still-awful system that paying AutoCAD customers have had to put up with for the last few years.

For those investigating alternatives to AutoCAD for whatever reason, the availability of DOSLib for Bricscad may help make that particular alternative a more attractive proposition.

Despite McNeel and Autodesk breaking ties many years ago, McNeel’s Dale Fugier has continued to provide, maintain and improve DOSLib. What’s more, DOSLib has remained totally free of charge and ad-free throughout its history, which dates back to 1992! Sometimes, there really is such a thing as a free lunch.

So here’s a big raised glass to Dale and Robert McNeel. Thank you for the many years of outstanding customer service in exchange for nothing but good feelings. Long may you prosper!

Disclaimer: I have no pecuniary relationship with McNeel; no money has ever changed hands in either direction. This post is totally unsolicited; I hope it comes as a pleasant surprise to McNeel.

LISP programmers, have your say again

Autodesk wants your input again in its annual API survey. This used to be a closed survey for Autodesk Developer Network (ADN) members, but has been open to all for the last few years. If you do any AutoCAD-based development at all, I encourage you to take part. That includes those of us who do most of our development in LISP.

Here’s the direct link to the survey. As you can see if you click the link, there’s a lot of stuff in there that assumes you’re keen to get developing for AutoCAD WS. If you’re not quite so filled with Cloudy enthusiasm and would prefer Autodesk to expend its resources elsewhere (on fixing and improving Visual LISP, for example), please fill in the short survey and say so. It closes on 22 June, so you only have a week.

Why bother, when it’s obvious that Autodesk is determined to ignore to death its most popular API regardless of whatever anyone says or does? I’m not sure, really. Maybe I’m an eternal optimist. (Ha!) Maybe I just want them to at least feel slightly guilty about sticking their fingers in their ears and going “LALALALALA! NOT LISTENING! WE HAVE A VISION, NOT LISTENING! LALALALALA!”

The best feature ever added to AutoCAD is…

LISP. I have now closed the What are the best features ever added to AutoCAD? poll, and the winner is AutoLISP/Visual LISP, by a long, long way. I don’t always agree with the majority view expressed in the polls here, but in this case I wholeheartedly agree. Adding LISP was the biggest and best thing that ever happened to AutoCAD. Autodesk owes an enormous debt of gratitude to John Walker for incorporating the work of David Betz, who was of course standing on the shoulders of John McCarthy. It’s a crying shame that Autodesk has been so terribly neglectful of Visual LISP for over a decade.

Here are your top ten “best ever” AutoCAD features:

  • AutoLISP / Visual LISP (32%)
  • Paper / Model Space / Layouts (21%)
  • Xrefs (20%)
  • Copy / Paste between drawings (19%)
  • Dynamic Blocks (16%)
  • Object Snaps (15%)
  • Layer Visibility per Viewport (12%)
  • Undo (12%)
  • Grips (12%)
  • AutoSnap (9%)

Something interesting I noticed is the age of these features:

  • AutoLISP / Visual LISP – 1985 (significantly improved 1999)
  • Paper / Model Space / Layouts – 1990 (significantly improved 1999)
  • Xrefs – 1990
  • Copy / Paste between drawings – 1991
  • Dynamic Blocks – 2005
  • Object Snaps – 1984
  • Layer Visibility per Viewport – 1990 (improved 2008)
  • Undo – 1986
  • Grips – 1992
  • AutoSnap – 1992

The youngest feature here is 6 years old, the oldest is 27. The average top-ten AutoCAD feature is over 20 years old. What does that tell you?

(so (long (and (thanks (for (all (the (parentheses))))))))

A few days ago, John McCarthy died at the age of 84. He didn’t make a fortune selling gadgets, he just profoundly affected the world of computing. He will be remembered mainly as the father of LISP, without which it is quite possible that AutoCAD and Autodesk would not have survived beyond the 80s. However, his original thinking went well beyond the development of a language. For example, 50 years ago he came up with an idea that is very relevant to what we are actively discussing today:

In 1961, he was the first to publicly suggest (in a speech given to celebrate MIT’s centennial) that computer time-sharing technology might lead to a future in which computing power and even specific applications could be sold through the utility business model (like water or electricity). This idea of a computer or information utility was very popular in the late 1960s, but faded by the mid-1990s. However, since 2000, the idea has resurfaced in new forms (see application service provider, grid computing, and cloud computing.)

(Credit: Wikipedia)

Back to LISP, I still use John’s antique language today. It’s still the best language choice for the vast majority of the development I do. Thanks, John.

AutoCAD 2012 – Autoloader mechanism for plug-ins

One of the less obvious features introduced by AutoCAD 2012 is the Autoloader mechanism that has been provided to make installation of plug-ins (current standard Autodeskspeak for add-ons, apps, utilities, routines, etc.) easier for both developers and users. It may not be immediately obvious, but it’s a useful and important addition.

This mechanism has nothing to do with the AppLoad command, the Startup Suite, acad*.lsp, the (autoload) function or anything else that existed in earlier releases. This is completely new, it has not replaced or broken any of the existing loading mechanisms, and is, in short, A Good Thing. Developers don’t have to use it, but those who do, and their customers, will have certain advantages. I have used it for the ClassicArray loading mechanism, and I expect to see it used by more and more plug-ins over time. It works fine with all of the usual AutoCAD add-on APIs, including LISP.

User perspective
As a user, what this means is that for AutoCAD and related applications from 2012 on, there is a standard loading mechanism for plug-ins. The installation should be straightforward, with no multi-step processes to go through for different AutoCAD variants and releases. The result of the installation should automatically present itself in a standard way, with a short-lived welcome bubble, an extra panel in the new Plug-ins Ribbon tab, plus any other interface additions the developer wants to provide. If you subsequently install another AutoCAD variant or release, the plug-in will automatically appear in that variant with no further user action required, as long as that AutoCAD variant is supported by the plug-in.

Developer perspective
What this means for me as a developer is that I have much less to worry about in terms of installation. All that needs to be done to make the loading happen is for a folder full of ‘stuff’ to be copied into a certain location. (There are actually two possible locations, but more on that later).

In Betas of ClassicArray, I just provided the folder, plus instructions that asked the user to copy that folder into place. I could have simplified that further by providing batch files that did the copying. In the end, I created setup executables using the free Inno Setup utility, but that was a much easier job that it would have been if this Autoloader mechanism didn’t exist. I didn’t have to worry about discovering what releases were installed, deciphering Registry entries, creating user installaton scripts, or issuing instructions to users to edit files or mess with the AppLoad command. I don’t have to worry about what happens if the user subsequently installs another AutoCAD variant.

Of course, for developers who support releases prior to 2012, there is no less work to do than before, and some time needs to be spent to learn and implement the new mechanism. In the case of ClassicArray, that was not an issue because it’s only needed and supported in 2012. I expect this is one of those problems that will resolve itself over time as developers adopt the new mechanism.

The bundle folder
So what is this ‘stuff’ that needs copying into place? It’s called a bundle folder. It’s just a folder with a name that ends in .bundle (e.g. ClassicArray.bundle), and it typically contains the usual files needed to run your add-in, often tidied up within other folders. The only new thing that it needs to contain is a file called PackageContents.xml. That XML file is the key to the Autoloader mechanism. AutoCAD finds the file, reads it, and acts accordingly in terms of version support, loading program files, partial cuix files and so on.

Bundle folder location
So where does this folder with its XML file have to go? There are two possible locations. If you want the plug-in to be available to all users on the computer, you place it in the Autodesk\ApplicationPlugins folder underneath the system’s ProgramFiles folder. For example, ClassicArray usually gets put here:

C:\Program Files\Autodesk\ApplicationPlugins\ClassicArray.bundle

If you only want the plug-in to be loaded for the current user, it goes in the Autodesk\ApplicationPlugins folder underneath the system’s AppData folder instead, for example:

C:\Documents and Settings\[login]\Application Data\Roaming\Autodesk\ApplicationPlugins\ClassicArray.bundle

in XP or

C:\Users\[login]\AppData\Roaming\Autodesk\ApplicationPlugins\ClassicArray.bundle

in Windows 7.

Describing the contents of that all-important XML file is beyond the scope of this post, but I may do a follow-up post if there is enough interest. In either case, the reference material is available in the AutoCAD Help, under Help > Customization Guide > Introduction to Programming Interfaces > Install and Uninstall Plug-In Applications > PackageContents.xml Format.

Programmers, have your say

Autodesk wants your input in its annual API survey. What used to be a closed survey for Autodesk Developer Network (ADN) members has been open to all for the last couple of years, and if you do any Autodesk-based development at all I encourage you to take part. Yes, that includes those of us who do most of our development in LISP. In fact, I am especially keen to see LISP developers adequately represented in this survey.

This is a one-page survey and it doesn’t take long. The full list of API surveys is on Kean Walmsley’s Through the Interface blog. Most of you would be interested in the AutoCAD survey, so here’s a direct link to that.

Kean assures us that our feedback will not fall on deaf ears, although I have yet to see any evidence of that in terms of any change to Autodesk’s decade-long policy of total LISP neglect. I guess many of us gave up hope of any improvement years ago and can’t be bothered providing feedback any more. Please don’t give up. Fill in the survey and let Autodesk know you still exist.

CAD International interview on drcauto and other subjects

This morning I spoke with CAD International‘s Nigel Varley. Here is a paraphrased summary of the interview.

SJ: When did CAD International buy the drcauto intellectual property rights?
NV: About two weeks ago.

SJ: You are currently helping drcauto customers with authorisation codes, is that correct?
NV: Yes, masses of them. It’s taking up a lot of our peoples’ time.

SJ: Are you charging for this service?
NV: Not at present.

SJ: Do you intend to charge for this service in the future?
NV: Maybe. We may need to, both to pay for our time and to recoup our investment. I don’t particularly like the idea of annual renewals for software, so we may do something different in future.

SJ: If somebody wanted to buy drcauto products such as LT Toolkit now, could they do so?
NV: No, we’re still processing the materials we were given when we bought the rights. It wasn’t left in a well-organised state. I’m not sure if that was done deliberately or if it was just like that.

SJ: Do you have any plans to continue development of LT Toolkit or the other drcauto products?
NV: It’s too early to say at this time. I understand it doesn’t work right now with AutoCAD LT 2010 with Update 2 applied, or on 64-bit Windows, or on Windows 7. It’s not clear at this stage how much work is involved in making it work. It should be doable, but we can’t make any commitments at this stage.

SJ: So do you have a timeframe for doing any of this stuff?
NV: No, it’s too early. We’re still processing it.

SJ: What about former drcauto employees helping people out with authorisation codes?
NV: They have no rights to do that. They don’t own the intellectual property, we do. People need to be very careful.

SJ: Are you contemplating legal action?
NV: I think I’ll keep that under my hat for now.

SJ: Do you foresee any problems with Autodesk if you go ahead with LT Toolkit?
NV: I don’t think so. Autodesk would be pretty naive, with competing products around at a lower price than LT and with LISP built in, to think that they would gain any sales by blocking LT Toolkit. They would just be shooting themselves in the foot.

SJ: Autodesk has always been strongly opposed to products like LT Toolkit. Are you concerned about legal action from Autodesk?
NV: Well, people say that Autodesk has been against it, but I haven’t seen any evidence of that. When I spoke to the late Gary D’Arcy he told me that Autodesk had never once even contacted him to try to get him to stop developing it.

On Deelip’s blog there has been some discussion about resellers and what they should be allowed to do, so I asked some questions along those lines.

SJ: What is the relationship between CAD International in the USA and Australia?
NV: We’re an Austalian company, moving into the US marketplace for those people in the USA who want to buy our products. We don’t have offices in the USA, but we do have people on the ground.

SJ: Is CAD International an authorised AutoCAD reseller?
NV: No. We’ve been selling Autodesk products for 15 years without a direct relationship. We buy from Scholastic like everybody else in the same position. It’s not worth becoming a dealer; the obligations are too great and the margins are not worthwhile. We’ve been asked on several ocasions over the years and always said no.

[Note: I’ve since read (in something written well before this issue was raised here) that Autodesk Australia intends to tighten up the reseller situation in the very near future. These things go in cycles, and have for the last 25 years.]

SJ: Does Autodesk have a problem with you promoting competing products such as Bricscad?
NV: They have never spoken to us about it in the past, but as we don’t have a direct relationship with them it’s not surprising.

SJ: I see from your web site that you are selling DWG TrueView for $195. Isn’t that a free product?
NV: That fee is for supply services; research services if you prefer. People can download it from Autodesk if they like or get it from us. We just put it on the site as a trial to see if anybody wanted to buy it.  Nobody has, yet.

SJ: I can’t say I’m greatly surprised by that. Has Autodesk contacted you about this issue?
NV: No, we’ve heard nothing from Autodesk. They don’t really care about us, we’re a pretty small player in the market.

[Edit: the $195 price tag has since vanished from the site.]

More on drcauto, LT Toolkit and CAD International

Things have moved on since my first post on this subject in which I passed on the information that Leonard Liang (a former drcauto employee) could help with codes for LT Toolkit orphans. In recent developments

  • In a comment in a WorldCAD Access post, Nigel Varley from Australian company CAD International stated that they had bought the intellectual property rights to the drcauto software, and that drcauto codes and software obtained from former employees are illegal.
  • Another comment on the same post from former drcauto employee Kevin J Secomb lamented the demise of Gary D’Arcy’s dream and criticised CAD International for indicating in an email to users that they would charge for authorisation codes.
  • CAD International created a web page describing the situation with regard to drcauto products, including a statement that it would “offer immediate assistance to those needing new authorisation codes”.
  • Deelip Menezes made a blog post on the subject, followed by another one containing a reaction from Autodesk’s Jim Quanci. Poth posts are worth reading, as are the comments from various observers. The first post went off at a bit of a tangent about Autodesk’s apparent benevolence towards resellers that don’t toe the corporate line (drcauto is still listed as an Authorised AutoCAD reseller a decade after being dropped by Autodesk). The second post included words from Jim that the late Gary D’Arcy was a great character, albeit a pain to Autodesk. Having met Gary many years ago and followed the story of LT Toolkit with interest, I can confirm the truth of both statements.

I thought I would have a chat with CAD International’s Nigel Varley to see if I could clear up the situation as he sees it. It was a very interesting interview, the results of which I will publish very soon.

Hope for drcauto LT Toolkit orphans

LT Toolkit from the now-defunct drcauto was an add-on for AutoCAD LT that provided LISP and other capabilities that Autodesk disabled. Autodesk hated this, of course, but the late Gary D’Arcy made sure everything was done legally so it couldn’t be stopped even by Autodesk’s hyperactive legal team.

If you are a user of LT Toolkit and you want to keep using the software now the company has closed down, you may find this information from Evan Yares useful:

I’ve gotten in contact with Leonard Liang, the former key developer at DRCauto. He’s asked me to send any Toolkit Max users to him, and he will help them. His website is www.cadsta.com. His email, at that domain, is “leonardl”.

Source: a comment in this this WorldCAD Access post. If you don’t read comments, you may well have missed this, so I thought it was worth repeating.

Edit: events have overtaken this news since it was written. Please see here and here.

AutoCAD virus protection update

As I mentioned in my last post, I had some reservations about the code provided by Autodesk to deal with suspect acad.vlx and logo.gif files. Based on a suggestion from Jimmy Bergmark, I have written my own, safer version which you can download here: clean_virus_safe.lsp.

The comments at the top of the clean_virus_safe.lsp file explain what to do with it, but I will reproduce some of the relevant points here.

  • Purpose: Checks for existence of acad.vlx and logo.gif files, which are associated with virus AL/Logo-A, also known as ACAD/Unexplode, ACAD/Agent.A or ACM_UNEXPLODE.B. Written as a safer alternative to Autodesk’s code which deletes suspect files without prior warning. This code renames the files instead.
  • Legal: Provided as-is with no warranty whatsoever, use at own risk. May be distributed freely.
  • Usage: Append the contents of this file into a startup LISP file (e.g. acaddoc.lsp in your search path – create such a file if it does not exist). Autodesk’s suggestion to modify the acad20xx.lsp file should not be followed: this is bad practice. The acad20xx.lsp file is Autodesk’s file and any modifications you make to it are likely to be lost when updates and patches are applied.
  • Effects: Any and all files named acad.vlx and logo.gif and located in AutoCAD’s search path will be renamed, e.g. “acad.vlx” will become “[Suspected Virus] acad.vlx0”. The name will end in a number starting with 0. If other suspect files are later found in the same location, those files will be renamed to end with 1, 2, 3 and so on.

I don’t have a copy of the actual virus, and would like to get hold of one with a view to possibly improving this code. If you have a copy, I would be grateful if you could contact me so I can dissect it.

Another AutoCAD malware warning

Shaan Hurley has posted some useful information about another AutoCAD-based virus that is doing the rounds, and I strongly suggest you read it. However, I have some reservations about the solution that is posted there and in the Autodesk knowledgebase.

The LISP code suggested will delete any files called acad.vlx or logo.gif that are located in the current user’s current AutoCAD search path. There are a couple of problems with that.

  • The search path will change depending on the user, the profile, the startup folder and the drawing folder. That means you can’t just use the code once and expect the problem to go away; the code will need to remain in place permanently to ensure it does not recur. That may not be a huge problem, although it will have a performance penalty (particularly where the search path is long and/or includes network paths) and it is one more thing to remember to carry over to future releases.
  • More importantly, the code has no idea if the files it is deleting are legitimate or not. It is quite possible for a custom environment or third-party utility to make use of a file called acad.vlx, and there are all sorts of reasons you may have a logo.gif file floating around. The Autodesk code will just erase such files without prior warning, which is a bit naughty.

I commend Shaan and Autodesk for posting this information and proposed solution. However, I recommend caution before using this code as suggested. Check with your CAD Manager (if you have one) first to ensure there are no legitimate acad.vlx files in your environment. Do a search for these files yourself and see if there is a legitimate reason for them being where they are.

As with most malware attacks, taking care with incoming files is a very important part of the solution. Don’t just blindly use the contents of a zip file full of drawings, even from a trusted source. If somebody sends you a zip file containing an acad.vlx file, let the sender know about the problem and ask for an uninfected set of files.

Why AutoCAD for Mac is a bad idea

There has been a fair bit of open discussion from Autodesk lately on the subject of a possible future OS X AutoCAD version. The more I think about this, the more I am inclined to believe that this would be a bad idea. A very bad idea.

It pains me to write this, because I’m very much a user advocate and I’m arguing here against something that some users have been requesting for a long time. If you’re one of those users, I’m sorry, but I think this is one of those cases when giving you what you want would be bad for everybody, and bad for you in particular.

Now, this sort of platform discussion often degenerates into a quasi-religious debate, so let’s see if I can head it off at the pass. If you’re a Mac fan who wants to tell me the benefits of your chosen computer family and how inferior Windows is, save it. I’ll concede right here and now that you are probably right. My experience of Apple products has generally been very positive. They look good, they’re well made, they work well, the Mac OS has been shamelessly copied by Microsoft for decades, and so on, ad nauseam. Yup. Not disputed. Also, not relevant to the point I’m about to make.

Ever since the last multi-platform AutoCAD (Release 13), Autodesk has dedicated its primary product solely to Windows. Since then, the code base has been spreading its mass of roots deeper and deeper into the Windows soil. Any Windows-specific advantage the developers can take has been taken. Reversing or working around that process is a very substantial undertaking. If it were done, I think it would have the following outcomes:

AutoCAD for Mac would suck

The performance is likely to be poor, because all the Windows-specific stuff will have to be redirected, recreated or emulated. The stability is likely to be awful, because this will be new ground for almost all of the developers involved. Developers with AutoCAD experience are going to have little or no Mac experience and vice-versa. They would be trying to make significant changes to the code base at the same time that that code base is being modified for the next release. The bug level is likely to be abysmal, both for the above reasons and also because the number of pre-release testers available to Autodesk on this platform is likely to be relatively tiny. The user interface is likely to be an uncomfortable square-peg-in-round-hole effort, which will work badly and be derided by OS X users.

AutoCAD for Mac would be half-baked

Not just half-baked in the usual let’s-put-this-out-as-is-and-maybe-we-can-fix-it-later way, but half-baked by design. The Autodesk survey implies that serious consideration is being put into a version of AutoCAD that is missing some of the things that make AutoCAD what it is. Things like paper/model space functionality, the command line, 3D, LISP, the ability to use third-party apps… AutoCAD for Mac LT Lite, anyone? If the APIs are not all there, that means no OS X version of any of the AutoCAD-based vertical products, either.

AutoCAD for Mac would be bad for Mac users

Last time this was attempted, it was a failure. The early 90s attempt at AutoCAD for Mac lasted for two three releases: 10 to 12. Autodesk had little option but to pull the pin on a non-viable product, but the orphaned users weren’t happy. Fortunately, there weren’t that many of them.

Would this happen again? Yes, I think it probably would. Any Mac user with any sense wouldn’t touch the first new Mac release with a bargepole. That, of course, makes it much less likely that there would be a second or third release. Autodesk’s corporate culture (espoused very strongly by Carol Bartz, but dating back to John Walker) encourages brave attempts that may lead to failure. This policy has unfortunately left large numbers of orphans in its wake over the years. In the event of poor sales, Mac for AutoCAD users would just be another set of unfortunates to add to a long list.

AutoCAD for Mac would be bad for Windows users

The very substantial effort required to produce any kind of AutoCAD for Mac at all would be a major drain on very limited (and shrinking) development resources. That means Windows users of AutoCAD would look forward to a release (or more likely several releases) with fewer new features, less completion of existing undercooked features, and longer waits until bugs and other problems get fixed. This, in exchange for no benefit whatsoever to those users. In fact, the decoupling of Windows-specific calls and the likely introduction of extra bugs would probably make AutoCAD for Windows work less well than it otherwise would.

AutoCAD for Mac would be bad for Autodesk

Autodesk is currently trying to save money by closing down offices, dropping products, cutting down on expenses and sacking employees (some of whom were long-termers; irreplaceable sources of information about use of the product and why certain things were done the way they were). In such an environment, does it make sense to start up a new project with high resource requirements and limited potential benefits? Especially when it is just a repetition of a previous project that was a complete failure?

So, in addition to costing Autodesk a lot of money and harming the quality of its core product, a failed AutoCAD for Mac would leave behind more Autodesk haters and be rather embarrassing.

I must admit that a lot of this is based on guesswork, but it’s educated guesswork. I’ve been educated by history, if nothing else. Autodesk’s corporate consciousness has an occasional habit of ignoring the lessons of history and repeating old mistakes. I hope AutoCAD for Mac – The Sequel isn’t one of those occasions.