Jump to content

Opening dwgs in a script that has spaces in the filenames & directories


BIGAL

Recommended Posts

I got around the first problem of having file names & directories with spaces in them by using Vla-open and it works fine for single dwgs. I need to do a script process, the script opens a dwg makes it the default but then stops and does not run the preloaded defun or use of a (Load "xxxx") it just returns command to the current drawing. Any ideas very frustrating, 128 individual directories.

 

Lisp
(defun openblk (blkname / adocs)
(setq acDocs (vla-get-documents (vlax-get-acad-object)))
(vla-open acDocs blkname)
(vla-activate (vla-item acdocs 1))
;(vla-put-activedocument (vlax-get-acad-object) (vla-item acdocs 1))
)

script
Filedia 0
(openblk "P:/2014 Projects/2014073/Design/basin 1/2014073-1")
(plotbasin)
CLOSE N

Link to comment
Share on other sites

Thanks guys solved the problem it was not actually a problem with the dwg names but rather a typo on the last line of the lisp program, this would cause an error so script stops, the lisp when ran would work and I was overlooking the error that occured.

Link to comment
Share on other sites

I would think replacing the space with an underscore would work in plain script lines as well. -David

 

open
p:/2014_projects/   ....

 

-David

Link to comment
Share on other sites

David your correct but 128 directories and files to rename, fixed the lisp and had a couple of fails which were drawing problems now sorted, the original draftee missed a number which I put in script, produced 148 pdf's around 4 secs per dwg.

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