cart: empty [ Login ]

Issues with Reading and Writing DWG Files & Parsing DWG to PNG

1 2  next > 
yonatan.giv
5/15/2023 8:53 AM

I am currently facing two challenges related to working with DWG files, and I would greatly appreciate your assistance in resolving them. The issues I'm encountering are as follows: -- notice that right now I'm using the trial version (CadLib 6.0) 1. Reading and Writing DWG Files: I am experiencing difficulties when attempting to read a DWG file and then write it to a new DWG file. Despite following the necessary steps, I'm encountering errors or unexpected behavior during the process. It seems that the data or formatting may not be preserved correctly, resulting in issues with the new DWG file. If anyone has experience or insights into working with DWG files and could provide guidance on how to handle this situation, I would be extremely grateful. Simple C# Code example: DxfModel model = CadReader.Read("blocks_and_tables_-_imperial.dwg"); string filename = "test1.dwg"; DwgWriter.Write(filename, model); **** Exception -> System.NullReferenceException: 'Object reference not set to an instance of an object.' when I try to create a new file and 'Write' it, it does work. 2. Parsing DWG to PNG: Another challenge I'm facing is related to converting DWG files to PNG format. Whenever I parse a DWG file to generate a PNG image, I consistently observe an orange color overlay in the resulting image, along with the text "cadlib evaluation version" appearing within the image itself. This is unexpected behavior, and I would like to understand why this is happening and find a solution to obtain accurate PNG representations of the DWG files. If any of you have encountered similar issues or have expertise in parsing DWG files to PNG, I would greatly appreciate your insights and recommendations. Simple C# Code example: var model = CadReader.Read(@"example.dwg"); var bitmap = ImageExporter.CreateAutoSizedBitmap<Bgra32>(model, Matrix4D.Identity, GraphicsConfig.WhiteBackgroundCorrectForBackColor); using (Stream stream = File.Create(@"test.png")) { bitmap.SaveAsPng(stream); } Thank you in advance for your time and assistance. I look forward to your responses and engaging in a fruitful discussion.

Wout
5/15/2023 1:34 PM

Hi, 1) Can you e-mail me the DWG file? 2) The orange color is a limitation of the trial version. - Wout

yonatan.giv
5/15/2023 2:04 PM

tnx, sure, what is your mail ?

Wout
5/15/2023 2:23 PM

Hi, It's wout@woutware.com. - Wout

Wout
5/16/2023 10:02 AM

Hi, Are you using the 6.0 Windows or 6.0 multi-platform version? - Wout

yonatan.giv
5/16/2023 11:48 AM

6.0 Windows

Wout
5/16/2023 7:32 PM

Hi, I can't reproduce it in the latest version that was released May 2, can you try the latest version? - Wout

yonatan.giv
5/21/2023 7:01 AM

im using 6.0.0-rc29, it isnt the last version ?

Wout
5/21/2023 8:46 AM

6.0.0-rc35 at the moment is the latest version (you can easily check this either on www.nuget.org/packages/WW.Cad_Net6.0/ or in Visual Studio). - Wout

yonatan.giv
5/21/2023 10:34 AM

Even after updating the library, I continue to experience difficulties. in the message property: 1.{Error: InvalidName, for objects invalidChar = (type: Char), name = Lighting fixture (type: String), target = Lighting fixture (type: DxfBlock)} 2. {Error: InvalidName, for objects invalidChar = (type: Char), name = Faucet - top (type: String), target = Faucet - top (type: DxfBlock)} . . .

1 2  next >