Jump to content

Recommended Posts

Posted

hi there, i have a programme that when run it saves 1 drawing in a folder called ARCH and then the second is saved with pl in front of the tital then pulls in the first as an X-REF can renames it ARCH the orgional is left untouched

 

in my project folder there will be a set up of folders already made going FM\SCG\Eng-drawing\project

 

now for the trickey bit i hope i explain what i am trying to do ok.

 

so say i have a folder set up like this in a folder called working

 

folder called FM (as explained above)

projects called KE,LC, -- these are where the cad files are (need the lisp to work from current directory)

 

so what i need it to do is if i am in the folder called KE and i run the lisp it will take the drawing and save iit down the pre set up folder FM\SCG\Eng-drawing\project (then add a folder the same as where it came from (this time KE)) then it will save another copy with PL infrot of the file name in the working folder then x reff the first drawing back in rename to ARCH - (from renaming to acrh there on it works fine )

 

i hope it comes accross what i am trying to achieve. this is way over my head lol.. thanks

 

(defun c:sa( / Name drawingNew1 drawingNew2 )
(vl-load-com)
(setq Name (getvar "DWGNAME"))

(vl-mkdir (setq pathNew (strcat (getvar "DWGPREFIX") "arch\\")))
(setq drawingNew1 (strcat pathNew
                          (vl-filename-base Name)
                          "-XREF"
                          (vl-filename-extension Name)))
(setq drawingNew2 (strcat (getvar "DWGPREFIX")
                          (vl-filename-base Name)
                          "-pl"
                          (vl-filename-extension Name)))

;test if target drawing already exists
(if (not (findfile drawingNew1))
 (command "_SAVEAS" "2007" drawingNew1)
 (command "_SAVEAS" "2007" drawingNew1 "_Y")
)
(if (not (findfile drawingNew2))
 (command "_SAVEAS" "2007" drawingNew2)
 (command "_SAVEAS" "2007" drawingNew2 "_Y")
)

(command "_erase" "ALL" "")
(command "_delay" "500")
(command "_XREF" "_A" drawingNew1 '(0.0 0.0 0.0) 1.0 1.0 0.0)
(command "_RENAME" "_B" (vl-filename-base drawingNew1) "ARCH")

(princ)
)

Posted

can no one help me out with this one :(

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...