<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Code (Arx)  for Insert &amp;quot;TEXT&amp;quot; in Model in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/code-arx-for-insert-quot-text-quot-in-model/m-p/1883504#M22007</link>
    <description>HI  all,&lt;BR /&gt;
I wanted to have a single code for insert a text (String")  in Model , please, I am novice in this. &lt;BR /&gt;
for example that it primes my name  "Ayala Bizarro , Ivan"&lt;BR /&gt;
&lt;BR /&gt;
thank you  All&lt;BR /&gt;
Ayala Bizarro , Ivan&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: ivancho&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: ivancho

Message was edited by: ivancho</description>
    <pubDate>Wed, 07 Feb 2007 12:18:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-02-07T12:18:10Z</dc:date>
    <item>
      <title>Code (Arx)  for Insert "TEXT" in Model</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/code-arx-for-insert-quot-text-quot-in-model/m-p/1883504#M22007</link>
      <description>HI  all,&lt;BR /&gt;
I wanted to have a single code for insert a text (String")  in Model , please, I am novice in this. &lt;BR /&gt;
for example that it primes my name  "Ayala Bizarro , Ivan"&lt;BR /&gt;
&lt;BR /&gt;
thank you  All&lt;BR /&gt;
Ayala Bizarro , Ivan&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: ivancho&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: ivancho

Message was edited by: ivancho</description>
      <pubDate>Wed, 07 Feb 2007 12:18:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/code-arx-for-insert-quot-text-quot-in-model/m-p/1883504#M22007</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-02-07T12:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Code (Arx)  for Insert "TEXT" in Model</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/code-arx-for-insert-quot-text-quot-in-model/m-p/1883505#M22008</link>
      <description>Hm, i think that you need to do something like this. First you need this variables:&lt;BR /&gt;
CString strText; // Text to writte &lt;BR /&gt;
AcGePoint3d* position; //- text position &lt;BR /&gt;
double  height; // text height&lt;BR /&gt;
double rotation; // rotation (0.0f)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
// First take working database (dwg)&lt;BR /&gt;
AcDbDatabase*	pCurDb	= acdbHostApplicationServices()-&amp;gt;workingDatabase();&lt;BR /&gt;
	acDocManager-&amp;gt;lockDocument(acDocManager-&amp;gt;document(pCurDb));&lt;BR /&gt;
	if(!pCurDb)&lt;BR /&gt;
	{&lt;BR /&gt;
	    acDocManager-&amp;gt;unlockDocument(acDocManager-&amp;gt;document(pCurDb));&lt;BR /&gt;
		return FALSE;&lt;BR /&gt;
	}&lt;BR /&gt;
&lt;BR /&gt;
  &lt;BR /&gt;
  &lt;BR /&gt;
	//- Take block table&lt;BR /&gt;
	AcDbBlockTable* pBlockTable = NULL;&lt;BR /&gt;
	pCurDb-&amp;gt;getBlockTable(pBlockTable, AcDb::kForRead);&lt;BR /&gt;
	if(!pBlockTable)&lt;BR /&gt;
	{&lt;BR /&gt;
		acDocManager-&amp;gt;unlockDocument(acDocManager-&amp;gt;document(pCurDb));&lt;BR /&gt;
		return FALSE;&lt;BR /&gt;
	}&lt;BR /&gt;
    &lt;BR /&gt;
	AcDbBlockTableRecord* pBlockTableRecord;&lt;BR /&gt;
	ErrorStatus es = pBlockTable-&amp;gt;getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite);&lt;BR /&gt;
	if(!pBlockTableRecord)&lt;BR /&gt;
	{	&lt;BR /&gt;
		pBlockTable-&amp;gt;close();&lt;BR /&gt;
		acDocManager-&amp;gt;unlockDocument(acDocManager-&amp;gt;document(pCurDb));&lt;BR /&gt;
		return FALSE;&lt;BR /&gt;
	}	&lt;BR /&gt;
	pBlockTable-&amp;gt;close();&lt;BR /&gt;
	&lt;BR /&gt;
	//- Take text style&lt;BR /&gt;
	AcDbObjectId objId_TextStyle = AcDbObjectId::kNull;&lt;BR /&gt;
	AcDbSymbolUtilities::getTextStyleId(objId_TextStyle, _T("HCTEXT"), pCurDb);&lt;BR /&gt;
	&lt;BR /&gt;
	//- New text reference&lt;BR /&gt;
	AcDbText* pText = new AcDbText(*position, strText, objId_TextStyle, height, rotation);&lt;BR /&gt;
	&lt;BR /&gt;
	AcDbObjectId textID;&lt;BR /&gt;
	&lt;BR /&gt;
	//- Put text in database&lt;BR /&gt;
	pBlockTableRecord-&amp;gt;appendAcDbEntity(textID, pText);&lt;BR /&gt;
	&lt;BR /&gt;
	pBlockTableRecord-&amp;gt;close();&lt;BR /&gt;
	pText-&amp;gt;close();&lt;BR /&gt;
	acDocManager-&amp;gt;unlockDocument(acDocManager-&amp;gt;document(pCurDb));

Message was edited by: Andeo</description>
      <pubDate>Tue, 13 Feb 2007 08:39:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/code-arx-for-insert-quot-text-quot-in-model/m-p/1883505#M22008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-02-13T08:39:27Z</dc:date>
    </item>
  </channel>
</rss>

