Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have spent all day trying to make an associative hatch and it just doesn't work. It says it is associative in properties panel but doesn't behave as one. I came across this but have not tried it yet. I think it should be possible to make associative hatch without involving reactors. Can anyone point me in the right direction. I am not sure what I am doing wrong. Please help. Note that the boundary is a simple close polyline.
bool AssociativeHatch(const AcDbObjectId& bdryId)
{
AcDbHatch* pHatch = new AcDbHatch();
pHatch->setDatabaseDefaults();
pHatch->setAssociative(Adesk::kTrue);
AcDbObjectIdArray boundaryIds;
boundaryIds.append(bdryId);
pHatch->appendLoop(AcDbHatch::kExternal, boundaryIds);
pHatch->setPattern(AcDbHatch::kPreDefined, _T("_SOLID"));
pHatch->evaluateHatch();
AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase();
AcDbBlockTable* pBlockTable = NULL;
AcDbBlockTableRecord* pMSpaceRecord = NULL;
pDb->getSymbolTable(pBlockTable, AcDb::kForRead);
pBlockTable->getAt(ACDB_MODEL_SPACE, pMSpaceRecord, AcDb::kForWrite);
AcDbObjectId hatchId;
pMSpaceRecord->appendAcDbEntity(hatchId, pHatch);
pMSpaceRecord->close();
pHatch->close();
return true;
}
Solved! Go to Solution.