- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All
I have managed to store an array of elementIDs using Extensible Storage, but am having trouble reading the information back.
To save the data I have used:
Dim entity As New Entity(schema)
' get the field from the schema
Dim ExcludedTitleblocks As Field = schema.GetField("ExcludedTitleblocks")
' set the value for this entity
entity.Set(Of IList(Of ElementId))(ExcludedTitleblocks, tbList)
' store the entity in the element
doc.ProjectInformation.SetEntity(entity)
I am trying to read the data back using this (but I get an error with the last line):
Dim ExcludedTitleblocks As Field = s.GetField("ExcludedTitleblocks")
Dim retrievedEntity As Entity = doc.ProjectInformation.GetEntity(s)
Dim retrievedData As IList(Of ElementId) = retrievedEntity.Get(Of IList(Of ElementId))(ExcludedTitleblocks)
The error is "The field belongs to a different Schema from this entity, or this Entity is invalid."
(I had working code when I was only storing a simple elementid field)
Please can anyone help with the correct syntax?
Thanks
Solved! Go to Solution.