tom.wery 发表于 2008-8-23 22:56:00

急呀!请问版主和大侠们,我这个反应器怎么用不起?

<p>我在做布局视口时采用多边形作边界.我看CAD本身都把多边形都附有永久的反应器.</p><p>我用下面的代码怎么就加不起永久反应器</p><p>AcDbViewport *pViewport = new AcDbViewport();</p><p>pViewport-&gt;setHeight(height);<br/>&nbsp;pViewport-&gt;setWidth(width);</p><p>pViewport-&gt;setViewCenter(AcGePoint2d(rotatemodelcenterpt.x,rotatemodelcenterpt.y));<br/>&nbsp;pViewport-&gt;setTwistAngle(twistangle);<br/>&nbsp;pViewport-&gt;setLensLength(50.0);&nbsp;<br/>&nbsp;pViewport-&gt;setCustomScale(scale);<br/>&nbsp;pViewport-&gt;setViewHeight(height*scale);<br/>&nbsp;pViewport-&gt;setViewDirection(AcGeVector3d(0,0,1));<br/>&nbsp;pViewport-&gt;setNonRectClipEntityId(trimobjectid);<br/>&nbsp;pViewport-&gt;setNonRectClipOn();<br/>&nbsp;//acedAlert("3");<br/>&nbsp;// 将新的布局对象添加到图纸空间块表记录中<br/>&nbsp;AcDbObjectId viewportId;<br/>&nbsp;pBlkTblRcd-&gt;appendAcDbEntity(viewportId, pViewport);<br/>&nbsp;//pViewport-&gt;downgradeOpen();<br/>&nbsp;pViewport-&gt;setOn();<br/>&nbsp;pViewport-&gt;upgradeOpen();<br/>&nbsp;pViewport-&gt;setTransparent();<br/>&nbsp;pViewport-&gt;close();<br/>&nbsp;pBlkTblRcd-&gt;close();</p><p><font color="#ff3300">&nbsp;AcDbEntity *pEnt;<br/>&nbsp;Acad::ErrorStatus esadddrecactor;<br/>&nbsp;esadddrecactor = acdbOpenAcDbEntity(pEnt, entId, AcDb::kForWrite);<br/>&nbsp;if (esadddrecactor == Acad::eOk)<br/>&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;pEnt-&gt;addPersistentReactor(viewportId);</font></p><p><font color="#ff3300">&nbsp;&nbsp;pEnt-&gt;close();<br/>&nbsp;}</font></p><p><font color="#ff3300">红色代码段怎么不起作用,</font></p>

li_master 发表于 2011-1-4 17:00:52

加入rector你也得用recortor对象吧!
页: [1]
查看完整版本: 急呀!请问版主和大侠们,我这个反应器怎么用不起?