by Fenton Webb
Iso symbols are not represented in the project database like other piping model objects. They are “markers” that are only used by the Isometrics feature and reside entirely within the DWG file.
Iso symbols are connected to existing fittings via a symbolic ports (not represented in project database) that must be added to the fitting AND to the Isometric symbol itself. No connector entity is involved with symbol connections.
Here is some pseudo code containing additional comments about what needs to be done:
// ....
// ....
if(Endpoints.size() > 0)
{
AcPpDb3dIsoSphereSymbol* isSymbol = new AcPpDb3dIsoSphereSymbol();
isSymbol->setPosition(Endpoints.at(0).getAcGePoint3d());
AcDbObjectId curSpace = curDoc()->database()->currentSpaceId();
AcDbBlockTableRecordPointer curSpace(curSpace, AcDb::kForWrite);
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlock, AcDb::kForWrite);
// TODO:
// set isSymbol properties
// setBlockId(), setPosition(), setRadius(), setLayer()
// add a new symbolic port to
//
AcPp3dPort port;
port.setIsSymbolic(true);
port.setPosition(isSymbol->position());
port.setDirection(AcGeVector3d(0,0,1)); // set direction correctly
port.setName(L"Symbolic");
isSymbol->addPort(port);
AcDbObjectId isSymbolBlockId;
int appendConnectorEntryError = pBlock->appendAcDbEntity(isSymbolBlockId, isSymbol);
// TODO:
// open the fitting you want to connect to kForWrite; AcPpDb3dPart derived
// open fitting denoted by pPart below
//
AcPp3dPort port1;
port1.setIsSymbolic(true);
AcString symbolicPortName = pPart->generateDynamicPortName(true);
port1.setName(symbolicPortName.kACharPtr());
port1.setPosition(pSymbol->position());
// set direction correctly
port1.setDirection(AcGeVector3d(0,0,-1));
// this is the fitting the iso symbol is going to be connected to
pPart->addPort(port1);
isSymbol->close();
// TODO: use AcPpDb3dConnectionManager to connect iso symbol to fitting
// port to port1 connection on respective objects