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

[Connect C# DgnPlatformNet] Proper way of setting custom Line Style

$
0
0

Currently I am using the following extension for setting an elements line style

        public static void SetLinestyle(this Element elem, string name)
        {

            using (ElementPropertiesSetter propSetter = new ElementPropertiesSetter())
            {

                if (name == "ByLevel")
                {
                    propSetter.SetLinestyle((int)SymbologyValue.StyleByLevel, null);
                } else
                {
                    int lineStyleIndex = LineStyleManager.GetNumberFromName(name, Ms.GetActiveDgnFile());
                    propSetter.SetLinestyle(lineStyleIndex, null);

                }


                propSetter.Apply(elem);
            }
        }

while this is setting the line style properly, it is not setting the line style Scale property correctly.

For example, my Line Style Scale is being set to 10000.0(UOR Scale factor possible from an Element.ApplyTransform()?) instead of 3.93700 which is the default value for the line style

I see that the SetLinestyle method takes in LineStyleParameters, but I have no idea where to get this value from.


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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