PDA

View Full Version : Update Q



n8wex
2009-09-15, 12:57 PM
Im using the DB.WblockCloneObjects which works fine if i set the new active doc.

When I run the code without setting the active document the objects only display after I close and reopen the drawing. Is there an update method Im missing?




Using acLckDoc As DocumentLock = objDoc.LockDocument()

Using acTrans1 As Transaction = acDB.TransactionManager.StartTransaction()

Dim acBlkTbl As BlockTable
acBlkTbl = acTrans1.GetObject(acDB.BlockTableId, OpenMode.ForRead)


Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = acTrans1.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForRead)

Dim acIdMap As IdMapping = New IdMapping()
acCurDb.WblockCloneObjects(acObjIdColl, acBlkTblRec.ObjectId, acIdMap, DuplicateRecordCloning.Ignore, False)

acTrans1.Commit()

End Using

End Using



objDoc is open but not active.

Thanks.

RobertB
2009-09-15, 03:26 PM
Have you tried a Regen?

n8wex
2009-09-15, 10:28 PM
Yeah I tried that

n8wex
2009-09-17, 02:28 PM
Um its called from a user control on a pallet from the following command.



<CommandMethod("FF")> _
Public Sub ShowPalette()

Dim ps As PaletteSet = Nothing
ps = New PaletteSet("FloorSurfer")
ps.Size = New Size(200, 600)
Dim myPalette As UC_Pallete = New UC_Pallete()

ps.Add("FloorSurfer", myPalette)
ps.Visible = True
ps.Dock = DockSides.Right
End Sub


Would this make a diff? Thanks.

n8wex
2009-09-18, 08:47 AM
Cheers I might be better off wblocking and inserting in the background drawing or is there a better method? thanks!

n8wex
2009-09-20, 03:10 AM
Thanks Tony. dotNet is more than enough for me to handle right now...

n8wex
2009-09-27, 03:29 PM
Tony I'd like to try this so I did the following:

1. created new C++ Class Lib
2. Copied the code into the MixedMode.h
3. Added references to AcDbMgd.dll + AcMgd.dll
4. Ran the build and I get the errors attached.

What am I missing?

Thanks again.

n8wex
2009-09-29, 02:37 PM
You have to use the ObjectARX Wizard to create the project/solution.

It does a lot of the grunt work of correctly configuring the project for you
(which I don't really have time to get into, sorry).

Ok thanks Tony will give it a run.