TheSwamp
Code Red => .NET => Topic started by: elliottpd on March 12, 2012, 04:51:12 PM
-
I am planning to write a block librarian/insertion program that works like the Design Center. The blocks are contained within various 'source' drawings. It would work like a legacy image menu, except that instead of slides, I would use the block bitmaps for previews. I need to control the drawings that are accessed, as well as the insertion process with .net. Has anyone else written a library program (block manager) that works like this? Can you offer any advice, or share any code directions? I could use some input.
Thanks in advance,
Pete Elliott
-
I am planning to write a block librarian/insertion program that works like the Design Center. The blocks are contained within various 'source' drawings. It would work like a legacy image menu, except that instead of slides, I would use the block bitmaps for previews. I need to control the drawings that are accessed, as well as the insertion process with .net. Has anyone else written a library program (block manager) that works like this? Can you offer any advice, or share any code directions? I could use some input.
Thanks in advance,
Pete Elliott
I wrote something long ago in ActiveX/Delphi that took the form of a Palette Set with a ListView control that showed block icons in large icon mode. Back then, there was no .NET and because I was using Delphi/ActiveX, I had to use the AcadDockableContainer, that I later collaborated on with Jorge Lopez.
That wasn't too hard to do, but AutoCAD-style drag & drop is a bit more involved. There are ways of fooling AutoCAD into thinking that the object being dragged is coming from the same (or a different) drawing, which will cause it to draw the objects, just as they're drawn when dragged from a another drawing, or a tool palette . If you take the inexpensive route, you will not see the objects drawn while you drag them (the inexpensive route being essentially a generic file drag & drop operation).
Here's a good source of information on file drag & drop:
http://blogs.msdn.com/b/adamroot/archive/2008/02/19/shell-style-drag-and-drop-in-net-wpf-and-winforms.aspx
Out of curiosity, why not use Tool Palettes ?
-
Thanks for the info. The reason I don't want to use tool palettes is the difficulty of distributing them to a hundred users. I have written a prototype that functions, but the slow speed makes it un-usable. I have thousands of blocks distributed unevenly through about twenty-five source drawings. So I'm looking for alternate ideas. I haven't yet implemented drag and drop. Currently the library selector passes off the selected block/path info to a block insertion program that jigs the block into place.
-
I've got a couple of applications that do something similar.
You can save the file to a temp location and then utilize drag & drop or WblockCloneObjects() from the database and use your jig.