Author Topic: Block librarian in .net  (Read 2123 times)

0 Members and 1 Guest are viewing this topic.

elliottpd

  • Guest
Block librarian in .net
« 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

TheMaster

  • Guest
Re: Block librarian in .net
« Reply #1 on: March 12, 2012, 09:04:42 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 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 ?

elliottpd

  • Guest
Re: Block librarian in .net
« Reply #2 on: March 13, 2012, 10:14:36 AM »
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.

Draftek

  • Guest
Re: Block librarian in .net
« Reply #3 on: March 13, 2012, 12:18:33 PM »
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.