TommyG Posted January 4, 2009 Posted January 4, 2009 I have created a block preview dialog box, which is automatically populated from a particular directory. I find it easier to administer, as each time I add/remove/update a file, the dwgthumbnail is updated, and the listbox that is populated from the directory is done automatically too. The routine remembers the current layer, changes the layer to one i specify, inserts the block, puts the layer back. If i put in a comment on the dwg's properties, a label at the bottom of the form is populated with that information as well. anyways, my issue is, I would like to know how to array (right term?) the dwgthumbnail preview automatically, kind of like the slide library, but with less administration time. I figure the form would need to count how many files exist in that dir, and then for each of the files in that dir, the dwgthumbnail would automatically populate (for example) 5 columns by however many rows it would need. This is the part I am having trouble with.... any ideas? Quote
Lee Mac Posted January 4, 2009 Posted January 4, 2009 First and foremostly, Welcome to CADTutor Tommy, hope you'll like here. I don't think I can answer your question myself - as I do not have any knowledge in dialog box creation - however, this may help: http://www.cadtutor.net/forum/showthread.php?t=30880 Quote
TommyG Posted January 4, 2009 Author Posted January 4, 2009 thanks for the welcome, i hope to be of some service, and get some knowledge for myself too Quote
Lee Mac Posted January 4, 2009 Posted January 4, 2009 thanks for the welcome, i hope to be of some service, and get some knowledge for myself too There are so many knowledgeable people on here - you can learn bundles, as I have found out Hope the link was helpful. Quote
TommyG Posted January 4, 2009 Author Posted January 4, 2009 sorry, im doing it in VBA, it wasnt much, but i have so far got it to count the files in the dir, i just gotta array dwgthumbnail.ocx and all should be sweet. we have another office who insists on using autocads dwg explorer, but it doesnt help with setting layers or any other variables once the block is inserted. Quote
Lee Mac Posted January 4, 2009 Posted January 4, 2009 Ahh, ok - wasn't sure if it was VBA you were doing it in or not - no worries For the office using the in-built ACAD Insertor, I suppose you could use a drawing clean-up LISP that would put all the blocks in the drawing onto the correct layer after you have finished with the drawing. Quote
BIGAL Posted January 5, 2009 Posted January 5, 2009 Just a suggestion if you do about 5 rows you probably only want 5 columns max. if the form autosizes to fit with more squares you will not be able to make out the images. From past experience I made 2x2 3x3 4x4 & 5x5 6x6 is probably ok Each is an individual form so check number of dwgs and then use correct form as well as "next" eg 30 dwgs use 5x5 =25 "next" use 3x3 Just a side issue I have stayed with slides as these allow me to zoom in on the block and have layers off hacked the block making the object clearer to standout before making the slide. Quote
TommyG Posted January 5, 2009 Author Posted January 5, 2009 i am planning on 3-4 columns, with the rows automatically counted from that, so if there are 64 files, with 4 columns, it would make 16 rows, 65 files, would make 17 rows (16 rows with the 17th have one thumbnail) but dwgthumbnail.ocx doesnt have a similar ability to picture (correct?) where you can specify a row and columns, and a spacing? ive already got the file count, so dwgthumbnail1.dwgfilename to dwgthumbnail64.filename, and the dwgthumbnail2.left value would be dwgthumbnail1.value + the size of the thumbnail and a little bit for a gap. so for 3 and 4 it would be similar, and then 5-8 would be the same as 1-4 with a change in the "Top" value and so forth.... but, i dont know, at the moment, to tell VBA that the first filename is dwgthumbnail1.dwgfilename, and the 2nd is dwgthumbnail2.dwgfilename etc and so forth, and at the same time, telling it to work out how many rows it would need to make.... is it along the lines of dynamic arrays? I have a thumbnail already in a frame, and the frame will put in a vertical scroll bar. i just see it as a way of making the administration easier, put the file in the dir and there is zero coding to get the blocks browser to work. if i continue with slides, then there is making the slide, doing the library etc... one file-copy and its already done. Quote
BIGAL Posted January 6, 2009 Posted January 6, 2009 Just a thought if using slides why not use autocad to write the menu code ? It does not matter then how many files in a directory or list of directories the only coding needed. The mnu file is only a text file ? You would first pick new drawings make new slides then just write the menu file a quick menu unload and reload all done. You are right it takes a while to write the menus I use a few tricks from the operating system command line and inside Word to create the files check ^p in search replace. The slides take the longest but depending on your blocks I did 200 in one go using a script watch the screen blink! The advantage is autocad automatically displays them for you and puts next page etc in. If your getting up around 60 blocks why wouldn't you start to break down your block library into smaller common groups to display. I will definately look at writing a program next time Quote
Recommended Posts
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.