Current location - Health Preservation Learning Network - Healthy weight loss - Programming with lisp, open the D D:\ 1.dwg drawing, and create a new folder under this drawing path with programming command. The command is a.
Programming with lisp, open the D D:\ 1.dwg drawing, and create a new folder under this drawing path with programming command. The command is a.
When writing autolisp, pay attention to the following conditions:

You must save the open dwg file.

If the new folder is not created successfully, please check whether Express Tools is installed in cad.

(Derun? c:tes? (? /? & amptr 1? ff 1? ff2)

(setq? ff 1? " D:\ \ A "); Create folder

(if? (VXMAKEDIRECTORY? ff 1); If the establishment is successful

(program

(setq? & amptr 1? (getvar? " dwgname ")); Extract file name

(if? (setq? ff2? (findfile? & amptr 1)); If you find this file,

(vl-file-copy? ff2? (strcat? ff 1? "\\"? & amptr 1)); Copy files to a new folder.

)

)

)

(princ)

); The appload command loads autolisp, TES command and attachment download.