Gile,
i found this function inside the AutoDesk.AutoCAD.Internal namespace: DrawLineTypePattern (only in A2010 though, not sure about A2009?)... i'm assuming that this is undocumented function (as its in the internal namespace). I've been able to generate bitmaps of all the linetypes in the current drawing from this function and display them in a datagridview, see rough code below:
Imports AADS = Autodesk.AutoCAD.DatabaseServices
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Public Class Dialog1
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim db As AADS.Database = AADS.HostApplicationServices.WorkingDatabase
'' Start a transaction
Using Transaction As AADS.Transaction = db.TransactionManager.StartTransaction()
'' Open the Layer table for read
Dim lt As AADS.LinetypeTable = Transaction.GetObject(db.LinetypeTableId, AADS.OpenMode.ForRead)
Dim CurrentLT As AADS.LinetypeTableRecord
Dim enumerator As AADS.SymbolTableEnumerator = lt.GetEnumerator
Dim Rect As System.Drawing.Rectangle = New System.Drawing.Rectangle(0, 0, Me.DataGridView1.Columns.Item("ImageColumn").Width, Me.DataGridView1.RowTemplate.Height)
While enumerator.MoveNext
CurrentLT = Transaction.GetObject(enumerator.Current, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead)
Me.DataGridView1.Rows.Add(CurrentLT.Name, System.Drawing.Bitmap.FromHbitmap(Autodesk.AutoCAD.Internal.Utils.DrawLineTypePattern(enumerator.Current, Rect.Left, Rect.Top, Rect.Right, Rect.Bottom)))
End While
Transaction.Commit()
End Using
MsgBox(Me.DataGridView1.Rows.Count.ToString)
Catch ex As Exception
Throw ex
End Try
End Sub
End Class
HTH
cheers, Mark