Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you give the example to write sample_AC1032.dwg #164

Closed
gf0126 opened this issue Sep 8, 2023 · 1 comment
Closed

Can you give the example to write sample_AC1032.dwg #164

gf0126 opened this issue Sep 8, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@gf0126
Copy link

gf0126 commented Sep 8, 2023

Hello,I want to write dwg files using this api. But when I use the IOExmaple to read the sample_AC1032.dwg to a new file ,the new file has no graphic so it can not be opened by AutoCAD.

Can you give the example to write your sample_AC1032.dwg?

Thank you for your time !

@DomCR
Copy link
Owner

DomCR commented Sep 11, 2023

Hi @gf0126,

The version AC1032 is not implemented in the writer yet, you can convert the file into a dxf or downgrade the dwg version to AC1018 which is the most stable at the moment, is specified in the README on the main page of this repo.

To downgrade the dwg just change the version in the header like:

public static void ReadDxf(string file, string output)
{
	using (DwgReader reader = new DwgReader(file))
	{
		reader.OnNotification += NotificationHelper.LogConsoleNotification;
		CadDocument doc = reader.Read();

		doc.Header.Version = ACadVersion.AC1018;
		DwgWriter.Write(output, doc);
	}
}

You can try and see if this works for you, but be noticed that the DwgWriter is in a early stage, which means that you may suffer a loss of information or entities, I would recommend to save the file in a dxf by the moment.

@DomCR DomCR added the help wanted Extra attention is needed label Sep 11, 2023
@DomCR DomCR closed this as completed Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants