baohui668 发表于 2006-4-10 16:31:00

[ARX]填充交流(RMB)

<P>本人想做一个CAD填充的程序,比较复杂,</P>
<P>希望可以对不同的图层\线型填充不同的STYLE,想做成自动遍历多个DWG的</P>
<P>希望朋友指点,希望有兴趣的朋友来讨论下,或留qq</P>
<P>如有需要,本人以RMB酬谢(想做个复杂点的)</P>
<P><FONT face=宋体 size=2>这是个屏选的,随便写的</FONT></P>
<P><FONT face=宋体 size=2>void Myfa()<BR>{<BR>ads_name ents,ent;<BR>AcDbObjectId objId;<BR>AcDbEntity* pEnt=NULL;<BR>AcDbObjectIdArray dbObjIds;<BR>acedSSGet(NULL,NULL,NULL,NULL,ents);<BR>long len;<BR>acedSSLength(ents,&amp;len);<BR><BR>AcDbHatch* pHatch = new AcDbHatch();<BR>for(long i=0;i&lt;len;i++){ <LEN;I++){<BR />acedSSName(ents,i,ent);<BR>acdbGetObjectId(objId, ent);<BR>dbObjIds.append(objId);<BR>}<BR>acedSSFree(ent);<BR>acedSSFree(ents);<BR><BR>AcGeVector3d normal(0.0, 0.0, 1.0);<BR>pHatch-&gt;setNormal(normal);<BR>pHatch-&gt;setElevation(0.0);<BR>pHatch-&gt;setColorIndex(3);<BR>pHatch-&gt;setPatternScale(2);<BR>pHatch-&gt;setPatternAngle(0.0);<BR>pHatch-&gt;setPattern(AcDbHatch::kPreDefined, "ANSI31");<BR>pHatch-&gt;setHatchStyle(AcDbHatch::kNormal);<BR>pHatch-&gt;appendLoop(AcDbHatch::kExternal, dbObjIds);<BR>pHatch-&gt;draw(); //更新实体<BR>pHatch-&gt;recordGraphicsModified(Adesk::kTrue);<BR>// Set Associativity<BR>//<BR>pHatch-&gt;setAssociative(Adesk::kFalse);<BR>pHatch-&gt;evaluateHatch();<BR>acedUpdateDisplay();<BR><BR><BR>AcDbBlockTable *pBlockTable=NULL;<BR>AcDbBlockTableRecord *pBlockTableRecord;<BR>acdbHostApplicationServices()-&gt;workingDatabase()<BR>-&gt;getSymbolTable(pBlockTable, AcDb::kForRead);<BR><BR>pBlockTable-&gt;getAt(ACDB_MODEL_SPACE, pBlockTableRecord,<BR>AcDb::kForWrite);<BR>pBlockTable-&gt;close();<BR><BR>AcDbObjectId HatchId;<BR>pBlockTableRecord-&gt;appendAcDbEntity(HatchId, pHatch);<BR>pBlockTableRecord-&gt;close();<BR>pHatch-&gt;close();<BR>} <BR><BR>在选择多个实体填充的时候还有问题,百思不得其解:(</FONT> </P>

Superlee 发表于 2006-5-30 20:16:00

<P>如果是以polyline做边界,应该怎么填充阿?</P>
<P>楼主知道吗?</P>
页: [1]
查看完整版本: [ARX]填充交流(RMB)