ML

That did not quite get it, then I looked at the acad example as wellI started to screw with it a bit then thought I best just finish "this time" manuallyI had to do it with 77 blocks

OK, so I finished that task, next time, I need to have an automated way of getting it.

If I get a few minutes this afternoon, I will look at it more.

Bob, would the bound box be similar to drawing a rectangle around the whole blockref?

If so, that is precisely what I need.

I see that you did the required math to capture the midpoint, I will need to expound; I think it would be good if when I select the blockref, that midpint will become my picked point, then I can move the blockref right into place.

I see that you did the required math to capture the midpoint, I will need to expound; I think it would be good if when I select the blockref, that midpint will become my picked point, then I can move the blockref right into place.

Think it can be done?

yep. You can, after selection, prompt for a "move to point," then move it programatically.

Bob Wahr

Glad you like it. I would still throw in some error handling if I was you. I stripped out what was in the one I started with though don't ask me why. I had a couple of minutes before class started this evening and was able to knock it out. It actually wouldn't hurt to rewrite the whole thing if you get the time. Having come from a larger, screwier routine, it could be more clean.

Bob Wahr

I've got a vba routine at the office that writes scripts, or purports to at any rate, I don't think I ever tried it. My counterpart in one of our other offices turned it up a while back. I always do mine manually.

I go to a command prompt

dir *.dwg/b>whatever.scr

open it in notepad

paste

down arrow

paste

down arrow

lather

rinse

repeat

Not the most efficient way, but it works and it's one of those old dog/new trick things. PM me monday morning and I'll dig it up, if you want it.

Side Note:How many people here have ever written a text file with copy con>filename.txt then editted it with edlin?

ML

BOB,If you want to try to use that vbs file, don't rename the file, just browse to the directory that you want to write from/to and the temp file will get overwritten with a file from DOS called temp.As I said, it needs work but it gets the job done.

After the data is written out, you can then rename the file to whatever

Mark

Logged

Bob Wahr

re: slidelib, yes I use itre: vbscript - I've done a bit of stuff but not a lotre: the template, send it to me. Not sure if I'll have any time to mess with it next week but I might. I don't see a way to make a slide via vba other than sendcommand and mslide which is unfortunate.

Logged

ML

Yes, that is a share that you can not do mslides from VBA, via the API but at least we can do something with the sendcommandI think acad considers image tiles legacy when in fact, I think they are still a great asset

Once the symbol library is done, if you want to add a slide, you just mslide the new block out, add the slide name to the .txt file and run slidelib again from DOS to re create the library.

I think you probably assumed by now that the code that you wrote for me was to center each blockref into the respective vport.

With that code, you can insert all of your blocks into the template I have, then quickly center each block into its respective vport.

The very first vport was created by doing a zoom extents, then drawing the viewport.After that, I just arrayed the vport across and down.

After you freeze the viewports, you have to go into each one and select update layers, then acad will remember that the frozen state is the current layer state. This way when you make the slides via a script or however, the vports will be frozen in each slide.The only time you would really need to do an update layers on a vport again is if you add one ( I think) but definitely if you have to re scale the vports for a new batch of blocks. I had to do that once and an update layers was necessary.

Hmmmm.there may be a way in VBA to update all vports at once; didn't think of that.

vb-scripting:As far as vb-scripting, I love it. It has so many great uses.I think the cool thing is that you can incorporate it into VBA as well as using it stand alone in a .vbs file.In which case only a double click is necessary.

Off topic a bit:Myself and CM have had a few debates with vbs.I know that VBA has a way to write out to .txt files but I love the The textstream method in The File SystemObject of vbs.I would not say that one way is better then the other but I will say that the textstream method with FSO is certainly a lot more flexible as I can employ it from outside of AutoCAD. Anyone that has seen some of my code has seen that I like to mix it up.Not to mention that, if I do the vbs code in ACAD-VBA, I can copy the code snippets to vbs and do some things.Again, that is all a personal preference.

Hey Bob, I found a great "free" program on line; it is called vbseditIf you want to buy it, I think it is like $47 but you can also just keep hitting evaluate if you'd like.www.vbsedit.com

It has a built in debugger, tons of examples that you can use immediately plus it uses intellisense like VBA which is outstanding.It also allows you to put your own code snippets in to be saved for later use.There is also an output window that works just like locals does in VBA.For anyone that wants to learn VB-Scripting quickly, this program is great.To get around the evaluate message, I use the program for code examples, getting methods and debugging, then I switch over to another editor for easy tweaks, that don't require me to run the code from vbsedit.It is certainly worth the $47, I may even go ahead and buy it.Anyhow, I would definitely strongly suggest any serious programmer to at least check it outI am not sure about Visual Studio because I do not own it but these features for Vb-scripting be built into there as well.