Jump to content

Recommended Posts

Posted

Is it possible to make an AutoLISP that gets a selectionset of drawings from the user and simply runs a script on each drawing selected?

Posted

I've never done it, but I should think that you could get a list of the drawings and then get a LISP routine to write the script file and save it somewhere, then the user can run it, but I don't think you can run a script on more than one drawing from a LISP as the LISP would terminate as soon as the new drawing is opened.

Posted

A guy at where I work has come up with some lisp routines that run functions that the user designates on a batch of drawings that the user selects, but you have to put cad in a Single Drawing Interface (sdi).

Posted

I would still be inclined to use something like a combination of maybe, "getfiled" and/or "vl-directory-files" or something to that nature to collect your list of files and directory paths.

 

Then, I would use "vl-filename-mktemp" to create the script file and use "write-line" to write a script file that you can run at your own expense.

 

Or maybe you could use the "script" command (but make sure that it is the LAST thing you run in your LISP...

 

Just my opinion,

 

Lee

Posted

scriptpro (autodesk) will do exactly that.

write a little script that will execute the lisp routines.

 

this won't work anymore (scriptpro doesn't work with plotting after version 2004, i think), but this was something i put together to batch plot our EMP plans. this way, we could set a computer to plot the sheets, then have an admin collate anything that was out of order. granted, sheet set manager does this now :) but you can still use it for batch editing drawings.

 

(foreach layl (layoutlist)
(if (wcmatch (strcase layl) "*EMP*")
 (progn
  (setvar "ctab" layl)
  (command "-plot" "n" (getvar "ctab") "" "" "n" "n" "y")
 );progn
);if
);foreach

 

even though this is all lisp coding, you can still just load it as a .scr file. or just call out the lisp routines from your script. this was one of many we used. i just keep them in my archives to be a pack rat.

Posted

You should get collection of opened documents:

 

(setq dCol(vla-get-Documents
    (vlax-get-acad-object)))

 

and run your code for every drawing:

 

(vlax-for doc dCol
... Your code ...
); end vlax-for

 

To open existing documents you can use vla-Open method:

 

(setq doc(vla-Open dCol "C:\\Some path"))

 

Or use Object DBX interface to proceed drawings without opening.

 

You can't to use command for this code.

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