Prod.: Engine, ver.: 6011, ID: 60000447, General : OnAddItem , OnAfterAddItem of vdDocument and AfterAddEntity , AddEntitity of vdraw.ocx wrapper are not fired during the open command

General : OnAddItem , OnAfterAddItem of vdDocument and AfterAddEntity , AddEntitity of vdraw.ocx wrapper are not fired during the open command

Article60000447
TypeGeneral
ProductEngine
Version6011
Date Added3/9/2008
FixedYes [3/11/2008]
Submitted bySheena Konikkara
Keywords

Subject

OnAddItem , OnAfterAddItem of vdDocument and AfterAddEntity , AddEntitity of vdraw.ocx wrapper are not fired during the open command

Summary

OnAddItem , OnAfterAddItem of vdDocument and AfterAddEntity , AddEntitity of vdraw.ocx wrapper are not fired during the open command

Solution


Developer must enum between added items and mark them as deleted if he do not want them to be added.

Example of deleted all Xrefs after the Open command.

vdDocument.Open("drawing.xml");

vdPrimariesList primaries = vdDocument.GetPrimaries(true);

foreach( vdPrimary obj in primaries) if(obj is vdInsert && ((vdInsert)obj).Block.IsXref) obj.Deleted = true; // mark all the vdInsert reference Xref blocks as Deleted

foreach(vdBlock blk i n vdDocument.BLocks) if(blk.IsXref) blk.Deleted = true;//Mark all Xref blocks as deleted.

vdDocument.ClearEraseItems();//clear the undohistory , remove the deleted items from the collections