Message 1 of 3
Change xref color with overrules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
i need to color some entities using overrules.
Now I’m using AcGiDrawableOverrule::worldDraw.
It works fine with all entities but overrules.
Is there any way to color xref with AcGiDrawableOverrule?
My code (cleaned) + xref detection
virtual Adesk::Boolean worldDraw(AcGiDrawable* pSubject, AcGiWorldDraw * wd) { bool xref = false; AcDbEntity *asEnt = AcDbEntity::cast(pSubject); if (asEnt) { if (asEnt->isKindOf(AcDbBlockReference::desc())) { AcDbBlockReference *pBR = AcDbBlockReference::cast(asEnt); AcDbObjectId idBlk = pBR->blockTableRecord(); AcDbObject *pObj; acdbOpenObject(pObj, idBlk, AcDb::kForRead); AcDbBlockTableRecord * pBTR = AcDbBlockTableRecord::cast(pObj); if (pBTR != NULL) { if (pBTR->isFromExternalReference()) { xref = true; } } pObj->close(); } AcDbDatabase *db = asEnt->database(); if (db) { TopDwgStatus* dwgstatus = TopDwgStatus::find(db); if (dwgstatus) { AcDbObjectId idLay = asEnt->layerId(); wd->subEntityTraits().setColor(3); } } } Adesk::Boolean retValue = inherited::worldDraw(pSubject, wd); return retValue; }
Thanks in advance