leeathorskey 发表于 2008-12-4 11:51:00

太厉害了!哎~我还差远了。

mxdwg 发表于 2008-12-4 13:10:00

<p>梦想绘图控件寻求合作 <br/>&nbsp;&nbsp; 寻找志同道合的编程高手,一起做软件开发,实现共赢,共进步。<br/>有意请联系方式QQ:827867134 ,www.mxdraw.com</p><p>主要合作是内容: 在AutoCAD外,前期主要做图纸浏览,CAD工具,专业工具,最终目标是CAD平台</p><p>要求会VC++,会ARX更好</p>

leeathorskey 发表于 2008-12-4 16:20:00

我的QQ号是635551689,我对阁下非常敬佩,愿帮助您做一些力所能及的事。不过我水平有限。我学的是化工专业,自学过C++,两个月前开始接触ARX编程。我的e_mail:leeathorskey@163.com

leeathorskey 发表于 2008-12-4 17:18:00

<p>我做了一个从AcEdInputPointMonitor继承下来的监视器。在CAD中,</p><p>1.当监视器打开时,绘制的图形无法删除。</p><p>2.当监视器打开后再关闭,执行其他命令时,有时会出错,有时不会。</p><p>不胜感激!</p>

mxdwg 发表于 2008-12-4 17:34:00

<p>估计是代码那里写的不对,要看看代码才知道原因,我已经你QQ好友了.</p>

mxdwg 发表于 2008-12-4 18:36:00

<p>梦想绘图控件交流群:73281982 </p><p>群说明: CAD 控件,DWG图纸的浏览与编辑,CAD工具制作,专业软件制作,ARX开发,合作开发软件项目等交流</p>

mxdwg 发表于 2009-5-11 09:17:00

2009.05.10更新

<p><strong>更新下载地址:<br/></strong><a href="http://www.mxdraw.com/downland/MxDraw3.0(20090510)BetaTryVersion.exe" target="_blank"><font color="#a0522d"><strong>http://www.mxdraw.com/downland/MxDraw3.0(20090510)BetaTryVersion.exe</strong></font></a></p><p>1. 增加布局功能和相关接口,如:McDbLayout,McDbLayoutManager等类。</p><p>2. 增加鼠标移动到实体上的动态提示功能和相关接口。如:</p><p>// ARX的动态事件接口,虚函数。<br/>virtual Mcad::ErrorStatus McEdInputPointMonitor::MonitorInputPointToolTip(IN const &nbsp;McDbObjectIdArray&amp; pickedEntities,<br/>&nbsp;&nbsp;IN const McGePoint3d&amp; pickedPoint,<br/>&nbsp;&nbsp;IN CString&amp; sNewToolTipString<br/>&nbsp;&nbsp;);</p><p>ActiveX的动态提示事件函数<br/>CMxDrawOcxCtrl::FireMonitorInputPointToolTip(LONG lId, BSTR* pToolTip)</p><p>3. 增加图层管理功能和相关接口。如:<br/>ActiveX的图层导出接口.</p><p>SHORT CMxDrawOcxCtrl::GetLayerIdArray(VARIANT* pArrayId);<br/>SHORT CMxDrawOcxCtrl::GetLayerProp(LONG lId, BSTR* pszName, BSTR* pszLineTypeName, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SHORT* pIsOff, SHORT* pIsLock, SHORT* pIsFrozen, BYTE* pR, BYTE* pG, BYTE* pB);<br/>SHORT CMxDrawOcxCtrl::SetLayerOff(LONG lId, SHORT iIsOff);</p><p>4. 导出dwf功能和相关接口。如:<br/>&nbsp;BOOL MxDraw::ExprotDwf(MXDRAWOCXHANDLE hOcx,<br/>&nbsp;&nbsp;LPCTSTR pszDwfFilePath<br/>&nbsp;&nbsp;);<br/>5.&nbsp; 安装包中增加调试版lib文件和dll文件,方便控件使用者调试程序.</p><p>6.&nbsp; 增加放大镜功能</p><p>7.&nbsp; 修正一堆细节上的错误</p><p></p>

mxdwg 发表于 2009-6-17 12:42:00

2009.06.16更新

<p>2009.06.16<strong>更新下载地址:</strong></p><p><a href="http://www.mxdraw.com/viewthread.php?tid=56&amp;extra=page%3D1">http://www.mxdraw.com/viewthread.php?tid=56&amp;extra=page%3D1</a></p><p>1.增加 dwf的导入.</p><p>2.增加样条线绘制,</p><p>3.增加曲线采样和离散曲线功能,可以对样条线,圆弧,圆,椭圆,椭圆弧进行离散</p><p>4.增加用户坐标系</p><p>5.增加视区旋转显示,和旋转打印。</p><p>6.增加鸟瞰功能</p><p>7.增加对位图,jgp的显示,增加AcDbRasterImage类。</p><p>8.增加绘图属性工具条,可以设置绘图的当前的颜色,当前图层,当前线型.<br/></p><p>9增加绘图工具条,主要用增加:绘线,矩形框,圆弧,圆,样条线,椭圆,椭圆弧,点,插入块,写文字,和插入图片按钮。<br/></p><p>10.增加打开网上dwg图纸命令<br/></p><p>11.增加关闭选择实体的图层命令<br/></p><p>12.增加打开所有图层命令</p>

mxdwg 发表于 2009-7-10 09:21:00

<p>2009.07.09更新</p><p><strong>新下载地址</strong></p><p><a href="http://www.mxdraw.com/viewthread.php?tid=61&amp;extra=page%3D1">http://www.mxdraw.com/viewthread.php?tid=61&amp;extra=page%3D1</a></p><p>1. 增加丰富的 COM 接口,这些接口类拟AutoCAD 的VBA接口,方便其它语言使用.<br/>例如,VB中使用控件交互绘制直线的代码: </p><code id="code0"><p><br/>' 交互绘直线代码<br/>ElseIf iCommandId = 4 Then<br/>&nbsp; &nbsp; Dim curSpace2 As MxDrawXLib.MxDrawBlockTableRecord<br/>&nbsp; &nbsp; Set curSpace2 = app.WorkingDatabase.CurrentSpace<br/>&nbsp; &nbsp; Set mxUtility = New MxDrawXLib.MxDrawUtility<br/>&nbsp; &nbsp; Dim getPt1 As MxDrawXLib.MxDrawPoint<br/>&nbsp; &nbsp; Set getPt1 = mxUtility.GetPoint(, Chr(13) + Chr(10) + "点取第一点:")<br/>&nbsp; &nbsp; If (getPt1 Is Nothing) Then<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;MsgBox "用户取消.."<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Exit Sub<br/>&nbsp; &nbsp; End If<br/>&nbsp; &nbsp; Dim getPt2 As MxDrawXLib.MxDrawPoint<br/>&nbsp; &nbsp; Set getPt2 = mxUtility.GetPoint(getPt1, Chr(13) + Chr(10) + "点取第二点:")<br/>&nbsp; &nbsp; If (getPt2 Is Nothing) Then<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;MsgBox "用户取消.."<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Exit Sub<br/>&nbsp; &nbsp; End If<br/>&nbsp; &nbsp; Dim newLine As MxDrawXLib.MxDrawLine<br/>&nbsp; &nbsp; Set newLine = curSpace2.AddLine(getPt1, getPt2)<br/>&nbsp; &nbsp; newLine.colorIndex = mcRed<br/><br/>End If</p><p></p><p>2. 增加更加完善的帮助文档<br/><br/>3. 增加删除实体功能<br/><br/>4. 增加夹点编辑功能<br/><br/>5. 增加编辑文字的演示例程代码 </p><p></p><p><br/>&nbsp;</p></code>

mxdwg 发表于 2009-8-20 20:16:00

2009.08.20更新<strong>更新下载地址:</strong><br/><br/><a href="http://www.mxdraw.com/viewthread.php?tid=68&amp;extra=page%3D1" target="_blank">http://www.mxdraw.com/viewthread.php?tid=68&amp;extra=page%3D1</a><br/><br/>1. 增加高质量绘图功能,该功能可以在控件配制文件中设置<br/>ini文件如果设置了如下值,高质量绘图功能就激活了:<br/>// 是否高质量进行绘图.激活该项,绘图质量提高,提显示速度下降。<br/>("HighQualityDraw" "Y")<br/>&nbsp; &nbsp;高质量绘图功能激活后,图面的直线绘图光滑,不存在锯齿,文字显示也很圆滑,画面质量非常高,但绘图性能会有所降低,如果图面实体较多,可以把该功能禁用。在配制文件如下修改:<br/>&nbsp;&nbsp;("HighQualityDraw" "N")<br/>2. mxdrawx.ocx接口更加完善,增加C#例程。<br/>A.交互绘直线:<br/>private void DrawLine()<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawUtility mxUtility&nbsp;&nbsp;= new MxDrawUtility();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawPoint point = (MxDrawPoint)(mxUtility.GetPoint(null, "点取第一点:") );<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (point == null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MessageBox.Show("用户取消..");<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawPoint point2 = (MxDrawPoint)(mxUtility.GetPoint(point, "点取第二点:"));<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (point2 == null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MessageBox.Show("用户取消..");<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawApplication mxapp = new MxDrawApplication();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawDatabase mxdb = mxapp.WorkingDatabase();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawBlockTableRecord curSpace = mxdb.CurrentSpace();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawLine line = curSpace.AddLine(point, point2);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;line.colorIndex = MCAD_COLOR.mcRed;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;line.Close();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;curSpace.Close();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br/>B.增加把指定的实体,缩放到视区中显示。<br/>C.增加读取扩展数据<br/>&nbsp; &nbsp;// 读扩展数据<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;private void ReadXData()<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawUtility mxUtility = new MxDrawUtility();&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;object getPt;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawEntity ent = mxUtility.GetEntity(out getPt, "\n 选择读取扩展数据的实体:");<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (ent == null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawResbuf xData = ent.GetXData("");<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if(xData.Count == 0)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MessageBox.Show("没有扩展数据");<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;else<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; // 向命令行窗口打印扩展数据。<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; xData.PrintData();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br/>D.写扩展数据<br/>&nbsp;&nbsp;// 写扩展数据<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;private void WriteXData()<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawUtility mxUtility = new MxDrawUtility();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;object getPt;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawEntity ent = mxUtility.GetEntity(out getPt, "\n 选择读取扩展数据的实体:");<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (ent == null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawResbuf xData = new MxDrawResbuf();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;xData.AddString("TestApp",1001);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;xData.AddLong(77677,1071);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;ent.SetXData(xData);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br/>E.遍历数据库的实体<br/>private void GetAllEntity()<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawApplication app = new MxDrawApplication();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawUtility mxUtility = new MxDrawUtility();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawBlockTableRecord blkRec = app.WorkingDatabase().CurrentSpace();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawBlockTableRecordIterator iter = blkRec.NewIterator();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (iter == null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;// 所有实体的id数组。<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;List&lt;Int32&gt; aryId = new List&lt;Int32&gt;();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;int iLineNum = 0;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;for(;!iter.Done() ;iter.Step(true,false) )<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MxDrawEntity ent = iter.GetEntity();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; if (ent == null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;continue;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; aryId.Add(ent.ObjectID);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; if(ent is MxDrawLine)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; {<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;MxDrawLine line = (MxDrawLine)ent;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;iLineNum++;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; }&nbsp;&nbsp;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;String sT;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;sT = "发现" + aryId.Count + "个实体,其中有"+iLineNum + "个直线";<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MessageBox.Show(sT);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br/>F.插入图块,增加注释。<br/>private void InsertNote()<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;String sNoteText = "这是一个注释";<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;String sNote = "NoteBlockName";<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;// 让用点取一个注释插入点。<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawUtility mxUtility = new MxDrawUtility();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawPoint point = (MxDrawPoint)(mxUtility.GetPoint(null, "点取插入点 :"));<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (point == null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MessageBox.Show("用户取消..");<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;// 插入注释。<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawApplication app = new MxDrawApplication();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawDatabase curDatabase = app.WorkingDatabase();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawBlockTable blkTable = curDatabase.GetBlockTable();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawBlockTableRecord curSpace = curDatabase.CurrentSpace();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawBlockTableRecord blkRec = blkTable.GetAt(sNote,true);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if(blkRec == null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; // blkRec == null 指名的块记录没有找到.<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; // 插入一个新的块。<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; String sBlkFilePath = axMxDrawX1.GetOcxAppPath() + "\\Blk\\TsgNote.dwg";<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; // 把dwg文件导入到当前数据库。<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; axMxDrawX1.InsertBlock(sBlkFilePath, sNote);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; blkRec = blkTable.GetAt(sNote,true);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if(blkRec != null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; // 在当前空间中插入一个块引用。<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; curSpace.InsertBlock(point,sNote,4.0,0.0);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;// 插入注释文本。<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;point.y = point.y - 20.0;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;curSpace.AddText(point, sNoteText, 16, 0.0, MCAD_McHorizontalAlignment.mcHorizontalAlignmentCenter,<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MCAD_McVerticalAlignment.mcVerticalAlignmentTop);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br/>G.烁闪实体和停止烁闪例程<br/>private void TwinkeEnt()<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawUtility mxUtility = new MxDrawUtility();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;object getPt;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawEntity ent = mxUtility.GetEntity(out getPt, "选择要闪烁的实体");<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (ent == null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Int32 id = ent.ObjectID;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;ent.Close();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;axMxDrawX1.TwinkeEnt(id);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;// 停止闪实体<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;private void StopTwinkeEnt()<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawUtility mxUtility = new MxDrawUtility();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;object getPt;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;MxDrawEntity ent = mxUtility.GetEntity(out getPt, "选择要停止闪烁的实体");<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (ent == null)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Int32 id = ent.ObjectID;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;ent.Close();<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;axMxDrawX1.StopTwinkeEnt(id);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br/>3.增加控件的JavaScrip例程。
页: 1 2 3 4 [5] 6 7 8 9 10 11
查看完整版本: 梦想mxdraw浏览,编辑控件