Author Topic: Need guidance with batch processing  (Read 8930 times)

0 Members and 1 Guest are viewing this topic.

debgun

  • Guest
Need guidance with batch processing
« on: February 24, 2010, 02:28:19 PM »
I need guidance from the experienced users.  I’ve been working on a project to automate IO (input/output) drawings and have asked several questions pertaining to a small portion of the project.  Of course, it doesn’t help that this is my first attempt at LISP.

Let me start by describing the project, please keep in mind that this is based on AutoCAD Electrical.
1.   Excel document is prepared for AutoCAD.
2.   AutoCAD will read excel document.
3.   Create new drawing based on given filename indicated in excel document.
4.   Insert circuits and prepare drawing.
5.   Create next new drawing
6.   Repeat steps 4 & 5 to EOF
Yesterday, I learned that LISP is document-centric and cannot communicate between drawings.  Please direct me to the most efficient route in order to batch process this routine.  I would like to avoid using VBA since it could disappear soon.  I have dabbled in VB.NET, but not put it to use, yet.  I’m not comfortable with using scripts to complete complicated process such as the electrical commands are.

I’ve attached a sample of the excel document and the lisp routines that will work per drawing.

Thank you for your help!
Debbie

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Need guidance with batch processing
« Reply #1 on: February 24, 2010, 02:38:53 PM »
Either you have to change the code to use none of the Electrical commands ( as I'm sure they are coded to only use the current drawing ), and no ' ssget ' calls, or...

You can use a lisp on multiple files, if you use Acad in SDI mode, or....

You can create a lisp, that will write a script, that will run your commands ( lisps and/or commands ), but this cannot have any user interactions.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: Need guidance with batch processing
« Reply #2 on: February 24, 2010, 04:10:35 PM »
here's an unintelligent way to communicate between drawings :)
Code: [Select]
(defun test (/ f fn)
  (and (setq c (getint "\nEnter starting number: "))
       (setq f (open (setq fn (vl-filename-mktemp nil nil ".lsp")) "w"))
       (write-line (vl-prin1-to-string
     '(progn (alert (itoa c)) (setq c (1+ c)) (vl-propagate 'c) (princ))
   )
   f
       )
       (not (close f))
       (vl-propagate 'c)
       (vl-load-all fn)
  )
)
don't forget to delete any temporary files created

debgun

  • Guest
Re: Need guidance with batch processing
« Reply #3 on: February 24, 2010, 05:16:50 PM »
Thanks for the quick responses.

Tim,

I was reading http://through-the-interface.typepad.com/through_the_interface/2009/06/batch-processing-autocad-drawings-from-lisp-without-sdi.html about SDI.  Should I be concerned about using the SDI method?

JohnK

  • Administrator
  • Seagull
  • Posts: 10638
Re: Need guidance with batch processing
« Reply #4 on: February 24, 2010, 05:34:11 PM »
> Batch-processing AutoCAD drawings from LISP without SDI ...
what does that mean? ...How old is that article? ...2009?! *gack*

I will take part in a group Batch processing project if there are any other takers?  I already have one Ive been using for years but it would need some updating because its not really that "user friendly" but i would offer it up so i can get us started.


BTW
>  "choose to break binary application compatibility"
what da heck does that mean? Who comes up with this crap?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Need guidance with batch processing
« Reply #5 on: February 24, 2010, 05:45:55 PM »
Would this help you at all?   8-)

http://www.theswamp.org/index.php?topic=31827.0

JohnK

  • Administrator
  • Seagull
  • Posts: 10638
Re: Need guidance with batch processing
« Reply #6 on: February 24, 2010, 05:58:02 PM »
Dont put on those "Mr. cool" glasses just yet.

What can i do TO a drawing without:
Quote
;;            - No SelectionSets               (ssget,ssname etc.)               ;;
;;            - No Command calls                                                 ;;
;;            - No *Ent Methods                (entget,entmod etc.)              ;;
;;            - No Access to System Variables  (vla-Set/GetVariable, etc)        ;;



;P
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Need guidance with batch processing
« Reply #7 on: February 24, 2010, 05:58:42 PM »
I have written quite a bit of batch processing code in Lisp.  Now if I need to do certain things, I just use a script writer, and let it to it's thing.  If I have to do the same thing over, and over again.  If it doesn't deal with changing text/attributes, then I use ObjectDBX.  If it does change those items, then I use C#.

Lee,

ObjectDBX would not work in this case, as the code is written.

7,

Not sure how the OP wants to handle this, but I can help also, as time allows.  I have posted my script writing routine before.  I'll see if that can be found.

Edit: [ http://www.theswamp.org/index.php?topic=8264.msg105871#msg105871 ] here is the script writing program.

fyi.. The Tim that posted in there was me also.
« Last Edit: February 24, 2010, 06:04:47 PM by T.Willey »
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Need guidance with batch processing
« Reply #8 on: February 24, 2010, 06:03:04 PM »
Dont put on those "Mr. cool" glasses just yet.

What can i do TO a drawing without:
Quote
;;            - No SelectionSets               (ssget,ssname etc.)               ;;
;;            - No Command calls                                                 ;;
;;            - No *Ent Methods                (entget,entmod etc.)              ;;
;;            - No Access to System Variables  (vla-Set/GetVariable, etc)        ;;


Hehe - quite a lot actually  :-)

debgun

  • Guest
Re: Need guidance with batch processing
« Reply #9 on: February 24, 2010, 06:10:03 PM »
So I've been digging around in the Electrical help files and noticed it creates batches with script files.  I'm considering this option some more.  Apparently, it uses the DCL file called ace_proj_matrix.dcl, which I don't totally understand.

Thanks for all your input.  It has benefited me.

JohnK

  • Administrator
  • Seagull
  • Posts: 10638
Re: Need guidance with batch processing
« Reply #10 on: February 24, 2010, 06:12:38 PM »
Lee Mac,
but you are limited.

T.Willey,
Let's exchange some email's tomorrow. I'll send you some files so you can check out my method (-i.e. tell me if its worth while) but I dont use script files.

debgun,
So does that mean your out?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Need guidance with batch processing
« Reply #11 on: February 24, 2010, 06:36:35 PM »
T.Willey,
Let's exchange some email's tomorrow. I'll send you some files so you can check out my method (-i.e. tell me if its worth while) but I dont use script files.

Sounds good.  You were easy to work with before, and you're knowledgeable, so should be fun.   :-D
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

JohnK

  • Administrator
  • Seagull
  • Posts: 10638
Re: Need guidance with batch processing
« Reply #12 on: February 24, 2010, 07:00:32 PM »
I dont know about `knowledgeable' but if you deem that its a good enough method, then i will be willing to post it as-is so we can get a few others involved.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Need guidance with batch processing
« Reply #13 on: February 24, 2010, 07:15:42 PM »
Whatever you want to do, I will take a look at it.

I do seriously respect you knowledge as a coder though.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

uncoolperson

  • Guest
Re: Need guidance with batch processing
« Reply #14 on: February 24, 2010, 07:56:22 PM »
could this all be done via VBA in excel?