Author Topic: New Challenge Plot all the drawings in one command  (Read 4548 times)

0 Members and 1 Guest are viewing this topic.

RbtDanforth

  • Guest
New Challenge Plot all the drawings in one command
« on: April 01, 2006, 11:15:42 AM »
Quote
It ain't easy! Wish I was talented enough to challenge the big guns.  smiley

And for all those reading this, don't be shy, write your own challenges and post them.

For years I had this neat program that would step through many drawings doing the same thing (plotting , updating blocks, filling in border, even erasing the exploded border, looking up what the atts should be, Reinserting border and filling in atts and more)and then going on to the next drawing.

Now the sitation is more complicated, drawings don't open and close the same way, and there is paperspace and all the tabs, and lisp only works in the current space/tab  :realmad: (some of those bugs they fixed were features)

So the challange is to have lisp(possibly with script files) take a list of drawings ( in an ascii file) and run through all of them and run a standard lisp in each drawing and each tab (or a selected list?) presuming that the last person to save the file left it any which way.

Oh! and it needs to run without attention on all drawings from a single start command.

I can post my original if it would be usefull.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: New Challenge Plot all the drawings in one command
« Reply #1 on: April 01, 2006, 11:26:46 AM »
Using this may help you get started :-)
http://www.theswamp.org/index.php?topic=1916.msg37939#msg37939

If you use the Character marker for exclude tabs it will
plot only those tabs but it does not have a feature to use separate page setups.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: New Challenge Plot all the drawings in one command
« Reply #2 on: April 01, 2006, 11:27:51 AM »
Sounds more like a group project than a challenge. Although I guess technically it would be a challenge to make it work. :-)

I would suggest making an outline of what the application is expected to do and prepare some pseudo code to go along with it. I know there is enough talent around here to write the app but you'll have better luck using the group project approach. Maybe give out assignments for the different functions of the app and them assemble them into a working program. Hope that makes sense ...
TheSwamp.org  (serving the CAD community since 2003)

Chuck Gabriel

  • Guest
Re: New Challenge Plot all the drawings in one command
« Reply #3 on: April 01, 2006, 11:30:24 AM »
Am I going to get ground to dust if I suggest VBA is better suited to batch processing work like this?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: New Challenge Plot all the drawings in one command
« Reply #4 on: April 01, 2006, 11:34:28 AM »
Am I going to get ground to dust if I suggest VBA is better suited to batch processing work like this?

Not from me Chuck. :-)  I'd like to see it done in VBA, I might learn something!
TheSwamp.org  (serving the CAD community since 2003)

Chuck Gabriel

  • Guest
Re: New Challenge Plot all the drawings in one command
« Reply #5 on: April 01, 2006, 11:38:49 AM »
I have a VBA generic batch processor that I wrote a year or two ago that I would be willing to share.  It probably isn't a model of good programming style, but it gets the job done.  I think I posted it in a thread here once, but I can't find it.  Maybe I'll just upload it to the new area you set up a few days ago.

RbtDanforth

  • Guest
Re: New Challenge Plot all the drawings in one command
« Reply #6 on: April 01, 2006, 11:42:23 AM »
This is how the origanial worked! still does in V12 dos that I used till v14
( would sitck the command to run the other lisp routines in the script file)

Code: [Select]
(DEFUN C:ATN (/)
         (setvar "ATTREQ" 0)
         (setq fd (open "temp.dta" "r")
               b (read-line fd)                     ;fd 1 dwg file list
               fb (open b "r")   
               cnt (READ(read-line fd)) fd (close fd)       ;fd 2 count & close
               nam (repeat  cnt (read-line fb)) ;nam = next dwg name
               fb (close fb) blist nil atlst nil
               cnt(rtos(1+ cnt) 5 0)
               fs (open "TR.scr" "w") fn (open "temp.dta" "w")
          )
          (write-line b fn)(write-line cnt fn)
          (close fn)  ;write and close temp.dta for next time
           (write-line "lisp command" fs)
            (writel-line "plot <settings >")
          (write-line "END" fs)
          (write-line "2" fs)(write-line nam fs)
          (princ "(load" fs)(prin1"b:steplist" fs)(princ ")\n"fs)
           (close fs) ;write & close temp.scr
           (command "script" "TR")
)

Temp.dta would be an sacii file with the location of the  drawing list and how far down the list it had gotten, then it might hold other data as needed by the other lisps.

As long as "lisp command" did not require user  input the program just ran the list of drawings

Chuck Gabriel

  • Guest
Re: New Challenge Plot all the drawings in one command
« Reply #7 on: April 01, 2006, 11:50:11 AM »
On second thought, I'll just post it to this thread since it isn't exactly the type of thing I think you are looking to go into the VBA functions area.  Here it is.

Put both DVB files in a folder in AutoCAD's support paths, and load BatchProcess.dvb.  There are two public macros.  One for batching ObjectDBX oriented work and the other for everything else.

That's all the explanation I have time for at the moment, as I need to be walking out the door pretty much right now.  I'll check back later.

Chuck Gabriel

  • Guest
Re: New Challenge Plot all the drawings in one command
« Reply #8 on: April 03, 2006, 10:08:43 PM »
R.I.P.

Arizona

  • Guest
Re: New Challenge Plot all the drawings in one command
« Reply #9 on: April 04, 2006, 06:49:58 AM »
I have this one that I use to batch process plotting.
I used the sendcommand for the plot command simply because it already existed.
Also I'm detecting the border/scale so I know what size drawing this is and which printer to send it to.

Oops, I can't attach a .dvb file.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: New Challenge Plot all the drawings in one command
« Reply #10 on: April 04, 2006, 10:53:32 AM »
Oops, I can't attach a .dvb file.

Try it now please.
TheSwamp.org  (serving the CAD community since 2003)

Arizona

  • Guest
Re: New Challenge Plot all the drawings in one command
« Reply #11 on: April 04, 2006, 01:08:23 PM »
ok, here it goes again
To start Run the openform macro.
Point to the directory and let it go.

P.S. Your printers and borders will be different then mine.