Api: set and attribute on DesignViewRepresentation object fails with Com-Exception

Api: set and attribute on DesignViewRepresentation object fails with Com-Exception

Holzethekid
Contributor Contributor
604 Views
1 Reply
Message 1 of 2

Api: set and attribute on DesignViewRepresentation object fails with Com-Exception

Holzethekid
Contributor
Contributor

Hallo,

i am trying to set an attribute on a DesignViewRepresentation object.

here my code:

 

 

var v = representationsManager.DesignViewRepresentations[3];
v.AttributeSets.Add("21212");

 

 

 

but this fails with 

 

 

System.Runtime.InteropServices.COMException: 'Unbekannter Fehler (Exception from HRESULT: 0x80004005 (E_FAIL))'

 

 

 

in the documentation DesignViewRepresentation.AttributeSets there is no infromation that it is not implemented.

Maybe any one know what i am doing wrong ?

 

thanks in advance

0 Likes
Accepted solutions (1)
605 Views
1 Reply
Reply (1)
Message 2 of 2

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @Holzethekid 

I did some testing just now and came to the conclusion that the attribute set name is not allowed to start with a number 🙂

If you change it to for example:

v.AttributeSets.Add("a21212");

 then it should work.

0 Likes