Hi,
when I create table manually (using Place Table tool), it's automatically placed as annotation (the property IsAnnotation = true).
But when I do the same from C# API (through TextTable and TextTableElement), Annotation property is set to false.
How the table can be set to be annotation? I do not see e.g. IsAnnotation (like for cells) or anything similar both in NET and C++ API.
Or the only way (I did not test it yet) is to place the table and to change the property using e.g. EC property?
With regards,
Jan
I don't try .NET but C++ API can implement this as below:
void createAnnotationTextTable(WCharCP unparsed) { DgnModelP pDgnModel = ISessionMgr::GetActiveDgnModelP(); DgnTextStylePtr pTxtStyle = DgnTextStyle::GetActive(); TextTablePtr pTable = TextTable::Create(3, 4, pTxtStyle->GetID(), 1000, *pDgnModel); pTable->SetOrigin(DPoint3d::From(1000, 1000)); EditElementHandle eeh; TextTableHandler::CreateTextTableElement(eeh, *pTable); IAnnotationHandlerP annoHandler = dynamic_cast<IAnnotationHandlerP>(&eeh.GetHandler()); annoHandler->AddAnnotationScale(eeh, ISessionMgr::GetActiveDgnModelP()); eeh.AddToModel(); }
Answer Verified By: Jan Šlegr
Hi Yongan.Fu,
thanks a lot, after necessary conversion this approach works fine also in NET :-)
Regards,
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point