If you haven't seen it, you should check out the post here: //through-the-interface.typepad.com/through_the_interface/2006/08/import_blocks_f.html
I took the http: off the front because this forum always screws up and adds a %20 character where it doesn't belong when you paste a link, so just copy it to your address bar and put the http: back on.
What it should show you is the proper way to set up the WBlockClone. When I got the eWrongDatabase error, it just about drove me crazy until I looked closer at the example and found that the TransactionManager used to create the transaction for the WblockClone had to come from the Source Database, where the objects are being cloned from.
My code is like the post, using a "side database" , not an Xref, so I'm not sure about any complications there.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<I'd
href="mailto:michael.seiler@gapac.com">michael.seiler@gapac.com> wrote
in message
href="news:6077336@discussion.autodesk.com">news:6077336@discussion.autodesk.com...
like to copy some blockreferences from an xref into the uppermost parent
drawing. I've tried using DeepCloneObjects and gotten an eWrongDatabase
message, and I've tried WblockCloneObjects and gotten an eInvalidOwnerObject
error. In this instance, I've tried getting a handle to the xref db (sourceDb)
through the XrefGraphNode object. The objId collection was built by
enumerating through the host drawing block table however, and drilling into
the xref from there, is that what I'm doing wrong?: Dim mapping As IdMapping =
sourceDb.WblockCloneObjects(oidColl, hostDb.BlockTableId,
DuplicateRecordCloning.Replace, False) Any other suggestions? Thanks for the
time, Mike