E-Storage entity not consistent when element is copied

E-Storage entity not consistent when element is copied

grahamcook
Advocate Advocate
454 Views
2 Replies
Message 1 of 3

E-Storage entity not consistent when element is copied

grahamcook
Advocate
Advocate

Hi

 

My Add-In make use of Extensible Storage.  This particular schema has one array field of type ElementId.  I'm finding that if the Element with the attached schema entity is copied, the ElementId's in the resulting array are lost (the count is the same but the ElementId's are -1) as shown in the illustration below.  I confirm that all elements are present in the model.  Is this expected behaviour?  I'm using the latest build 2018.2.

 

Capture2.jpg

 

0 Likes
Accepted solutions (1)
455 Views
2 Replies
Replies (2)
Message 2 of 3

aignatovich
Advisor
Advisor
Accepted solution

Hi!

 

Yes, it is expected behavior, see documentation to AddSimpleField method:

 

AddSimpleField Method

The supported types are Boolean, Byte, Int16, Int32, Float, Double, ElementId, GUID, String, XYZ, UV and Entity.

Note that data of type ElementId is not copied to new elements that are created via copy/paste or a linear or radial array.

Note that a schema may contain a maximum of 256 fields.

Message 3 of 3

jeremytammik
Autodesk
Autodesk

Element ids are not copied, but:

 

If they refer to elements that are included in the same copy operation, they are updated to the new element ids resulting from it.

 

Thus, a set of elements with mutual relationships can be copied, and the result will maintain the same relationships as the original set.

 

http://thebuildingcoder.typepad.com/blog/2011/06/extensible-storage-features.html#7

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder