Hi,
This was a long time ago.. I can't really figure out what I did.
But here is a code written in VB.NET that I know works..
Maybe that will help you to solve your problem if there is anyting when it comes to the order of rows...
/Rikard
'*****************************************
Dim layMgr As LayoutManager = LayoutManager.Current
Dim loObjId As ObjectId = layMgr.GetLayoutId(layMgr.CurrentLayout)
Dim lo As Layout = DirectCast(tr.GetObject(loObjId, OpenMode.ForRead), Layout)
Dim ps As New PlotSettings(lo.ModelType)
ps.CopyFrom(lo)
Dim pi As New PlotInfo()
pi.Layout = loObjId
Dim psv As PlotSettingsValidator = Autodesk.AutoCAD.DatabaseServices.PlotSettingsValidator.Current
MediaName = getInternalName(DeviceName, MediaName)
psv.SetPlotConfigurationName(ps, DeviceName, MediaName)
psv.RefreshLists(ps)
psv.SetPlotType(ps, Autodesk.AutoCAD.DatabaseServices.PlotType.Extents)
psv.SetUseStandardScale(ps, True)
psv.SetStdScaleType(ps, StdScaleType.ScaleToFit)
If ClickedPlotSize <> CurrentSheetSize Then
Dim msg As String
Dim title As String
Dim style As MsgBoxStyle
Dim response As MsgBoxResult
msg = "Do you want to use a CTB-file with thinner lines?" ' Define message.
style = MsgBoxStyle.YesNo
title = "Test" ' Define title.
' Display message.
response = MsgBox(msg, style, title)
If response = MsgBoxResult.Yes Then ' User chose Yes.
PlotStyleTable = GetVauleFromArray("CtbThinnerLinesName")
End If
End If
psv.SetCurrentStyleSheet(ps, PlotStyleTable)
psv.SetPlotRotation(ps, Plotrotation)
psv.SetPlotCentered(ps, True)