I'm trying to use this with AutoCAD 2013. It seems to work, I think, except that in the statement that executes Bell's routine,
(adddws "S:\DIES\~Standard Dies\dies.dws")
AutoCAD is not seeing the backslashes in the networked path. so it errors, says it can't find DIES~Standard Diesdies which it thinks is the DWS file. what do I have to do to get it to recognize a network path? and the DWS file has to be networked or I won't get anyone else in this place to use it. If I browse to it, everything works fine. But I want to run a script on several hundred files to set this and save me a step when I check the standards.
THANKS
@dreno99 wrote:
I'm trying to use this with AutoCAD 2013. It seems to work, I think, except that in the statement that executes Bell's routine,
(adddws "S:\DIES\~Standard Dies\dies.dws")
AutoCAD is not seeing the backslashes in the networked path. so it errors, says it can't find DIES~Standard Diesdies which it thinks is the DWS file. what do I have to do to get it to recognize a network path? ....
See the ;;;Usage: line above the code. You will need to use double backslashes as done there, or if you prefer, single forward slashes. It's all because in AutoLISP-function text strings, a backslash is a marker for a special code [such as \n for a New line in a prompt], referred to as an "escape character," and to get a backslash per se, you need to double it. See Help for the (wcmatch) function. It's probably specifically because of that situation that it will recognize a forward slash as a filepath separator, even though it wouldn't be in certain other programming languages/formats.
From R. Robert Bell post
;;;Function to attach a DWS Standard File to the current Drawing
;;;Usage: (AddDWS "Z:\\_Estilos Taller_CAD\\Standards\\DwgStd.dws")
;;;By R. Robert Bell
(defun AddDWS (FileN / DictN eDict XRInt)
Need to use double backslashes or a single slash, and for a networked path you can use something like this
" \\\\servername\\mypath\\my.dws" or "//servername/mypath/my.dws"
EDITED: too slow....
HTH
Henrique