实现了一部分功能,不错,下面是扩展记录的部分代码,由于扩展记录分析手段不懂,有些功能没实现。 Try Dim NOD As DBDictionary = trans1.GetObject(db.NamedObjectsDictionaryId, OpenMode.ForWrite, False) Dim lpDict As DBDictionary Try lpDict = trans1.GetObject(NOD.GetAt("图层分组"), OpenMode.ForRead) Dim dgv As DataGridView() = {DataGridView1, DataGridView2, DataGridView3, DataGridView4, DataGridView5} Dim dgvn As Integer For j = 0 To li - 1 dgvn = 1 Dim objxRec As Xrecord Try objxRec = trans1.GetObject(lpDict.GetAt(ltr(j).Name), OpenMode.ForRead) Dim resbuf As TypedValue = objxRec.Data.AsArray(0) dgvn = resbuf.Value Finally End Try With dgv(dgvn - 1) Dim tpa As System.Drawing.Image = tpn Dim tpb As System.Drawing.Image = tpn If ltr(j).IsOff Then tpa = tpc Else tpa = tpo End If If ltr(j).IsLocked Then tpb = tpl Else tpb = tpu End If .Rows.Add(tpa, tpb, ltr(j).Name) End With Next Catch lpDict = New DBDictionary() NOD.SetAt("图层分组", lpDict) trans1.AddNewlyCreatedDBObject(lpDict, True) Dim xRec(li) As Xrecord For i = 0 To li - 1 xRec(i) = New Xrecord() xRec(i).Data = New ResultBuffer(New TypedValue(DxfCode.Int8, 1)) lpDict.SetAt(ltr(i).Name, xRec(i)) trans1.AddNewlyCreatedDBObject(xRec(i), True) Next |