Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm working on a LISP that in part needs to grab the filename (without extension) for a command - I managed to do this using 'vl-filename-base' but since it needs to run in acoreconsole it can't use anything from the VL Library. Is there any way to either remove ".dwg" or remove the last 4 characters from a string in only vanilla LISP?
Here's what I've got so far
(defun C:PlotToLocation (/ filename)
(vl-load-com)
(setvar "cmdecho" 0)
(setq filename (vl-filename-base (getvar 'dwgname)))
(setq filename (strcat "A:\\X\\Y\\" (vl-filename-base (getvar 'dwgname))".pdf"))
This sets the filename to "A:\X\Y\filename.pdf"
I can currently get "A:\X\Y\filename.dwg.pdf" but since the PDFs have to follow a naming standard, I need a way to remove the ".dwg".
Solved! Go to Solution.