Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[CONNECT C# Addin] Using ElementPropertiesSetter on Text Elements

$
0
0

I have an application which sets element properties based on items selected in a dialog box.  My code works fine on linear elements, but when applying the new properties with ElementPropertiesSetter to a text element, it produces the following exception when replacing the element in the model: "A DgnPlatformNETException was thrown: Bad StatusInt: 32768".

Code snippet:

Bentley.DgnPlatformNET.ElementPropertiesSetter pSetter = new Bentley.DgnPlatformNET.ElementPropertiesSetter();
pSetter.SetLevel(newFC.level);
pSetter.SetColor(newFC.color);
pSetter.SetLinestyle(newFC.style, null);
pSetter.SetWeight(newFC.weight);
pSetter.Apply(element);
element.ReplaceInModel(element);

Changing any combination of the above properties causes the error to occur.  I can step through the code using the debugger and see that the level does get changed in the element but once it tries to replace it in the model it errors out.  Like I said above, the same code works fin with all other element types I have tested.  Also, if i change element.ReplaceInModel(element) to element.AddToModel() it will write the text out with the expected properties, so I know that all the properties are being set.

Any ideas, or is this just a bug in the SDK? (I am using CONNECT Update 4)


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>