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

Add Aligned Dimension with text above the dimension line and how to increase text size? #189

Open
git1510 opened this issue Sep 27, 2022 · 1 comment

Comments

@git1510
Copy link

git1510 commented Sep 27, 2022

hello, I am new in Dxf and also new with this library. I have tried to draw aligned dimension as below code but dimension text plot in center of line.

public void TestDimension()
        {
		DxfFile file =  new DxfFile();
            file.Clear();
            file.Header.Version = DxfAcadVersion.R2018;
            //file.Header.TextAboveDimensionLine = true; // Not Working
            //file.Header.DimensioningTextHeight = 20; // Not Working
            // file.Header.DimensionTextJustification = DxfDimensionTextJustification.AboveLineCenter; // Not Working

            DxfLine dxfLine = new DxfLine(new DxfPoint(0, 5, 0.0), new DxfPoint(10, 5, 0.0));
            file.Entities.Add(dxfLine);

            DxfAlignedDimension dxfAligned = new DxfAlignedDimension();
            dxfAligned.DefinitionPoint1 = dxfLine.P1+ new DxfPoint(0, 5, 0.0); // distance
            dxfAligned.DefinitionPoint2 = dxfLine.P1; // point 1
            dxfAligned.DefinitionPoint3 = dxfLine.P2; // pont 2
            dxfAligned.Text = "Demo Aligned Dimension";
            file.Entities.Add(dxfAligned);

            // save file
            file.SaveDxfFile();
        }

Please correct if i am wrong in above code and please help me for below points:
1. Text above dimension line
2. Increase dimension text hight
3. How to drawing DataTable (by using DxfDataTable)
4. How to drawing center line

Please make example of above points that's good for me and another developer also.
Thanks in advance for your helping hands.

@lork6
Copy link

lork6 commented Nov 22, 2022

I could be wrong because, I did not test it. But text Height is stored in styles, and scaling text maybe could be done by: dxfAligned.linetypescale = 2;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants