Jump to content

multi processing... vba Lisp...


ibach

Recommended Posts

Is there a way to separate DWG file on few portions and doing so somehow enable running 2 or more instances of certain lisp functions on the file simultaneously, each using separate processor for the task.

 

E.g. Lsp like txtmgr has to exchange text-stiles, and DWG is somewhat similar to a table so we could divide this table in a logical way and run two instances of the routine to process the part of the file on separate processor. we would probably need to run an other instance of autocad to do the 2nd, 3rd... part of the file, and merge it back together.

 

So first thing would be to write lsp that separates file in wanted number of sectors of the same size, than run other instances of acad.exe and serve them the part of the file, batch of commands, and at the end merge the result together.

 

That would shorten the time I'm killing right now waiting for lsp to finish to about 1/7 in my case...

 

not every lsp could be used this way, but many would be few times faster.

Link to comment
Share on other sites

I'm not too sure I'm following. But you could conceivably open each session with a script calling your lisp. Unfortunately it's highly unlikely (if not impossible) to control another dwg from a lisp routine, let alone another acad session. So you'd have to do the split, save to separate files, then issue a startapp with the script to perform the text-style change in each. How it's going to "know" when each session is finished so it can re-combine the tables I have no idea.

 

Unfortunately AutoLisp only runs one single thread - which is the current ACad session's user interface thread. So while lisp is running nothing else can be input into acad. It's sorry that AutoLisp / Visual Lisp does not allow for multi threading, would have made some other stuff a lot faster as well. Note, this is not due to lisp, it's due to AutoDesk not implementing it inside their lisp interpreter. E.g. newLisp can actually run code not just on separate cores / cpu's, but actually send code to other computers to be evaluated: http://www.newlisp.org/downloads/newlisp_manual.html#net-eval ... Would have been nice wouldn't it?

 

BTW, I think you're finding that tables update quite slowly. It's because acad recreates the table after each change. So you edit one cell, acad recalculates the table and changes the whole thing, then you go to the next cell and acad does everything again. You can turn this off through the ActiveX RegenerateTableSuppressed property. Do the changes, then change that back to :vlax-false and invoke the Update method to have acad only regenerate the table once all the changes are complete. This should speed up your code greatly.

Link to comment
Share on other sites

A split is what I had in mind, but i cannot begin to imagine how one can split dwg by using lsp.

User might know when sessions are completed, it does not have to be "hands off" thing, just not "over 1 hour" thing.

All this waiting computer to finish the task is killing me.

Link to comment
Share on other sites

Can you post your code?

 

If it's a true table, I think splitting it might not actually be faster - in which case you'd need to use my 2nd suggestion by turning the auto-regen off.

 

If it's simply a situation of text + lines simulating a table - you could select a 1/4 of them then wblock that to a new DWG, erase, do the startapp to start a new acad session on that DWG and run a script on it. Then continue with the 2nd 1/4, rinse and repeat. After all 4 sessions have completed simply insert & explode the DWGs back into the original file.

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