stephen.coff
2007-06-18, 01:14 AM
Guys any suggestions or assistance would be grately appreciated,
I am try to write a LISP routine that prepares an Architectural drawing. Usually it works relatively smoothly though today I had a glitch and them an error on the routines behalf. It really doesn't allow for any differences and most likely can be done best by using wildcards though I have no idea how to approach it.
I attempted using the following portion of the routine to "save as" the incoming file from the incoming folder to the drawing folder and add "-XR-A-" in front of the file name.
Being that the only thing that changes in the filing process from job to job is two things:
The project name & the folder name of the folder in the "Incoming". By this I mean that this name always starts with an itial followed by the date, backwards.
eg: "a070618" representing, a folder of Architecturals that came into the office on the 18.06.07.
I Wasn't very good with using wildcards so opted to remove by number of characters as the number of characters should always be the same. This isn't working consistantly which is now causing a problem.
Could someone please assist me as the best way to do this.
Below is the current portion of Lisp to remove the characters.
(setvar "cmdecho" 0)
(setq drawprefix (getvar "dwgprefix"))
(setq drawname (getvar "dwgname"))
(setq currentdirectory
(strcat (getvar "dwgprefix") (getvar "dwgname"))
)
(setq newdrawname (strcat "XR-A-" (getvar "dwgname")))
(setq num 17)
(setq strlength (strlen drawprefix))
(setq newnum (- strlength num))
(setq ammenddrawprefix1
(strcat (vl-string-right-trim
(substr drawprefix newnum strlength)
drawprefix
)
"\\"
)
)
(setq newdirectpath (strcat ammenddrawprefix1 newdrawname))
(command "saveas" "r14" newdirectpath)Any assist would be greatly appreciated
Stephen
[ Moderator Action = ON ] What are [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code) [ Moderator Action = OFF ]
I am try to write a LISP routine that prepares an Architectural drawing. Usually it works relatively smoothly though today I had a glitch and them an error on the routines behalf. It really doesn't allow for any differences and most likely can be done best by using wildcards though I have no idea how to approach it.
I attempted using the following portion of the routine to "save as" the incoming file from the incoming folder to the drawing folder and add "-XR-A-" in front of the file name.
Being that the only thing that changes in the filing process from job to job is two things:
The project name & the folder name of the folder in the "Incoming". By this I mean that this name always starts with an itial followed by the date, backwards.
eg: "a070618" representing, a folder of Architecturals that came into the office on the 18.06.07.
I Wasn't very good with using wildcards so opted to remove by number of characters as the number of characters should always be the same. This isn't working consistantly which is now causing a problem.
Could someone please assist me as the best way to do this.
Below is the current portion of Lisp to remove the characters.
(setvar "cmdecho" 0)
(setq drawprefix (getvar "dwgprefix"))
(setq drawname (getvar "dwgname"))
(setq currentdirectory
(strcat (getvar "dwgprefix") (getvar "dwgname"))
)
(setq newdrawname (strcat "XR-A-" (getvar "dwgname")))
(setq num 17)
(setq strlength (strlen drawprefix))
(setq newnum (- strlength num))
(setq ammenddrawprefix1
(strcat (vl-string-right-trim
(substr drawprefix newnum strlength)
drawprefix
)
"\\"
)
)
(setq newdirectpath (strcat ammenddrawprefix1 newdrawname))
(command "saveas" "r14" newdirectpath)Any assist would be greatly appreciated
Stephen
[ Moderator Action = ON ] What are [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code) [ Moderator Action = OFF ]