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

Place Text via textblock on specific level c++ connect version 14 using visual studio 2017

$
0
0

Using the code from an example to simply place text in a design file.  This works great but I cannot find information that explains how to place this text on a specific level.  The current example places the text on the level "Default".  What needs to be added to the example code in order to place a simple text string on level 57?  Changing fonts, size etc is explained, but not adding with a specific level.

Public  int createText(Bentley::DPoint3dCP pntP, int view, EditElementHandleR eeh)
{
	Bentley::WString fmtStr("My Text String");
	//somehow set a level for the text before? Or modify text after creation?
	TextBlockPtr textBlock = TextBlock::Create(*DgnTextStyle::GetActive(), *ISessionMgr::GetActiveDgnModelP());
	textBlock->AppendText(fmtStr.GetWCharCP());
	textBlock->SetUserOrigin(*pntP);

	if (TEXTBLOCK_TO_ELEMENT_RESULT_Success != TextHandlerBase::CreateElement(eeh, NULL, *textBlock))
		return ERROR;

	return SUCCESS;
}

Thanks,

John


Viewing all articles
Browse latest Browse all 4331

Trending Articles



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