Get list of Available style for Part Painter

Creator
Creator

Hello,

 

I am looking for a way to retreive the list of all the availliable Paint style.

 

2016-08-15_14-19-43.png

Is there any way to get this list from API ?

 

Regards,

/Eric

 

 

1 REPLY

Re: Get list of Available style for Part Painter

Creator
Creator

Hi,

 

I found how to do it, here is a snippet if anyone if looking for it 

 

                    SolidEdgePart.PartDocument document = doc as SolidEdgePart.PartDocument;
                    if (document != null)
                    {
                      FaceStyles facestyles = (FaceStyles)document.FaceStyles;
                      int index = 1;
                      List<ValueListItem> values = new List<ValueListItem>();
                      foreach (FaceStyle style in facestyles)
                      {
                        if (style.Flags != 1)
                          continue;
                        values.Add(new ValueListItem(index.ToString(), style.StyleName, style.StyleName));
                        index++;
                      }
                      cb.DisplayListItems(values);
                    }