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

[V8i C#] Disabling Annotation Scale on Text Elements

$
0
0

There was a thread a few years back about how to toggle the annotation scale setting off on text elements ([View:http://communities.bentley.com/products/programming/microstation_programming/f/19570/t/72781:940:0])

The solution mentioned in the thread was not very reliable and the thread is locked. Anyways,  this seems to be working well for me and I thought I would share.  If anyone else has any other solutions, please post :)

public static void DisableAnnotation(this Element elem, bool rewrite = false)
        {
            DataBlock[] data = elem.GetUserAttributeData(32980);
            if (data.Length > 0)
            {
                // Set appropriate flags.. Use Keyin "Analyze Element" to examine attributes.
                data[0].Offset = 7;
                byte flag1 = 0;
                data[0].CopyByte(ref flag1, true);

                data[0].Offset = 25;
                short flag2 = 2604;
                data[0].CopyInteger(ref flag2, true);

                elem.DeleteUserAttributeData(32980, 0);
                elem.AddUserAttributeData(32980, data[0]);

                // Delete the annotation meta data...
                DataBlock[] data2 = elem.GetUserAttributeData(22259);
                if (data2.Length > 0)
                    elem.DeleteUserAttributeData(22259, 0);

            }

            if (rewrite)
                elem.Rewrite();

        }

Viewing all articles
Browse latest Browse all 7260

Trending Articles



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