leidiang 发表于 2005-1-10 17:55:00

[ARX]请问高手,插入块时怎么改变块比例??

请问高手,插入块时怎么改变块比例??下面是我插入块的程序,要加比例,怎么做谢谢!!!


AcDbDatabase *pCurDb;<BR>        AcDbBlockTable *pBlkTable;<BR>        AcDbBlockTableRecord *pBlkTableRecord;<BR>        AcDbBlockReference *pInsrtObj;<BR>        AcDbObjectId blkId;<BR>        pCurDb = acdbHostApplicationServices()-&gt;workingDatabase();


        pCurDb-&gt;getBlockTable(pBlkTable, AcDb::kForRead);<BR>        if(!pBlkTable-&gt;has(blkName))<BR>        {<BR>                acutPrintf("\nBlock definition %s not found. ", blkName);<BR>                pBlkTable-&gt;close();<BR>                return;<BR>        }<BR><BR>        pBlkTable-&gt;getAt(blkName, blkId);


        pBlkTable-&gt;getAt(ACDB_MODEL_SPACE, pBlkTableRecord, AcDb::kForWrite);<BR>        pBlkTable-&gt;close();<BR>


        pInsrtObj = new AcDbBlockReference(insPt, blkId);


        pBlkTableRecord-&gt;appendAcDbEntity(blkId, pInsrtObj);


        pBlkTableRecord-&gt;close();<BR>        pInsrtObj-&gt;close();

王咣生 发表于 2005-1-11 13:03:00

参考:


                                AcDbBlockReference *blkRef = (AcDbBlockReference*)pEnt;<BR>                                if (blkRef) {<BR>                                        double sfx = blkRef-&gt;scaleFactors().sx;<BR>                                        double sfy = blkRef-&gt;scaleFactors().sy;<BR>                                        double sfz = blkRef-&gt;scaleFactors().sz;<BR>                                        blkRef-&gt;<b>setScaleFactors</b>(AcGeScale3d(sfx*sf, sfy*sf, sfz));<BR>                                }
页: [1]
查看完整版本: [ARX]请问高手,插入块时怎么改变块比例??