<?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 Re: How to Create Layer ArchiCAD27/C++ in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-Create-Layer-ArchiCAD27-C/m-p/655117#M10209</link>
    <description>&lt;P&gt;Thank you.&lt;BR /&gt;I success [CreateLayer]&lt;BR /&gt;&lt;BR /&gt;My ArchiCAD is not DEMO version.&lt;BR /&gt;&lt;BR /&gt;I think on our result.&lt;BR /&gt;My Error Reason is that [Create Layer] is on Constructor in Global Variables.&lt;/P&gt;&lt;P&gt;CreateLayer() move to oter function from Constructor.&lt;BR /&gt;&lt;BR /&gt;===== Addon.cpp&lt;BR /&gt;class MainData {&lt;BR /&gt;public:&lt;BR /&gt;&amp;nbsp; MainData() {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&amp;nbsp; &amp;nbsp; CreateLayer(...);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;MainData mMaindata;&lt;BR /&gt;----Addon's Functions&lt;BR /&gt;....&lt;BR /&gt;================&lt;BR /&gt;Error&amp;nbsp;&lt;BR /&gt;Start ArchiCAD27 execute constructor of mMainData before [New Project] or [Load Project].&lt;BR /&gt;--&amp;gt;constructor of mMainData&lt;BR /&gt;-&amp;gt; CreateLayer() Error&lt;BR /&gt;-&amp;gt;after [New Project] or [Load Project].&lt;BR /&gt;--&amp;gt;on Select Addon Menu&lt;BR /&gt;--&amp;gt;call CreateLayer() on button&amp;nbsp;&lt;BR /&gt;-&amp;gt; CreateLayer() Error&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;//----Success Pattern&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;class MainData {&lt;BR /&gt;public:&lt;BR /&gt;&amp;nbsp; MainData() {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&amp;nbsp; &amp;nbsp;// CreateLayer(...);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; void Go() {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;CreateLayer(...);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;};&lt;BR /&gt;MainData mMaindata;&lt;BR /&gt;&lt;BR /&gt;And&amp;nbsp;&lt;BR /&gt;On Addon - Menu Click&lt;BR /&gt;&amp;nbsp; mMainData.go();&lt;/P&gt;</description>
    <pubDate>Fri, 14 Mar 2025 05:32:48 GMT</pubDate>
    <dc:creator>nishida_jp</dc:creator>
    <dc:date>2025-03-14T05:32:48Z</dc:date>
    <item>
      <title>How to Create Layer ArchiCAD27/C++</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-Create-Layer-ArchiCAD27-C/m-p/654918#M10204</link>
      <description>&lt;P&gt;I'm programing on ArchiCAD27/VisualStudio C++2019/Windows10.&lt;BR /&gt;But my function can not create layer&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;LI-CODE lang="cpp"&gt;GSErrCode CreateLayer(GS::UniString layer_name, API_Attribute* attr) {
BNZeroMemory(attr, sizeof(API_Attribute));
attr-&amp;gt;header.typeID = API_LayerID;
attr-&amp;gt;header.uniStringNamePtr = &amp;amp;layer_name;

GS::UniString title = u8"Create Layer";
GSErrCode res = ACAPI_Attribute_Create(attr, nullptr);    //1)
if (res == APIERR_NEEDSUNDOSCOPE) {
        res = ACAPI_CallUndoableCommand(title, [&amp;amp;]()-&amp;gt;GSErrCode {
            return(ACAPI_Attribute_Create(attr, nullptr));
        });
}
return(res);
}&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;1) res ==&amp;nbsp;&amp;nbsp;-213031231&amp;nbsp; meaning&lt;BR /&gt;APIERR_NOTSUPPORTED&lt;BR /&gt;&lt;BR /&gt;why i cannot create layer ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 11:51:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-Create-Layer-ArchiCAD27-C/m-p/654918#M10204</guid>
      <dc:creator>nishida_jp</dc:creator>
      <dc:date>2025-03-13T11:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to Create Layer ArchiCAD27/C++</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-Create-Layer-ArchiCAD27-C/m-p/655099#M10207</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you using a demo version or full version of ArchiCAD? Can you show us how you are calling your function? I was able to call your function successfully and create a layer using;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;	GS::ErrCode		err = NoError;
	API_Attribute	myAttribute = {};

	err = CreateLayer("A TEST LAYER", &amp;amp;myAttribute);

	ACAPI_WriteReport("CreateLayer returned error [%ld]", false, err);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, creating an attribute / layer is non-undoable, so doesn't need the undo fallback code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Danny&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 00:06:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-Create-Layer-ArchiCAD27-C/m-p/655099#M10207</guid>
      <dc:creator>Danny Sparks-Cousins</dc:creator>
      <dc:date>2025-03-14T00:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Create Layer ArchiCAD27/C++</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-Create-Layer-ArchiCAD27-C/m-p/655117#M10209</link>
      <description>&lt;P&gt;Thank you.&lt;BR /&gt;I success [CreateLayer]&lt;BR /&gt;&lt;BR /&gt;My ArchiCAD is not DEMO version.&lt;BR /&gt;&lt;BR /&gt;I think on our result.&lt;BR /&gt;My Error Reason is that [Create Layer] is on Constructor in Global Variables.&lt;/P&gt;&lt;P&gt;CreateLayer() move to oter function from Constructor.&lt;BR /&gt;&lt;BR /&gt;===== Addon.cpp&lt;BR /&gt;class MainData {&lt;BR /&gt;public:&lt;BR /&gt;&amp;nbsp; MainData() {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&amp;nbsp; &amp;nbsp; CreateLayer(...);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;MainData mMaindata;&lt;BR /&gt;----Addon's Functions&lt;BR /&gt;....&lt;BR /&gt;================&lt;BR /&gt;Error&amp;nbsp;&lt;BR /&gt;Start ArchiCAD27 execute constructor of mMainData before [New Project] or [Load Project].&lt;BR /&gt;--&amp;gt;constructor of mMainData&lt;BR /&gt;-&amp;gt; CreateLayer() Error&lt;BR /&gt;-&amp;gt;after [New Project] or [Load Project].&lt;BR /&gt;--&amp;gt;on Select Addon Menu&lt;BR /&gt;--&amp;gt;call CreateLayer() on button&amp;nbsp;&lt;BR /&gt;-&amp;gt; CreateLayer() Error&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;//----Success Pattern&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;class MainData {&lt;BR /&gt;public:&lt;BR /&gt;&amp;nbsp; MainData() {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&amp;nbsp; &amp;nbsp;// CreateLayer(...);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; void Go() {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;CreateLayer(...);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;};&lt;BR /&gt;MainData mMaindata;&lt;BR /&gt;&lt;BR /&gt;And&amp;nbsp;&lt;BR /&gt;On Addon - Menu Click&lt;BR /&gt;&amp;nbsp; mMainData.go();&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 05:32:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-Create-Layer-ArchiCAD27-C/m-p/655117#M10209</guid>
      <dc:creator>nishida_jp</dc:creator>
      <dc:date>2025-03-14T05:32:48Z</dc:date>
    </item>
  </channel>
</rss>

