Block Properties order


Hi all,


I'm adding and updating block properties from code via the AttributeSet...  Does anyone know if I can either set the index, or rearrange the property order?  For instance, I am adding a property 'ID' to existing blocks which already have a bunch of property set.  How can I get 'ID' to be the first property?


I guess I could pull in all the properties, delete them add the ID and readd the original properties..  was just hoping there might be an easier way.





PS - I tried to do the process where I clear out the Attribute set.. but when I call this:


attSet.Remove("BlockName");  // a valid property name in the collection

I receive:

Error HRESULT E_FAIL has been returned from a call to a COM component.


Any sample code on removing block properties?






Re: Block Properties order

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
Hi MattG,
There is no way to sort. The Remove method should work. A work around is to read all attributes, delete the whole Attributes set (name is "Standard") and add them in the desired order.

VS2015, SE ST10