如何用C#.NET读取DWG文件的明细栏和标题栏?
希望能够在将DWG文件导入程序时,同时读取DWG文件中明细栏和标题栏中的信息,从而自动将产品结构信息读取到系统中,不知道怎么实现?各位大侠帮忙指点一下! 我也想知道! 很想知道阿!现在还不知道怎么获取块的属性呢! mark <p>using app = Autodesk.AutoCAD.ApplicationServices.Application;</p><p> public static void AddSModelPopupMenu() <br/> { //Debug.WriteLine("AddSModelPopupMenu start");<br/> try<br/> { //CurrNameSpace_Intialize(); <br/> AcadMenuGroups mnus = (AcadMenuGroups)app.MenuGroups; <br/> AcadPopupMenus pmnus = mnus.Item(1).Menus;<br/> int count =0;<br/> foreach (AcadPopupMenu mnu in pmnus)<br/> {if (mnu.OnMenuBar==true ) count++;}<br/> AcadPopupMenu Menu_SModel=pmnus.Add("&Smodel"); <br/> string macro = Convert.ToChar(Keys.Escape).ToString();<br/> //Show main window<br/> AcadPopupMenuItem MenuItem_MainForm=Menu_SModel.AddMenuItem(Menu_SModel.Count,"&MainForm",macro+"SMF ");<br/> MenuItem_MainForm.HelpString="Show main window";<br/> //Show property window<br/> AcadPopupMenuItem MenuItem_PropertyForm=Menu_SModel.AddMenuItem(Menu_SModel.Count,"&PropertyForm",macro+"SPF ");<br/> MenuItem_PropertyForm.HelpString="Show property window";<br/> AcadPopupMenuItem MenuItem_PunchE=Menu_SModel.AddMenuItem(Menu_SModel.Count,"Punch&E",macro+"MPE ");<br/> MenuItem_PunchE.HelpString="Make PunchE"; <br/> AcadPopupMenuItem MenuItem_uc=Menu_SModel.AddMenuItem(Menu_SModel.Count,"Palet&te",macro+"SPS ");<br/> MenuItem_PunchE.HelpString="Palelte";<br/> pmnus.InsertMenuInMenuBar("&Smodel",++count);<br/> }<br/> catch (Exception ex) {smc.ed.WriteMessage (ex.Message);} <br/> <br/> }</p><p>这是增加下拉菜单的代码,希望有帮助!</p> <p> <br/> using app = Autodesk.AutoCAD.ApplicationServices.Application;</p><p>public void PaneTest()<br/> {<br/> Autodesk.AutoCAD.Windows.PaneCollection panes = app.StatusBar.Panes;<br/> Pane pane1 = new Pane();<br/> pane1.Text = "Sieben";<br/> panes.Add(pane1);<br/> app.StatusBar.Update();<br/> }</p><p>在状态栏增加一项</p> 怎么让AutoCAD设计中心打开我们指定的文件? <p>用DWGDIRECT在不打开DWG文件的情况下即可读取块信息,明细栏与标题栏都是块</p>
页:
[1]