question about font and solid object in dxf export
Moderators: SDS, support, admin
question about font and solid object in dxf export
how to add a font and a solid circle to a dxf file when i use dxf export .net to create a dxf file?
thx!
thx!
If you mean text when you say "font" then here is an example of adding the text:
The code below represents an example of adding a solid circle:
please post questions to the forum or write to support@cadsofttools.com
Code: Select all
DXFExport vDXF = new DXFExport();
DXFData Data = new DXFData();
Data.height = 1;
Data.text = "Text";
Data.point.X = 1;
Data.point.Y = -2;
vDXF.AddText(Data);
vDXF.SaveToFile(FileName);
Code: Select all
...
Data.Clear();
Data.color = DXFExport.ColorToDXF(Color.FromArgb(r, g, b));
Data.point.X = 100;
Data.point.Y = 100;
Data.point1.X = 150;
Data.point1.Y = 150;
Data.radius = (Data.point1.X - Data.point.X) / 2;
Data.startAngle = 0;
Data.endAngle = 360;
Data.style = (byte)DXF.HatchStyle.hsSolid;
Data.selfType = (byte)DXF.HatchBoundaryType.hbtCircle;
vDXF.AddHatch(Data);
...
please post questions to the forum or write to support@cadsofttools.com
thx very much for your reply!
about the font,my mean is in DXFExport the default character font is "txt",but i want change it to "Arial",but how?
and i use the Unicode character,the code below
Data.height = 1;
string tmpText = "ExampleText"
tmpText = "{\\f" + fontName + tmpText + "}"; //font name
Data.text = tmpText;
Data.point.X = 1;
Data.point.Y = -2;
vDXF.AddText(Data);
but the result is not correct,why?thx!
about the font,my mean is in DXFExport the default character font is "txt",but i want change it to "Arial",but how?
and i use the Unicode character,the code below
Data.height = 1;
string tmpText = "ExampleText"
tmpText = "{\\f" + fontName + tmpText + "}"; //font name
Data.text = tmpText;
Data.point.X = 1;
Data.point.Y = -2;
vDXF.AddText(Data);
but the result is not correct,why?thx!
We apologize for incorrect code. Try the following code now:
Insert it into the click-handling method of the "Make DXF directly..." button. To select a font other than ARIAL just type the font name right after \\f, for example: \\fTIMES NEW ROMAN.
Best regards,
Igor Tobolov (CADSoftTools support team)
please post questions to the forum or write to support@cadsofttools.com
Code: Select all
Data.rotation = 0;
Data.color = DXFExport.ColorToDXF(Color.SaddleBrown);
Data.height = 1;
Data.text = "{\\fARIAL|i0|b0;TextExample}";
vDXF.AddMText(Data);
Best regards,
Igor Tobolov (CADSoftTools support team)
please post questions to the forum or write to support@cadsofttools.com