You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. Please excuse my poor English.
I have encountered a situation where the DWG output is normal and the DXF output has an error when I open the output file, even though they are the same code.
I tried the following sample code and found out that the cause is that when I output a Hatch with Polyline as Path, it outputs two “72” (if I delete one “72”, it opens normally).
Is this a problem with the way I wrote the code?
I would appreciate it if you could check.
CadDocument doc = new CadDocument(ACadVersion.AC1032);
var modelSpace = doc.ModelSpace;
string blockName = Guid.NewGuid().ToString();
var block = new Block(new(blockName));
var blockRecord = new BlockRecord(new(blockName));
var insert = new Insert(blockRecord);
modelSpace.Entities.Add(insert);
var hatch = new Hatch()
{
Pattern = HatchPattern.Solid,
Color = new ACadSharp.Color(0, 0, 0),
IsAssociative = false,
IsSolid = true,
PatternType = HatchPatternType.SolidFill,
IsInvisible = false,
Style = HatchStyleType.Normal,
};
var path = new Hatch.BoundaryPath
{
Flags = BoundaryPathFlags.External,
};
path.Edges.Add(new Hatch.BoundaryPath.Polyline()
{
Vertices = [new(0, 0, 0), new(0, 5, 0), new(5, 5, 0), new(5, 0, 0)],
IsClosed = true,
});
hatch.Paths.Add(path);
blockRecord.Entities.Add(hatch);
using (DxfWriter writer = new DxfWriter("C:\\testdata\\test.dxf", doc, false))
{
writer.Write();
writer.Dispose();
}
The text was updated successfully, but these errors were encountered:
Hello. Please excuse my poor English.
I have encountered a situation where the DWG output is normal and the DXF output has an error when I open the output file, even though they are the same code.
I tried the following sample code and found out that the cause is that when I output a Hatch with Polyline as Path, it outputs two “72” (if I delete one “72”, it opens normally).
Is this a problem with the way I wrote the code?
I would appreciate it if you could check.
The text was updated successfully, but these errors were encountered: