Message 1 of 2
save new file to pre-determined location but with new name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i have the following LISP to create a DXF, but the problem is, this LISP runs on whatever the file name is, regardless if it is saved or not. in a perfect world, my file would be saved, and i can get the proper location if my file is already saved. but what i'm wanting to do is to copy my object to a new drawing and run this lisp to create it as a dxf, but i want it to ask me what to name the file, so what do i replace ------ (substr (getvar 'dwgname) 1 (- (strlen (getvar 'dwgname)) 4))------ with to be able to customize the file name each time i run my LISP? I'd rather not change the LISP code if at all possible, just this particular section.
-----------------------------------------------------------------------
(defun c:DXF ( / fileName)
(vl-load-com)
(vlax-for layout (vla-get-layouts
(vla-get-ActiveDocument (vlax-get-acad-object))
)
(if (/= (vla-get-name layout) "Model")
(vla-delete layout)
)
)
(command "._change" "all" "" "properties" "layer" "0" "")
(command "._-purge" "all" "" "no")
(vla-saveas
(vla-get-activedocument (vlax-get-acad-object))
(strcat "F:\\mazak -NEO\\" (substr (getvar 'dwgname) 1 (- (strlen (getvar 'dwgname)) 4)) ".dxf")
ac2000_dxf)
(princ)
)
----------------------------------------------------------------------------------------------