Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

Microstation CE U12 C++:How to get the actual width and height of a text node?

$
0
0

After using TextBlockPtr to create a text node, we want to get the actual width and height of the created text node. But we can't find any useful functions within TextBlock class

Any idea how to get the actual width and height of an existing text element?

TextBlockPtr textBlock = TextBlock::Create(*tbProps, *paraProps, *runProps, *ISessionMgr::GetActiveDgnModelP());

	textBlock->SetProperties(*tbProps);
	textBlock->SetUserOrigin(insPt);

	textBlock->AppendText(_T("Hello World!"));

	EditElementHandle textElm;

	if (TEXTBLOCK_TO_ELEMENT_RESULT_Success != TextHandlerBase::CreateElement(textElm, NULL, *textBlock))
	{
		CString sMsgInfo;
		sMsgInfo.Format(_T("Can't create text element."));
		mdlDialog_openInfoBox(sMsgInfo);
		return FALSE;
	}

    //how to get the actual height of the created text node? Especially when we specified the width of the text node and the text node is wrapped to multi-lines.


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>