wblock method isfailing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am facing problem with wblock method call.
We have created custom objects, derived from “AcDbCurve” and overridden “wblockCloneStd” for our custom entities.
There, at the end of “wblockCloneStd”, we call “AcDbCurve::subWblockClone”. But sometimes it returns “ewasErased”. Our code does not set “ewasErased” status for custom entity, neither “subErase” of that custom object is executed.
But wblock call fails with return status “eInvalidKey” when “AcDbCurve::subWblockClone” returns “ewasErased”.
Our complete work flow is, as follows -:
Through our AutoCAD based software, user adds source drawings (not as xRefs) to main drawings.
Here code creates block containing all entities from source drawing and add that block to the main drawing. So if there are 2 source drawings then 2 blocks will be added to main drawing.
When user makes visible any particular drawing, then block is exploded and entities are added to the main drawing and made visible.
Later user selects option Publish.
In publish, we creates new drawing for each source drawing.
Here the entities from main drawing are added to the new drawing using wblock command.
Here wblock is failing for some entities.
Some other scenario where source drawing entities are not made visible (i.e. block creation & explode part does not executed in this case) then entities from source drawings are copied successfully to the new drawings, without any issue.
Another case, when source drawing entities are made visible in main drawing and then if main drawing is saved (File -> save option) before publish, then wblock is working fine for all entities. Our overridden method “wblockCloneStd” does not return status as “ewasErased” for any entity, in this case.
So I think problem is with making visible source drawing entities in main drawing and using unsaved main drawing in publish.
But I need to figure out what exactly should be done so that wblock will be successful always (irrespective of making visible source drawing entities in main drawing / saving main drawing)
Please help me in finding out why I am getting eWasErased from “AcDbCurve::subWblockClone” and how can I avoid that so that wblock command will work fine for all our custom objects.
Thanks and regards
ND.