Jump to content

help me, please!!! not working


hailualua

Recommended Posts

(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)
)

 

 

 

error.JPG

Edited by hailualua
Link to comment
Share on other sites

(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

Link to comment
Share on other sites

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 by Lee Mac
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...