Python

Get Text Style

Q How do I get a text style using MicroStation Python?

A Here are Python examples that get a named text style or the active text style.

Introduction

While developing another example I needed a a DGN text style to use with new text or text-node elements.

Python Implementation

Get the active text style …

textStyle = DgnTextStyle.GetSettings(ISessionMgr.ActiveDgnModelRef.GetDgnFile())

Get a named text style …

textStyleName = "Text Style Name"
textStyle = DgnTextStyle.GetByName (textStyleName, ISessionMgr.ActiveDgnModelRef.GetDgnFile())

Usage

See examples published by Bentley Systems …

Questions

Post questions about MicroStation programming to the MicroStation Programming Forum.