<?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 AcDbObjectId (*)()&amp;quot; is incompatible with parameter of type &amp;quot;AcRxFunctionPtr&amp;quot; in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11524877#M2163</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm absolutely new to this, trying to learn.&lt;/P&gt;&lt;P&gt;I'm getting the above error when trying to create new command calling the createLine() function from the Object ARX help webpage. What am I doing wrong here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I'm creating new commands.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;void initApp()
{
	//Register a command with AutoCAD command mechanics.
	acedRegCmds-&amp;gt;addCommand(_T("HelloWorld_Commands"),
		_T("Hello"),
		_T("SayHello"),
		ACRX_CMD_TRANSPARENT,
		helloworld);
	acedRegCmds-&amp;gt;addCommand(_T("HelloWorld_Commands"),
		_T("FAPLCreateLine"),
		_T("FAPLCreateLine"),
		ACRX_CMD_TRANSPARENT,
		createLine);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is the createLine( ) function from the help webpage.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;AcDbObjectId createLine()
//void createLine()
{
	AcGePoint3d startPt(4.0, 2.0, 0.0);
	AcGePoint3d endPt(10.0, 7.0, 0.0);
	AcDbLine *pLine = new AcDbLine(startPt, endPt);
	AcDbBlockTable *pBlockTable;
	acdbHostApplicationServices()-&amp;gt;workingDatabase()
		-&amp;gt;getSymbolTable(pBlockTable, AcDb::kForRead);
	AcDbBlockTableRecord *pBlockTableRecord;
	pBlockTable-&amp;gt;getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
		AcDb::kForWrite);
	pBlockTable-&amp;gt;close();
	AcDbObjectId lineId;
	pBlockTableRecord-&amp;gt;appendAcDbEntity(lineId, pLine);
	pBlockTableRecord-&amp;gt;close();
	pLine-&amp;gt;close();
	return lineId;
}&lt;/LI-CODE&gt;&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Nov 2022 09:22:08 GMT</pubDate>
    <dc:creator>ShricharanaB</dc:creator>
    <dc:date>2022-11-02T09:22:08Z</dc:date>
    <item>
      <title>AcDbObjectId (*)()" is incompatible with parameter of type "AcRxFunctionPtr"</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11524877#M2163</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm absolutely new to this, trying to learn.&lt;/P&gt;&lt;P&gt;I'm getting the above error when trying to create new command calling the createLine() function from the Object ARX help webpage. What am I doing wrong here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I'm creating new commands.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;void initApp()
{
	//Register a command with AutoCAD command mechanics.
	acedRegCmds-&amp;gt;addCommand(_T("HelloWorld_Commands"),
		_T("Hello"),
		_T("SayHello"),
		ACRX_CMD_TRANSPARENT,
		helloworld);
	acedRegCmds-&amp;gt;addCommand(_T("HelloWorld_Commands"),
		_T("FAPLCreateLine"),
		_T("FAPLCreateLine"),
		ACRX_CMD_TRANSPARENT,
		createLine);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is the createLine( ) function from the help webpage.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;AcDbObjectId createLine()
//void createLine()
{
	AcGePoint3d startPt(4.0, 2.0, 0.0);
	AcGePoint3d endPt(10.0, 7.0, 0.0);
	AcDbLine *pLine = new AcDbLine(startPt, endPt);
	AcDbBlockTable *pBlockTable;
	acdbHostApplicationServices()-&amp;gt;workingDatabase()
		-&amp;gt;getSymbolTable(pBlockTable, AcDb::kForRead);
	AcDbBlockTableRecord *pBlockTableRecord;
	pBlockTable-&amp;gt;getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
		AcDb::kForWrite);
	pBlockTable-&amp;gt;close();
	AcDbObjectId lineId;
	pBlockTableRecord-&amp;gt;appendAcDbEntity(lineId, pLine);
	pBlockTableRecord-&amp;gt;close();
	pLine-&amp;gt;close();
	return lineId;
}&lt;/LI-CODE&gt;&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 09:22:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11524877#M2163</guid>
      <dc:creator>ShricharanaB</dc:creator>
      <dc:date>2022-11-02T09:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: AcDbObjectId (*)()" is incompatible with parameter of type "AcRxFunctionPtr"</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11525322#M2164</link>
      <description>&lt;P&gt;createLine have return nothing (e.g. void)&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 12:33:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11525322#M2164</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2022-11-02T12:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: AcDbObjectId (*)()" is incompatible with parameter of type "AcRxFunctionPtr"</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11525432#M2165</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand what you are trying to say. In the createLine function the LineID is being returned.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or are you saying the addCommand is expecting a void function?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that is the case, how to I add the command so that it can execute the createLine() function which is not&amp;nbsp; a void function?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try converting the&amp;nbsp;createLine() function to void function and removing the return line, but that doesn't work either. I think it has to be&amp;nbsp;AcDbObjectId createLine().&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 13:16:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11525432#M2165</guid>
      <dc:creator>ShricharanaB</dc:creator>
      <dc:date>2022-11-02T13:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: AcDbObjectId (*)()" is incompatible with parameter of type "AcRxFunctionPtr"</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11525443#M2166</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12961036"&gt;@ShricharanaB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Function that registered with&amp;nbsp;acedRegCmds-&amp;gt;addCommand may not return any value. This function has declaration such as:&lt;/P&gt;
&lt;P&gt;void&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;createLine(void);&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 13:19:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11525443#M2166</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2022-11-02T13:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: AcDbObjectId (*)()" is incompatible with parameter of type "AcRxFunctionPtr"</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11527258#M2167</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That worked. I was able to compile and test the arx file.&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;void createLine()
{
	AcGePoint3d startPt(4.0, 2.0, 0.0);
	AcGePoint3d endPt(10.0, 7.0, 0.0);
	AcDbLine *pLine = new AcDbLine(startPt, endPt);
	AcDbBlockTable *pBlockTable;
	acdbHostApplicationServices()-&amp;gt;workingDatabase()
		-&amp;gt;getSymbolTable(pBlockTable, AcDb::kForRead);
	AcDbBlockTableRecord *pBlockTableRecord;
	pBlockTable-&amp;gt;getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
		AcDb::kForWrite);
	pBlockTable-&amp;gt;close();
	AcDbObjectId lineId;
	pBlockTableRecord-&amp;gt;appendAcDbEntity(lineId, pLine);
	pBlockTableRecord-&amp;gt;close();
	pLine-&amp;gt;close();
	
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 04:36:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbobjectid-quot-is-incompatible-with-parameter-of-type-quot/m-p/11527258#M2167</guid>
      <dc:creator>ShricharanaB</dc:creator>
      <dc:date>2022-11-03T04:36:38Z</dc:date>
    </item>
  </channel>
</rss>

