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

Name of Dynamic Block Inserts #65

Open
pranavramkrishnan opened this issue Sep 15, 2020 · 6 comments
Open

Name of Dynamic Block Inserts #65

pranavramkrishnan opened this issue Sep 15, 2020 · 6 comments

Comments

@pranavramkrishnan
Copy link

pranavramkrishnan commented Sep 15, 2020

Hey there,

I was wondering if there is a way to get the name of a dynamic block from an inserted instance?

Currently I am getting objects with values such as these:

{
    type: 'INSERT',
    handle: '16D8',
    ownerHandle: '2',
    layer: 'Tracing',
    lineweight: 25,
    name: '*U146',  // <------------- Would like an actual name which I can see in AutoCAD but not in the parsed value
    position: { x: 407.6777181310168, y: 883.6808549083853, z: 0 },
    xScale: -1,
    rotation: 89.99999564094279
  }

Thanks in advance!

@pranavramkrishnan pranavramkrishnan changed the title Name of Dynamic Blocks Name of Dynamic Block Inserts Sep 15, 2020
@Serthys
Copy link
Contributor

Serthys commented Sep 16, 2020

I tried launching the three-dxf sample with the test file and I can see the correct name shown.

Maybe the name '*U146' you see there is Unicode?

@bzuillsmith
Copy link
Member

If AutoCAD shows different block names then we may need a sample file. I don't know if it's stored in extended data or a standard dxf code/value pair.

@pranavramkrishnan
Copy link
Author

pranavramkrishnan commented Sep 16, 2020

I investigated this a bit more.

This is my understanding. When inserting a dynamic block, AutoCad anonymizes the name (*U... like name). However, if you use the BLOCK_RECORD table in the TABLES section, you are able to following ownerHandles to link a particular insert --> block (anonymized name) --> base block (which is named).

I extended the version of dxfParser I had to also parse the block record table which helped with this investigation. More than happy to open a PR for this, but perhaps later versions already have this?

Thanks again!

@bzuillsmith
Copy link
Member

Ah, I see. A PR would be great. There hasn't been any other development on the BLOCK_RECROD table. I'm a little behind on maintaining this repo, but I've been making bits of progress lately and hope to bring in some PRs soon.

@Arnoldnuo
Copy link

I investigated this a bit more.

This is my understanding. When inserting a dynamic block, AutoCad anonymizes the name (*U... like name). However, if you use the BLOCK_RECORD table in the TABLES section, you are able to following ownerHandles to link a particular insert --> block (anonymized name) --> base block (which is named).

I extended the version of dxfParser I had to also parse the block record table which helped with this investigation. More than happy to open a PR for this, but perhaps later versions already have this?

Thanks again!

can you share your code, thank you! @pranavramkrishnan

@MehmetKpln18
Copy link

I see. Some PR would be great.

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

5 participants