本文整理汇总了C++中AcDbEntity::linetypeId方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbEntity::linetypeId方法的具体用法?C++ AcDbEntity::linetypeId怎么用?C++ AcDbEntity::linetypeId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbEntity
的用法示例。
在下文中一共展示了AcDbEntity::linetypeId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: asdktest1
void asdktest1 () {
//----- Select the entities
ads_name ss, en ;
if ( acedSSGet (NULL, NULL, NULL, NULL, ss) != RTNORM )
return ;
//----- Append entity IDs to the collector
long n ;
AcDbObjectId id ;
AsdkHlrCollector collector ;
collector.setDeleteState (true) ;
acedSSLength (ss, &n) ;
for ( int i =0 ; i < n ; i++ ) {
acedSSName (ss, i, en) ;
acdbGetObjectId (id, en) ;
collector.addEntity (id) ;
}
acedSSFree (ss) ;
//----- Get current viewport settings
struct resbuf rb;
acedGetVar(ACRX_T(/*NOXLATE*/"viewdir"), &rb);
ads_point dirPt;
acdbUcs2Wcs (rb.resval.rpoint, dirPt, Adesk::kTrue) ;
acedGetVar(ACRX_T(/*NOXLATE*/"target"), &rb);
ads_point tarPt;
acdbUcs2Wcs (rb.resval.rpoint, tarPt, Adesk::kFalse) ;
//----- Ask if non-visible edges should be created
int hidLines =AfxMessageBox (ACRX_T("Would you like to see hidden lines?"), MB_YESNO) ;
int honorInt =AfxMessageBox (ACRX_T("Would you like to honor internal visibility of polyface meshes or ACIS objects?"), MB_YESNO) ;
int meshSils =AfxMessageBox (ACRX_T("Would you like to calculate silhouettes of polyface meshes?"), MB_YESNO) ;
int unit =AfxMessageBox (ACRX_T("Would you like to unit solid before processing?"), MB_YESNO) ;
//----- Process hidden line removal
AsdkHlrEngine hlr (
asPnt3d (tarPt), asVec3d (dirPt),
kEntity | kBlock | kSubentity | kProgress
| (honorInt == IDYES ? kHonorInternals : 0)
| (hidLines == IDYES ? kShowAll : 0)
| (meshSils == IDYES ? kMeshSilhouettes : 0)
| (unit == IDYES ? kUnite : 0)
) ;
hlr.setAcisConversionProgressCallBack (progress1) ;
hlr.setAhlProgressCallBack (progress2) ;
hlr.setAcadConversionProgressCallBack (progress3) ;
acedSetStatusBarProgressMeter (ACRX_T("HLR running: "), 0, 300) ;
hlr.run (collector) ;
acedRestoreStatusBar () ;
//----- Assign color to the resulting entities
//----- red for visible edges
//----- blue for non-visible edges
//----- yellow for internal edges
n =collector.mOutputData.logicalLength () ;
for (int i =0 ; i < n ; i++ ) {
AsdkHlrData *p =collector.mOutputData [i] ;
AcDbEntity *pEnt =p->getResultEntity () ;
AsdkHlrData::Visibility vis =p->getVisibility () ;
if ( vis == AsdkHlrData::kVisible ) {
pEnt->setColorIndex (1) ; //----- Read
} else if ( vis == AsdkHlrData::kInternallyHidden ) {
if ( p->getHlrVisibility () == AsdkHlrData::kVisible )
pEnt->setColorIndex (2) ; //----- Yellow
else
pEnt->setColorIndex (3) ; //----- Green
} else {
pEnt->setColorIndex (5) ; //----- Blue
}
if ( postToDatabase (NULL, pEnt, id) != Acad::eOk ) {
acutPrintf (_T("Failed to add entity to current space.\n")) ;
break ;
}
if ( acdbOpenAcDbEntity (pEnt, id, AcDb::kForRead) != Acad::eOk ) {
acutPrintf (_T("Failed to open last added outputed curve.\n")) ;
break ;
}
//----- Entity originator path for block reference entities
AcDbObjectIdArray ids =p->getObjectIds () ;
if ( ids.logicalLength () > 0 ) {
acutPrintf (ACRX_T("\n%lx, "), pEnt->objectId ().asOldId ()) ;
if ( p->getSubentId ().type () != AcDb::kNullSubentType )
acutPrintf (ACRX_T("[%ld, %ld], "), p->getSubentId ().type (), p->getSubentId ().index ()) ;
for ( int j =0 ; j < ids.logicalLength () ; j++ )
acutPrintf (ACRX_T("%lx, "), ids.at (j).asOldId ()) ;
AcDbObjectId id =ids.last () ;
if ( !id.isNull () ) {
AcDbEntity *ent =NULL ;
acdbOpenAcDbEntity (ent, id, AcDb::kForRead) ;
id =ent->linetypeId () ;
ent->close () ;
if ( pEnt->upgradeOpen () == Acad::eOk )
pEnt->setLinetype (id) ;
}
}
//.........这里部分代码省略.........