Author Topic: Inserting blocks with XDATA on Attributes is dependent on ATTREQ & ATTDIA  (Read 2748 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6150
I am having a issue with built-in AutoCAD INSERT command  not adding XDATA to AttributeReferences contained on AttributeDefinitions
I hoping some of would test in 2019 or 2020 by setting ATTREQ = 1 & ATTDIA = 1 and see XDATA is added to AttributeReference. I figured most of you have MgdDbg installed to be able to see XDATA on AttributeReference, or maybe built in way that I am not aware of.

To test you just need drawing with a block containing an attribute with XDATA on the AttributeDefinition.
I have uploaded a drawing for testing if needed that has one block with attribute that I added XDATA using Express Tools AttachXdata. It also has some text with fields pointing to ATTDIA & ATTREQ to be able to see settings.

I have tested both 2020 & 2019 and get the same result. I am not sure if the issue is caused by a combination of other settings but so far this is what I have found

Here are steps to test using attached drawing as an example with block named C
Code: [Select]
Set ATTREQ = 1
Set ATTDIA = 1
INSERT C
Use MgdDbg to snoop inserted BlockReference and look Attributes collection and see if XDATA is null on the AttributeReference

Set ATTDIA = 0 or ATTREQ = 0
INSERT C
Use MgdDbg to snoop 2nd inserted BlockReference and look Attributes collection and see if XDATA is now on the AttributeReference

Below is screencast showing doing all 4 combinations of settings in 2020 if explanation was not clear.
ATTREQ & ATTDIA with ATTRIBUTES

To summarize
When ATTREQ = 1 & ATTDIA = 1 then XDATA is NOT copied from AttributeDefinition to AttributeReference when inserting BlockReference
If  ATTREQ = 0 then it will add XDATA no matter setting of ATTDIA.
If  ATTREQ = 1 then ATTDIA =0 for it add XDATA
And to reiterate I am not sure if any other settings might also be causing this behaviour.

Here is another screencast done yesterday with 2019 to try help explain problem to someone else
ATTDIA & XDATA
« Last Edit: November 26, 2019, 09:59:38 PM by Jeff H »

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Inserting blocks with XDATA on Attributes is dependent on ATTREQ & ATTDIA
« Reply #1 on: November 27, 2019, 09:15:16 PM »
I was able have this behavior confirmed, and also he discovered dragging a block from design center will not add xdata. no matter what variables settings.

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Inserting blocks with XDATA on Attributes is dependent on ATTREQ & ATTDIA
« Reply #2 on: December 05, 2019, 07:34:29 PM »
Pretty odd. On a slightly different note, I have never figured out how to add the xdata (as listed in the block) to the blockref when using code to insert. I have always added it to the blockref separately.