cart: empty [ Login ]

Set Transparency to "ByBlock"

1 
RC Dev
7/25/2018 8:40 AM
Hello At first: Maybe I'm doing something wrong, but it looks like a bug for me. I have a block and some entities within this block and I want to set all possible properties of these entities to "ByBlock". This works for the Color, Linetype, etc. but unfortunately not for the Transparency property. Here is a little example code for testing:
C# Code:
DxfLine line1 = new DxfLine() { Start = new Point3D(0, 0, 0), End = new Point3D(10, 0, 0), Color = EntityColor.ByBlock, Transparency = Transparency.ByBlock }; DxfLine line2 = new DxfLine() { Start = new Point3D(0, 1, 0), End = new Point3D(10, 1, 0), Color = EntityColor.ByBlock, Transparency = Transparency.ByBlock }; DxfBlock block = new DxfBlock("TestBlock") { Entities = { line1, line2 } }; DxfInsert insert = new DxfInsert(block); DxfModel model = new DxfModel(DxfVersion.Dxf24) { Blocks = { block }, Entities = { insert } }; DwgWriter.Write(@"D:\Work\TransparencyByBlock.dwg", model);
The Color is set correctly but the Transparency is set to "ByLayer" (default) instead of "ByBlock". Thanks for having a look and regards
Wout
7/26/2018 1:45 PM
Hi, You're right, this was indeed a bug in the DWG writer. You can download the new CadLib 4.0 version that fixes the problem. Thank you for the report! - Wout
1