hailualua Posted November 16, 2018 Share Posted November 16, 2018 (edited) (defun Copytest (/ curr_dir foldrflname edFname edPath) (vl-load-com) (setq edPath "D:\\") (setq edFname "05a_fr_54.dwg") (setq foldrflname (strcat edPath edFname )) (setq curr_dir (strcat (getvar "dwgprefix") )) (vl-file-copy (apply 'strcat foldrflname) curr_dir) (princ) ) Edited November 16, 2018 by hailualua Quote Link to comment Share on other sites More sharing options...
dlanorh Posted November 16, 2018 Share Posted November 16, 2018 (vl-file-copy source-file destination-file) This is the correct syntax (setq curr_dir (strcat (getvar "dwgprefix") )) curr_dir is NOT a destination FILE Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 16, 2018 Share Posted November 16, 2018 Maybe (setq curr_dir (strcat (getvar "dwgprefix") )) (vl-file-copy foldrflname (strcat curr_dir edfname )) (princ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 17, 2018 Share Posted November 17, 2018 (edited) Your error arises because you are attempting to use the apply function with a string argument as opposed to a list argument: (apply 'strcat foldrflname) Here, your variable foldrflname is a string, as returned by the earlier strcat expression: (setq foldrflname (strcat edPath edFname)) But that aside, you will also need to specify a valid filename for the destination of your vl-file-copy expression, e.g.: (defun c:copytest ( / edpath edfname ) (setq edpath "D:\\" edfname "05a_fr_54.dwg" ) (vl-file-copy (strcat edpath edfname) (strcat (getvar 'dwgprefix) edfname)) ) Edited November 17, 2018 by Lee Mac Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.