<?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: Problem creating camera in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Problem-creating-camera/m-p/101035#M8063</link>
    <description>yes, and the camset gets created fine</description>
    <pubDate>Tue, 14 Jun 2005 01:32:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-06-14T01:32:56Z</dc:date>
    <item>
      <title>Problem creating camera</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Problem-creating-camera/m-p/101033#M8061</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am in the process of porting my APX over to the 6.1 API using ArchiCAD v9.&lt;BR /&gt;&lt;BR /&gt;My problem is with code that used to create a 3d camera that looks down over my plan. I can't see any reason why it should not work in v9 but I get an APIERR_BADINDEX every time.&lt;BR /&gt;&lt;BR /&gt;I'm not too worried about most of the values I just want a camera that shows a 3d floorplan ie. a single frame above the house facing down. In v7 I just set camSetIndex to 1 and it worked fine.&lt;BR /&gt;&lt;BR /&gt;memset(&amp;amp;element, 0, sizeof(API_Element));&lt;BR /&gt;element.header.typeID = API_CamSetID;&lt;BR /&gt;element.camset.camType = API_PersCamera;&lt;BR /&gt;strcpy(element.camset.name, "test");&lt;BR /&gt;element.camset.u.perspPars.openedPath = true;&lt;BR /&gt;element.camset.u.perspPars.bezierPath = false;&lt;BR /&gt;element.camset.u.perspPars.smoothTarget = false;&lt;BR /&gt;element.camset.u.perspPars.pen = 1;&lt;BR /&gt;element.camset.u.perspPars.inFrames = 0;&lt;BR /&gt;element.camset.active = false;&lt;BR /&gt;err = ACAPI_Element_Create(&amp;amp;element, NULL);&lt;BR /&gt;if(err == noErr) {&lt;BR /&gt;camSetIndex = element.header.index;&lt;BR /&gt;memset(&amp;amp;element, 0, sizeof(API_Element));&lt;BR /&gt;element.header.typeID = API_CameraID;&lt;BR /&gt;element.camera.camSetIndex = camSetIndex;&lt;BR /&gt;element.camera.camType = API_PersCamera;&lt;BR /&gt;element.camera.u.perspCam.pen = 1;&lt;BR /&gt;element.camera.u.perspCam.active = true;&lt;BR /&gt;element.camera.u.perspCam.persp.cameraZ = 30;&lt;BR /&gt;element.camera.u.perspCam.persp.distance = 10;&lt;BR /&gt;element.camera.u.perspCam.persp.viewCone = 90.0 * DEGRAD;&lt;BR /&gt;element.camera.u.perspCam.persp.azimuth = 270.0 * DEGRAD;&lt;BR /&gt;element.camera.u.perspCam.persp.rollAngle = 270 * DEGRAD;&lt;BR /&gt;element.camera.u.perspCam.persp.pos.x = centerX;&lt;BR /&gt;element.camera.u.perspCam.persp.pos.y = centerY;&lt;BR /&gt;element.camera.u.perspCam.persp.sunAltitude = 50.0 * DEGRAD;&lt;BR /&gt;element.camera.u.perspCam.persp.sunAzumuth = 240.0&lt;BR /&gt;element.camera.u.perspCam.persp.target.x = centerX;&lt;BR /&gt;element.camera.u.perspCam.persp.target.y = centerY;&lt;BR /&gt;element.camera.u.perspCam.persp.targetZ = 0.0&lt;BR /&gt;err = ACAPI_Element_Create(&amp;amp;element, NULL);&lt;BR /&gt;if(err != noErr)&lt;BR /&gt;{&lt;BR /&gt;// err is APIERR_BADINDEX&lt;BR /&gt;}&lt;BR /&gt;}&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Aug 2023 10:02:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Problem-creating-camera/m-p/101033#M8061</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-07T10:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem creating camera</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Problem-creating-camera/m-p/101034#M8062</link>
      <description>&lt;BLOCKQUOTE&gt;adambutler wrote:&lt;BR /&gt;My problem is with code that used to create a 3d camera that looks down over my plan. I can't see any reason why it should not work in v9 but I get an APIERR_BADINDEX every time.
&lt;/BLOCKQUOTE&gt;

Are you initialising the undo session before creating the camera element? i.e. 	ACAPI_OpenUndoableSession and ACAPI_CloseUndoableSession.</description>
      <pubDate>Fri, 10 Jun 2005 22:49:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Problem-creating-camera/m-p/101034#M8062</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2005-06-10T22:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem creating camera</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Problem-creating-camera/m-p/101035#M8063</link>
      <description>yes, and the camset gets created fine</description>
      <pubDate>Tue, 14 Jun 2005 01:32:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Problem-creating-camera/m-p/101035#M8063</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-14T01:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem creating camera</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Problem-creating-camera/m-p/101036#M8064</link>
      <description>I found the problem. AC9 requires me to set prevCam to -1.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Adam</description>
      <pubDate>Tue, 14 Jun 2005 04:21:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Problem-creating-camera/m-p/101036#M8064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-14T04:21:42Z</dc:date>
    </item>
  </channel>
</rss>

