ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to find the ID of an AcDbMLeaderStyle object?

1 REPLY 1
Reply
Message 1 of 2
zhengyunyang2019
167 Views, 1 Reply

How to find the ID of an AcDbMLeaderStyle object?

How can I find all MLeader style objects?

I have multiple MLeader style objects created in my CAD, and I need to use one of them.

I should find its ID first, but I don't know which interface to use.

1 REPLY 1
Message 2 of 2

AcDbDatabase *pCurDb = acdbCurDwg();
if (pCurDb) 
{
	AcDbDictionary *pStyleDict = nullptr;
	if (pCurDb->getMLeaderStyleDictionary(pStyleDict, AcDb::kForRead) == Acad::eOk) 
	{
		AcDbDictionaryIterator *pIter = pStyleDict->newIterator();
		for (; !pIter->done(); pIter->next()) 
		{
			AcDbObjectId styleId = pIter->objectId();
			AcDbObject *pObj;
			if (acdbOpenAcDbObject(pObj, styleId, AcDb::kForRead) == Acad::eOk) 
			{
				AcDbMLeaderStyle *pLeaderStyle = AcDbMLeaderStyle::cast(pObj);
				if (pLeaderStyle) 
				{
					
				}
				pObj->close();
			}
		}
		delete pIter;
		pStyleDict->close();
	}
}

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report