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

how to read dxf file content text? #205

Open
farshadvl opened this issue May 18, 2024 · 1 comment
Open

how to read dxf file content text? #205

farshadvl opened this issue May 18, 2024 · 1 comment

Comments

@farshadvl
Copy link

Hi every body

I have a DXF file format that have drawing and text in it.

I want to extract text from this file but I have no idea to do that.

can any one help me?
Uploading 4-FUG-16802-AAR61-N_Sht_1.txt…
Capture

@brettfo
Copy link
Member

brettfo commented May 20, 2024

The top of the README file at the root of this repo has an example snippet of how to read a DXF file and extract some information. In your instance the inside of the foreach loop would look something like this:

switch (entity.EntityType)
{
    // ....
    case EntityType.Text:
        var text = (DxfText)entity;
        // at this point the interesting parts would be things like:
        //   text.Value is the string of the text
        //   text.Location is a point representing the insertion location in the drawing
        break;
    case EntityType.MText:
        var mtext = (DxfMText)entity;
        // at this point the interesting parts would be things like:
        //   mtext.Text is the string of the text
        //   mtext.InsertionPoint is a point representing the insertion location in the drawing
        break;
    // ....
}

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