[求助]跟DWG保存个人数据问题?
<p>我想写一个图层分组管理的程序,但我不知道图层分组后的信息如何跟着DWG保存,</p><p>在下次打开DWG时还能读取这些分组信息呢,请问各位前辈,这些个人的信息一般</p><p>都保存在哪里啊!如何实现呢?请给些参考吧?</p> <p>放在字典</p> <p>谢谢!早上就看了版主的答复。</p><p>但我对字典不熟,查了一下资料,只找到了给实体加扩展数据的程序片断。</p><p>没找到添加命名扩展字典的程序片断,如果版主有添加扩展字典的程序片断,</p><p>能否粘一个上来参考一下吗?谢谢!</p> <a href="http://bbs.mjtd.com/forum.php?mod=viewthread&tid=75604">http://bbs.mjtd.com/forum.php?mod=viewthread&tid=75604</a><br/>三楼的<br/>SetXRecordData函数 <p>非常感谢!</p><p>我要慢慢研究消化一下。没搞过扩展记录这东西。</p> <p>实现了一部分功能,不错,下面是扩展记录的部分代码,由于扩展记录分析手段不懂,有些功能没实现。</p><p></p><p>Try<br/> Dim NOD As DBDictionary = trans1.GetObject(db.NamedObjectsDictionaryId, OpenMode.ForWrite, False)<br/> Dim lpDict As DBDictionary<br/> Try<br/> lpDict = trans1.GetObject(NOD.GetAt("图层分组"), OpenMode.ForRead)<br/> Dim dgv As DataGridView() = {DataGridView1, DataGridView2, DataGridView3, DataGridView4, DataGridView5}<br/> Dim dgvn As Integer<br/> For j = 0 To li - 1<br/> dgvn = 1<br/> Dim objxRec As Xrecord<br/> Try<br/> objxRec = trans1.GetObject(lpDict.GetAt(ltr(j).Name), OpenMode.ForRead)<br/> Dim resbuf As TypedValue = objxRec.Data.AsArray(0)<br/> dgvn = resbuf.Value<br/> Finally<br/> End Try<br/> With dgv(dgvn - 1)<br/> Dim tpa As System.Drawing.Image = tpn<br/> Dim tpb As System.Drawing.Image = tpn<br/> If ltr(j).IsOff Then<br/> tpa = tpc<br/> Else<br/> tpa = tpo<br/> End If<br/> If ltr(j).IsLocked Then<br/> tpb = tpl<br/> Else<br/> tpb = tpu<br/> End If<br/> .Rows.Add(tpa, tpb, ltr(j).Name)<br/> End With<br/> Next<br/> Catch<br/> lpDict = New DBDictionary()<br/> NOD.SetAt("图层分组", lpDict)<br/> trans1.AddNewlyCreatedDBObject(lpDict, True)</p><p> Dim xRec(li) As Xrecord<br/> For i = 0 To li - 1<br/> xRec(i) = New Xrecord()<br/> xRec(i).Data = New ResultBuffer(New TypedValue(DxfCode.Int8, 1))<br/> lpDict.SetAt(ltr(i).Name, xRec(i))<br/> trans1.AddNewlyCreatedDBObject(xRec(i), True)<br/> Next</p>
页:
[1]