How to find Plot Style Sheet/Table name for entity?

How to find Plot Style Sheet/Table name for entity?

varshaauti27
Advocate Advocate
1,007 Views
3 Replies
Message 1 of 4

How to find Plot Style Sheet/Table name for entity?

varshaauti27
Advocate
Advocate

Hi, I have polyline with plot style "style 1" from plot style table "acad.stb". I am able to find plot style name using entity.PlotStyleName but looking for way to find plot style table/sheet name, as I have "Style 1" present in another plot style table. Refer attached image.

 

varshaauti27_0-1674765962306.png

0 Likes
1,008 Views
3 Replies
Replies (3)
Message 2 of 4

hippe013
Advisor
Advisor

The following is a quick example of getting the current Style Table or Color Table of the current layout. As well as listing the available tables. If you are wanting to read the contents of the style table or color table, I would suggest looing into PiaNO which can be found here. 

 

https://github.com/phusband/PiaNO

 

<CommandMethod("PlotConfigsEx")>
Public Sub CmdPlotConfigsEx()
   GetCurrent() 'CommandBase - Sets Private aDoc, db, and ed  

   Using tr As Transaction = db.TransactionManager.StartTransaction

      Dim loMgr As LayoutManager = LayoutManager.Current
      Dim loId As ObjectId = loMgr.GetLayoutId(loMgr.CurrentLayout)
      Dim lo As Layout = tr.GetObject(loId, OpenMode.ForRead)

      If String.IsNullOrEmpty(lo.CurrentStyleSheet) Then
         ed.WriteMessage(vbCrLf & "Current Style Sheet: None")
      Else
         ed.WriteMessage(vbCrLf & "Current Style Sheet: " & lo.CurrentStyleSheet)
      End If

      Dim psVal As PlotSettingsValidator = PlotSettingsValidator.Current

      Dim sheetList As StringCollection = psVal.GetPlotStyleSheetList

      ed.WriteMessage(vbCrLf & "Available Style Sheets: ")
      For Each s As String In sheetList
         ed.WriteMessage(vbCrLf & " --> " & s)
      Next

      tr.Commit()
   End Using
End Sub

 

 

0 Likes
Message 3 of 4

varshaauti27
Advocate
Advocate
Thank you for your reply. I am able to find current active plot style and style list using PiaNo.
My question is, if I have Poly1 with plot style "Style1 (from acad.stb)" and Poly2 with plot style "Style1 (from monochrome.stb)". Is there any way to find that Poly1 has plot style Style1 from acad.stb and not from monochrome.stb
0 Likes
Message 4 of 4

hippe013
Advisor
Advisor

As far as I know, the Plot Style is stored as just a string. It has no other knowledge of what table it came from. This way you can have two different style tables that contain the same style names and you can then easily switch tables without having to reassign the plot styles on the objects. That is my understanding anyways.