WblockCloneObjects - ErrorStatus.NotAllowedForThisProxy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello forum,
If I insert a drawing as a block, it works with drawings that contain proxy objects (substitute for a custom object). But when I insert a block from another drawing (and this block contains proxy objects) I get an error "ErrorStatus.NotAllowedForThisProxy". I use the following code:
Insert a drawing as a block (works with proxy objects):
DatabaseSource.ReadDwgFile(StringPath, FileOpenMode.OpenForReadAndAllShare, false, null);
ObjectIdBlock= DatabaseActive.Insert(Path.GetFileNameWithoutExtension((StringPath, ), DatabaseSource, true);
Insert a block from another drawing (error with proxy objects):
DatabaseSource.ReadDwgFile(StringPath, FileOpenMode.OpenForReadAndAllShare, false, null);
BlockTableSource = TransactionSource.GetObject(DatabaseSource.BlockTableId, OpenMode.ForRead) as BlockTable;
ObjectIdCollectionBlock.Add(BlockTableSource[StringBlockName]);
DatabaseActive.WblockCloneObjects(ObjectIdCollectionBlock, DatbaseActive.BlockTableId, iMap, DuplicateRecordCloning.Ignore, false);
The error is thrown by the function "WblockCloneObjects()".
Both versions are processing the same proxy object.
Why does the first version work ok with proxy objects, and the second one throws the error "ErrorStatus.NotAllowedForThisProxy"?
Thank you.