Author Topic: Xdata in nested entities  (Read 1962 times)

0 Members and 1 Guest are viewing this topic.

velasquez

  • Newt
  • Posts: 195
Xdata in nested entities
« on: April 28, 2016, 09:03:52 AM »
I can get xdata code type "Code 1011, 3D World space position:" nested entities in a block.
But the coordinate is not updated.
You can get the updated value without exploding the block?
Has anyone worked with this?
I posted a drawing with the data.
Code: [Select]
* Registered Application Name: mytest
* Code 1002, Starting or ending brace: {
* Code 1000, ASCII string: Testing
* Code 1012, 3D World space displacement: (8 0 0)
* Code 1002, Starting or ending brace: }

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Xdata in nested entities
« Reply #1 on: April 28, 2016, 09:35:01 AM »
You can get the updated value without exploding the block?
No.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Xdata in nested entities
« Reply #2 on: April 28, 2016, 10:13:42 AM »
XDATA stored on entities inside the block are actually on entities in the block definition.  Any kind of "displacement" or "transform" would have to be modified by information from the actual insert.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

velasquez

  • Newt
  • Posts: 195
Re: Xdata in nested entities
« Reply #3 on: April 28, 2016, 11:45:04 AM »
XDATA stored on entities inside the block are actually on entities in the block definition.  Any kind of "displacement" or "transform" would have to be modified by information from the actual insert.

Xdata inserted into the sample design of the green lines are not modified when it is inserted into another drawing.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Xdata in nested entities
« Reply #4 on: April 28, 2016, 12:54:11 PM »
To help you understand the fundamentals behind this try the following:
1.
Insert the block two times in different locations with different scale factors.
2.
Use (entget (car (nentsel))) and each time select the same nested element in both inserts.
3.
Compare the entity lists.
4.
Notice: identical lists.

velasquez

  • Newt
  • Posts: 195
Re: Xdata in nested entities
« Reply #5 on: April 28, 2016, 01:10:38 PM »
To help you understand the fundamentals behind this try the following:
1.
Insert the block two times in different locations with different scale factors.
2.
Use (entget (car (nentsel))) and each time select the same nested element in both inserts.
3.
Compare the entity lists.
4.
Notice: identical lists.
Hello Roy,
You're right.
Do you know any way to update the coordinates as they are linked to the insertion point and the rotation of the block?
This will help me a lot.


Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Xdata in nested entities
« Reply #6 on: April 28, 2016, 01:20:39 PM »
Could you not attach the xdata to the block reference?
As this should cause the coordinates to be updated relative to the insertion point of the block reference.

velasquez

  • Newt
  • Posts: 195
Re: Xdata in nested entities
« Reply #7 on: April 28, 2016, 02:41:55 PM »
Could you not attach the xdata to the block reference?
As this should cause the coordinates to be updated relative to the insertion point of the block reference.

Hello Lee,
The drawings form part of a library are composed of three or more solids, each solid has different reference point with xdata.
I need to retrieve these coordinates when the user selects one of the solids with nentsel.
I want to avoid too complex blocks in a 3D design.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Xdata in nested entities
« Reply #8 on: April 28, 2016, 05:58:12 PM »
If you are using nentselp/nentsel, you can use the transformation matrix returned by this function (the third item in the list returned) to transform the coordinate xdata to be relative to the parent block reference.

velasquez

  • Newt
  • Posts: 195
Re: Xdata in nested entities
« Reply #9 on: April 29, 2016, 07:27:01 AM »
If you are using nentselp/nentsel, you can use the transformation matrix returned by this function (the third item in the list returned) to transform the coordinate xdata to be relative to the parent block reference.

Thank you Lee
I will look for examples of how to work with it.

velasquez

  • Newt
  • Posts: 195
Re: Xdata in nested entities
« Reply #10 on: May 09, 2016, 03:19:26 PM »
If you are using nentselp/nentsel, you can use the transformation matrix returned by this function (the third item in the list returned) to transform the coordinate xdata to be relative to the parent block reference.

Thank you Lee, I followed your suggestion and can update the coordinates working with functions you posted on matrix, as always very good their work.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Xdata in nested entities
« Reply #11 on: May 09, 2016, 05:43:32 PM »
Excellent to hear velasquez, I'm happy to have been of assistance.  :-)