Question

I wrote an alternative fonction to open AutoCAD drawings. However, AutoCAD made it really hard to change how a document is opened when it is ran from Windows Explorer (double click the file with file association). The only method I found is to change a registry key which is "OpenDdeExec". There is a supplied argument (%1) that gives me a unescaped path to the file to open.

I need to ignore the escaping in path or replace the backslashes with double backslashes before it gets parsed as being special characters. In C#, you could do something like string s = @"I\Like random\backslashes"; and backslashes would be taken as the actualy backslashe character. In lisp, the only equivalence I found is quote which has a weird behavior (since it's normal use isn't exactly what I'm trying to acheive).

If I write something like (quote (I\Like random\backslashes)), the outcome will be (I\\Like random\\backslashes) which is ALMOST what I need. However, I have to get rid of the parenthesis. Any idea how I can acheive this?

Note: Doing this (quote I\Like random\backslashes) will break due to the space. It would, however, work on (quote I\Like\backslashes). This would output I\\Like\\backslashes just like I want.

This is the current OpenDdeExec with the described issue:

(OPENFROMSHELL (QUOTE (%1)))
Was it helpful?

Solution

This is unfortunately not possible with AutoCAD's limited LISP.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top