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

Dimension in autocad #78

Open
lroyer-star opened this issue Jul 18, 2024 · 0 comments
Open

Dimension in autocad #78

lroyer-star opened this issue Jul 18, 2024 · 0 comments

Comments

@lroyer-star
Copy link

lroyer-star commented Jul 18, 2024

Hello,
Thanks for the great work on this repo.
Today, i'm facing an issue with dxf and dimension.
I tried to write a dxf file with two lines and a dimension by inserting this code in example writer ( https://github.com/rvt/dxfrwtest) :


` virtual void writeEntities()
    {
        DRW_Line line;
        line.basePoint.x = 10;
        line.basePoint.y = 20;
        line.secPoint.x = 30;
        line.secPoint.y = 30;
        dxfW.writeLine( &line );

        DRW_Line line2;
        line2.basePoint.x = 0;
        line2.basePoint.y = 0;
        line2.secPoint.x = 0;
        line2.secPoint.y = 30;
        dxfW.writeLine( &line2 );

    // Create and configure a linear dimension
    DRW_DimAligned dimLinear;
    dimLinear.type = DRW::DIMENSION;
    dimLinear.setStyle( "Standard" );                       // Dimension style
    dimLinear.setDefPoint( DRW_Coord( 10.0, 10.0, 0.0 ) );  // Definition point
    dimLinear.setTextPoint( DRW_Coord( 15.0, 10.0, 0.0 ) ); // Text midpoint
    dimLinear.setDef1Point( DRW_Coord( 10.0, 10, 0 ) );     // Extension line 1 start point x
    dimLinear.setDef2Point( DRW_Coord( 10.0, 20, 0 ) );     // Extension line 1 start point x

    dxfW.writeDimension( &dimLinear );
}`

The file is well generated and can be opened properly in LibreCad, unfortunately, the dxf file seems to be not compatible with autocad. Do I miss something ? please let me know if you have any idea or if you have a writer example that works with autocad and dimension.

I have attached the dxf file ( to .txt here)
file.txt

Thanks again,

Lucas

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

1 participant