当前位置:编程学习 > C#/ASP.NET >>

求助啊 高手哥哥们!!!看下下面这段程序有啥问题!关于autocad的二次开发

  [CommandMethod("cre")]
        public void cre()
        {
            int i,j;
            MText mt = new MText();

            TypedValue[] ty = new TypedValue[] { new TypedValue((int)DxfCode.Text,mt) };
            SelectionFilter sel = new SelectionFilter(ty);
            SelectionFilter fil = new SelectionFilter(ty);
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
            PromptSelectionOptions re = new PromptSelectionOptions();
            PromptSelectionResult su = ed.GetSelection(re );
            if (su.Status != PromptStatus.OK)
            { 
                return;
            }
            Autodesk.AutoCAD.EditorInput.SelectionSet SS = su.Value;
            ObjectId[] idArray;
            idArray = SS.GetObjectIds();
            i = idArray.Length;
            StreamWriter strw = File.CreateText("d:\\temp\\Mmmmtest.txt");
            strw.WriteLine(i.ToString());
            
            
            for (j = 0; j <= i - 1; j++)
            {
                //try
                //{
                if (idArray[j].GetObject(OpenMode.ForRead).GetType() is MText)
                {


                    mt = (MText)idArray[j].GetObject(OpenMode.ForRead);
                    strw.WriteLine(mt.Contents.ToString());
                }
                else
                {
                    continue;
                }
                    
              

               
                
             }
             strw.Close();
           

        }
这编译都通过了,是关于autocad的二次开发的,目的是将text读取到txt文件中!!但是一再cad中用连autocad都直接挂了!!!说出现致命错误!高手救救火啊!! --------------------编程问答-------------------- --------------------编程问答-------------------- autocad的二次开发? --------------------编程问答-------------------- 去网上找找吧·应该很多·
补充:.NET技术 ,  其他语言
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,