<?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 Splitting Drawings in Layout in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Splitting-Drawings-in-Layout/m-p/277472#M2119</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hi,&lt;BR /&gt;I am trying to Split a drawing into two drawings.&lt;BR /&gt;The situation is:&lt;BR /&gt;While placing a drawing in layout we need to split the drawing into two drawings(just make the drawing into half) and will put in on the layout.&lt;BR /&gt;I have tried it with "&lt;STRONG&gt;APIDb_StartClippingSessionID&lt;/STRONG&gt;" function:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;API_Region          clipRegion;
BNZeroMemory(&amp;amp;clipRegion, sizeof(API_Region));
clipRegion.box.xMin = 0.0;
clipRegion.box.xMax = .2;
clipRegion.box.yMin = 0.0;
clipRegion.box.yMax = .1;

err = ACAPI_Database(APIDb_StartClippingSessionID, nullptr, nullptr);
if (err == NoError) {
		API_Element element;
		BNZeroMemory(&amp;amp;element, sizeof(API_Element));
		element.header.typeID = API_DrawingID;
		err = ACAPI_Element_GetDefaults(&amp;amp;element, nullptr);
		if (err != NoError) {
			return err;
		}
		//here the Selectedguid array holds the ViewNavigator Item guid
		element.drawing.drawingGuid = Selectedguid[0];
		element.drawing.anchorPoint = APIAnc_LB;
		element.drawing.pos.x = 0.05;
		element.drawing.pos.y = 0.05;
		err = ACAPI_CallUndoableCommand("crate new from last drawing", [&amp;amp;]()-&amp;gt;GSErrCode {
			err = ACAPI_Element_Create(&amp;amp;element, nullptr);
			err = ACAPI_Database(APIDb_DoClipID, &amp;amp;clipRegion, nullptr);
			err = ACAPI_Database(APIDb_StopClippingSessionID, nullptr, nullptr);
			return err;
			});
&lt;/PRE&gt;
But it's not working. On&lt;STRONG&gt; "ACAPI_Database(APIDb_DoClipID, &amp;amp;clipRegion, nullptr)"&lt;/STRONG&gt; method getting error code "-2130313215" that refers to the "General error code".&lt;BR /&gt;Any suggestion how can I achieve it?&lt;/DIV&gt;</description>
    <pubDate>Tue, 14 Sep 2021 07:32:35 GMT</pubDate>
    <dc:creator>Nayan</dc:creator>
    <dc:date>2021-09-14T07:32:35Z</dc:date>
    <item>
      <title>Splitting Drawings in Layout</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Splitting-Drawings-in-Layout/m-p/277472#M2119</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi,&lt;BR /&gt;I am trying to Split a drawing into two drawings.&lt;BR /&gt;The situation is:&lt;BR /&gt;While placing a drawing in layout we need to split the drawing into two drawings(just make the drawing into half) and will put in on the layout.&lt;BR /&gt;I have tried it with "&lt;STRONG&gt;APIDb_StartClippingSessionID&lt;/STRONG&gt;" function:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;API_Region          clipRegion;
BNZeroMemory(&amp;amp;clipRegion, sizeof(API_Region));
clipRegion.box.xMin = 0.0;
clipRegion.box.xMax = .2;
clipRegion.box.yMin = 0.0;
clipRegion.box.yMax = .1;

err = ACAPI_Database(APIDb_StartClippingSessionID, nullptr, nullptr);
if (err == NoError) {
		API_Element element;
		BNZeroMemory(&amp;amp;element, sizeof(API_Element));
		element.header.typeID = API_DrawingID;
		err = ACAPI_Element_GetDefaults(&amp;amp;element, nullptr);
		if (err != NoError) {
			return err;
		}
		//here the Selectedguid array holds the ViewNavigator Item guid
		element.drawing.drawingGuid = Selectedguid[0];
		element.drawing.anchorPoint = APIAnc_LB;
		element.drawing.pos.x = 0.05;
		element.drawing.pos.y = 0.05;
		err = ACAPI_CallUndoableCommand("crate new from last drawing", [&amp;amp;]()-&amp;gt;GSErrCode {
			err = ACAPI_Element_Create(&amp;amp;element, nullptr);
			err = ACAPI_Database(APIDb_DoClipID, &amp;amp;clipRegion, nullptr);
			err = ACAPI_Database(APIDb_StopClippingSessionID, nullptr, nullptr);
			return err;
			});
&lt;/PRE&gt;
But it's not working. On&lt;STRONG&gt; "ACAPI_Database(APIDb_DoClipID, &amp;amp;clipRegion, nullptr)"&lt;/STRONG&gt; method getting error code "-2130313215" that refers to the "General error code".&lt;BR /&gt;Any suggestion how can I achieve it?&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:32:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Splitting-Drawings-in-Layout/m-p/277472#M2119</guid>
      <dc:creator>Nayan</dc:creator>
      <dc:date>2021-09-14T07:32:35Z</dc:date>
    </item>
  </channel>
</rss>

