[CE U13 C#] Get a list of available TextStyles

Hi,

I know this has been asked before but perhaps there are any updates on this matter.

The method DgnFile.GetTextStyles() only seems to return the TextStyles in the active designfile (if DgnFile the active designfile).

I therefore tried the following code but no dgnlibs are found, and yes, there is a dgnlib containing TestStyles in MS_DGNLIBLIST.

ArrayList textStyles = new ArrayList();

BM.DgnLibIterator iterator = new BM.DgnLibIterator(BM.DgnLibSelector.TextStylesOnly);

// Get styles in active file (works fine for the active file)
foreach (BDPN.DgnTextStyle textStyle in DgnHelper.GetActiveDesignFile().GetTextStyles())
{
  textStyles.Add(textStyle.Name);
}

// Get styles in dgnlibs (no dgnlibs found)
foreach (BDPN.DgnFile dgnlib in iterator)
{
  foreach (BDPN.DgnTextStyle textStyle in dgnlib.GetTextStyles())
  {
    if (textStyles.Contains(textStyle.Name) == false)
    {
      textStyles.Add(textStyle.Name);
    }
  }
}

Parents Reply Children
No Data