Author Topic: XBlock  (Read 2825 times)

0 Members and 1 Guest are viewing this topic.

jbuzbee

  • Swamp Rat
  • Posts: 851
XBlock
« on: November 20, 2008, 09:05:45 AM »
OK, guys and gals.  This was my last OpenDCL project - XBlock.  Basically a Block that "references" an external definition of a block (not a drawing).  So the block can be dynamic, and have attributes.  I don't have the time to finish it so I thought I'd post it here for anyone who wants to work with, dissect, destroy, what ever.  It's got some documentation - but I'm bad about that - so it's actually alot for me!

What XBlock is supposed to do:
XBlock provides a palette form with a List of "attached" blocks with buttons to attach, reload, and detach said blocks.  I have the attach pretty much done.  It attaches xdata to the block with the date / time it was attached with the block name, reference drawing name and path.  I was going to provide a little alert box when a drawing was opened that let the user know if the reference drawing had been changed.  Never got to that.

Reload:  I got stumped at the dynamic part.  I found code here at the swamp but didn't have time to figure it all out.  If you've already figured out how to manipulate dynamic blocks with lisp you'll be way ahead of the game.  The way the reload function works is it renames the existing block to "MyBlock-old".  It then uses the xdata block name, drawing name and path to objectdbx import the block.  The replacing, deleting old block works like a charm - it's just the part about merging the dynamic property settings that I haven't figured out.  I mean, I figured out the process: while iterating through the blocks collection, I save the dynamic properties to a var, but then once the block is swapped I can't use that list to update.  I think I'm not saving the data in the right format.  COme to think of it, I don't think I'm attaching the updated xdata to the recently imported "reloading" block.  So don't forget to do that.

I'm not completely happy with the attach dialog.  You've got alot of options there.  In it's current state, it needs the path to the previously opened drawing saved to the registry so that when it's called again, your not looking at a blank list.

Well, that's all I can think of right now.  I really wanted to finish this, but the time no longer exists.  I'll try to check back from time to time.  If you send me a PM I might not answer - I always forget that thing is there.

Well, enjoy.
James Buzbee
Windows 8

whdjr

  • Guest
Re: XBlock
« Reply #1 on: November 20, 2008, 09:36:21 AM »
Not sure if this is any way part of what your trying to accomplish but I put this together a while back to reload Dynamic Blocks.