[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
  • Hi Damian,

    but i can't create LineStyleParameters because it does not have constructor.

    When you will check documentation carefully (and e.g. will evaluate classes dependencies), you will find that LineStyleParameters are part of element display parameters, so they have to be obtained from there. In this situation the constructor makes no sense, because display parameters exists only when element is is displayable. And some parameters (as LineStylesParameters for example) exist only in certain situations, like when linear element has line style assigned.

    I can't change Scale for that object, it stays unchanged after lineStyle.Scale = scale.

    My feeling is that it does not work. I do not know whether it's a bug in API implementation or wrong code is used, but even with LineStyleParameters existing, it does not work for me (but maybe I did something wrong).

    I don't know how this "byLevel" feature works.

    It's crucial MicroStation (and also AutoCAD) feature, so this knowledge is mandatory, because represented in many aspects of MicroStation API.

    I need to set this value codebehind:

    Because I can see this value (LSScale) in EC schemas delivered with MicroStation, it should be accessible as element's EC property. And because it's not defined as read-only, I am pretty sure you can change it this way (which is popular and common workaround when a feature is not accessible or not work in API ;-)

    Regards,

      Jan

Reply
  • Hi Damian,

    but i can't create LineStyleParameters because it does not have constructor.

    When you will check documentation carefully (and e.g. will evaluate classes dependencies), you will find that LineStyleParameters are part of element display parameters, so they have to be obtained from there. In this situation the constructor makes no sense, because display parameters exists only when element is is displayable. And some parameters (as LineStylesParameters for example) exist only in certain situations, like when linear element has line style assigned.

    I can't change Scale for that object, it stays unchanged after lineStyle.Scale = scale.

    My feeling is that it does not work. I do not know whether it's a bug in API implementation or wrong code is used, but even with LineStyleParameters existing, it does not work for me (but maybe I did something wrong).

    I don't know how this "byLevel" feature works.

    It's crucial MicroStation (and also AutoCAD) feature, so this knowledge is mandatory, because represented in many aspects of MicroStation API.

    I need to set this value codebehind:

    Because I can see this value (LSScale) in EC schemas delivered with MicroStation, it should be accessible as element's EC property. And because it's not defined as read-only, I am pretty sure you can change it this way (which is popular and common workaround when a feature is not accessible or not work in API ;-)

    Regards,

      Jan

Children