[CONNECT UPDATE 15 C#] LineStyle Scale

Hello,

I have problem with setting scale for linestyle in c#. If anyone found working solution please share it.

So far I tried to use ElementPropertiesSetter SetLineStyle function because this function takes LineStyleParameters as param but i can't create LineStyleParameters because it does not have constructor.

I tried to get LineStyleParameters from ElementPropertiesGetter and I get some but I can't change Scale for that object, it stays unchanged after lineStyle.Scale = scale.

Regards.

Parents Reply
  • My element is not added to model yet so maybe this is the problem?

    Yes and no.

    The access through EC properties, when display parameters are queried, seems throwing exception, when element does not exist in model yet. I guess it's not bug in EC, because Element.GetElementDisplayParameters() does not read line style info correctly also.

    So I guess we are back at the discussion beginning: How to use ElementPropertiesSetter, because when it's used (in dynamics, when element exists in memory only), it works fine:

    ElementPropertiesSetter setter = new ElementPropertiesSetter();
    setter.SetLinestyle(Settings.LineStyle, null);

    ... but the question is how to obtain LineStyle value (probably from LSMap somehow).

    But ECProperty reads scale value properly, after my tranformation method it reads new scale.

    The transformation looks like overkill to set the line style scale only ;-)

    The problem, at least what I see in my VisualStudio, is that ECProperty is read properly, but to access its value throws exception.

    With regards,

      Jan

Children
No Data