Quantcast
Channel: ArchiCAD-Talk - Developer Forum
Viewing all 564 articles
Browse latest View live

How to get the TypeID of a .gsm file

$
0
0
Author:gehairing
Posted: Fri Oct 23, 2015 5:43 pm (GMT+1)


Hi all Smile

I want to register library parts that i receive from a distant server as .gsm files. I copy the gsm file locally on the computer and then i want to "register" the libpart.

This works if i give the "typeID" and the path to the local file like here :

Code:
libPart.typeID   = APILib_ObjectID;
         libPart.location = &myGsmFilePath;
         err = ACAPI_LibPart_Register(&libPart);
         if(err == NoError)
         {
            ...
         }


But...it doesn't work anymore when i don't provide the typeID.
I mean...the libPart.location information is not enough.

How can i know what is the typeID of a libpart in a gsm file ?


Coordinating Attributes in multi-PLN projects

$
0
0
Author:jameshart
Posted: Fri Oct 23, 2015 8:42 pm (GMT+1)


Well I know 11 years have passed since this was posted, but I'd like to revive this discussion!

This is a huge headache for us since several of our multi-family projects have multiple buildings. We have been using the attribute manager to manually keep each building's attribute in sync, but if a mistake is made then it can become quite the nightmare.

I wish ArchiCAD had the option to look to another solo or teamwork file for attributes. So for example, I wish we could designate one building in the project (for example "building 1") as the attribute master file, and have the other buildings read attributes from it automatically.

I realize that you can have the attribute manager "see inside" other .pln files, but that is not automatically updating and it cannot "see inside" a teamwork file.
_________________
ArchiCAD 18 (6000 USA), Cadimage Keynotes & Coverings, 3.2GHz Intel Core i5 iMac, 16GB RAM, 10.10.5, NVIDIA GeForce GT 755M

Coordinating Attributes in multi-PLN projects

$
0
0
Author:laszlonagy
Posted: Sat Oct 24, 2015 12:00 am (GMT+1)


Yes, this is still an issue.
I agree, designation of one PLN file as the master in this regard would be helpful.
Or, a number of PLN files could be grouped, and an attribute change in any of them would be updated in all of them.
Of course, it would not be that simple. For example, when one of these files is open by the user, an alert would appear to tell him that attributes have changed and what this change is, and ask if he wants to update his file.
If a file is not open, it could be updated automatically.
Maybe this could be a function of the BIM Server.
_________________
Laszlo Nagy, Moderator, Site Admin
ASUS G73SW, i7-2630QM 16 GB RAM
17.3" (1920x1080), NVidia GTX 460M 1.5 GB RAM
60 GB SSD, 750 GB HDD, Win7-64 ENG
AC13-AC19 (64-bit, latest build)
Loving ArchiCAD since 1995

Archicad 19 crashes on line ACAPI_Interface

$
0
0
Author:ggiloyan
Posted: Wed Oct 28, 2015 5:51 pm (GMT+1)


Hi

Today I tried to compile my add-on by DevKit19 for Archicad19

In my code I have a progress bar logic.
It's working fine in Archicad 18 but in Archicad19 it crashes

Here is the exact code where it crashes

Code:
ACAPI_Interface (APIIo_InitProcessWindowID, "Connecting ... ", &nPhase);


Thanks in advnace.

Archicad 19 crashes on line ACAPI_Interface

$
0
0
Author:Oleg
Posted: Thu Oct 29, 2015 7:12 am (GMT+1)


Title parameter is GS::UniString in AC19.
May be it is a reason.

Extractelement 3d geometry using C++ API

$
0
0
Author:Arularasu
Posted: Mon Nov 02, 2015 1:27 pm (GMT+1)


How to get the element (Slap, wall, roof, extrude etc..) 3d geometry such as profile, polygon coordinates, surface etc.

How to get currently selected Library Part

$
0
0
Author:gehairing
Posted: Mon Nov 02, 2015 5:25 pm (GMT+1)


Hi all Smile

I try to get the currently selected library part.
I mean the object selected (in green) by user in the current model.

I have tried following code but it doesn't seem to work Sad

Code:
   GSErrCode err;
   
   // Get selected elements
   API_SelectionInfo selectionInfo;
   API_Neig **selNeigs;
   err = ACAPI_Selection_Get (&selectionInfo, &selNeigs, false);
   if (err == NoError)
   {
      if (selectionInfo.typeID != API_SelEmpty)
      {
         UInt32    ii, nSel;
         nSel = BMGetHandleSize ((GSHandle) selNeigs) / sizeof (API_Neig);
         for (ii = 0; ii < nSel && err == NoError; ii++)
         {
            GS::UniString selectedGuid = APIGuidToString((*selNeigs)[ii].guid);
            API_NeigID selectedID = (*selNeigs)[ii].neigID;
         
            API_Element  element;
            BNZeroMemory (&element, sizeof (API_Element));
            element.header.guid  = (*selNeigs)[ii].guid;
            err = ACAPI_Element_Get(&element);
            if(err == NoError)
            {
               // Find the library part
               API_LibPart libpart;
               BNZeroMemory (&libpart, sizeof (libpart));
               libpart.index = element.object.libInd;

               err = ACAPI_LibPart_Search (&libpart, false);
               if (err == NoError)
               {
                  double aParam = 0.0;
                  double bParam = 0.0;
                  Int32 paramNum = 0;
                  API_AddParType** addPars  = NULL;
                  err = ACAPI_LibPart_GetParams (libpart.index, &aParam, &bParam, &paramNum, &addPars);
                  if (err == NoError)
                  {
                     for (Int32 i = 0; i < paramNum; i++)
                     {
                        if(CHCompareCStrings ("BimObject id", (*addPars)[i].name) == 0)
                        {
                           std::wstring objectUrl = L"xxx";
                           ShowPlatform(objectUrl);
                           BMKillHandle ((GSHandle *) &selNeigs);
                           return;
                        }
                     }
                  }
               }
            }
         }
         BMKillHandle ((GSHandle *) &selNeigs);
      }
   }


What am i doing wrong in this code ?
(this is a quick and dirty testing code)

How to get currently selected Library Part

$
0
0
Author:gehairing
Posted: Mon Nov 02, 2015 6:07 pm (GMT+1)


Me again Smile

I have finally found out what was wrong.

Here is the working code (draft code...to be cleaned Wink )

Code:
   GSErrCode err;
   
   // Get selected elements
   API_SelectionInfo selectionInfo;
   API_Neig **selNeigs;
   err = ACAPI_Selection_Get (&selectionInfo, &selNeigs, false);
   if (err == NoError)
   {
      if (selectionInfo.typeID != API_SelEmpty)
      {
         UInt32    ii, nSel;
         nSel = BMGetHandleSize ((GSHandle) selNeigs) / sizeof (API_Neig);
         for (ii = 0; ii < nSel && err == NoError; ii++)
         {
            GS::UniString selectedGuid = APIGuidToString((*selNeigs)[ii].guid);
            API_NeigID selectedID = (*selNeigs)[ii].neigID;
         
            API_Element  element;
            BNZeroMemory (&element, sizeof (API_Element));
            element.header.guid  = (*selNeigs)[ii].guid;
            err = ACAPI_Element_Get(&element);
            if(err == NoError)
            {
               // Find the library part
               API_LibPart libpart;
               BNZeroMemory (&libpart, sizeof (libpart));
               libpart.index = element.object.libInd;

               err = ACAPI_LibPart_Get (&libpart);
               if (err == NoError)
               {
                  double aParam = 0.0;
                  double bParam = 0.0;
                  Int32 paramNum = 0;
                  API_AddParType** addPars  = NULL;
                  err = ACAPI_LibPart_GetParams (libpart.index, &aParam, &bParam, &paramNum, &addPars);
                  if (err == NoError)
                  {
                     for (Int32 i = 0; i < paramNum; i++)
                     {
                        GS::UniString us = (*addPars)[i].uDescname;
                        if(us == L"BimObject id")
                        {
                           
                // Todo : Do someting here

      BMKillHandle ((GSHandle *) &selNeigs);
                           return;
                        }
                     }
                  }
               }
            }
         }
         BMKillHandle ((GSHandle *) &selNeigs);
      }
   }


Extractelement 3d geometry using C++ API

$
0
0
Author:Ralph Wessel
Posted: Mon Nov 02, 2015 8:00 pm (GMT+1)


Arularasu wrote:
How to get the element (Slap, wall, roof, extrude etc..) 3d geometry such as profile, polygon coordinates, surface etc.

Take a look at the ModelAccess API. There is an example called ModelAccess_Test. There doesn't appear to be any documentation though.

If this isn't suitable, you can still use the old 3D Manager, e.g ACAPI_Element_Get3DInfo.
_________________
Ralph Wessel
Cadimage

Extractelement 3d geometry using C++ API

The file is either not an Add-On or an outdated one that can

$
0
0
Author:Arularasu
Posted: Wed Nov 04, 2015 8:38 am (GMT+1)


Hi recently I got a trial license of ArchiCAD. After that I cant able to load any add-ons. I had a look at the below link and fallow the steps mentions to load a add-on for a trial version of ArchiCAD. But no luck. Can any on one details explain step by step process.

The file is either not an Add-On or an outdated one that can

$
0
0
Author:Ralph Wessel
Posted: Wed Nov 04, 2015 11:03 am (GMT+1)


Arularasu wrote:
Hi recently I got a trial license of ArchiCAD. After that I cant able to load any add-ons. I had a look at the below link and fallow the steps mentions to load a add-on for a trial version of ArchiCAD. But no luck. Can any on one details explain step by step process.

I highly recommend trying to build and run one of the example projects bundled with the API first. It's a good way to get started, and can be used as a benchmark if your own projects don't work.
_________________
Ralph Wessel
Cadimage

Accessing data in an container file (.lcf)

$
0
0
Author:gehairing
Posted: Wed Nov 04, 2015 5:45 pm (GMT+1)


Hi all Smile

Are there some API's for managing .lcf container files ?
I want to extract .gsm files contained in an container to affect some parameters (by example).

Accessing data in an container file (.lcf)

$
0
0
Author:Ralph Wessel
Posted: Thu Nov 05, 2015 2:25 pm (GMT+1)


gehairing wrote:
Are there some API's for managing .lcf container files ?
I want to extract .gsm files contained in an container to affect some parameters (by example).

There are no API commands to do this. You can call the XML converter (LP_XMLConverter) to pack or unpack a .LCF, but I wouldn't do this from an add-on if you want to change parameters. An add-on should treat a .LFC as a locked container.
_________________
Ralph Wessel
Cadimage

Non-blocking behavior

$
0
0
Author:Xylios
Posted: Wed Nov 11, 2015 5:53 pm (GMT+1)


Hello there, I'm trying to find an operation that allows the user to freely use the GUI while my plug-in is running.

For example, my plug-in starts by clicking on a button on the top menu, after that it establishes a connection with another application, and I want the user to be able to use the GUI while that connection is maintained by the plug-in.
Currently I have a loop that peeks into the communication channel to know if there is something do, if not it continues trying. This is where I would like the ability to allow the user to freely use the GUI.

Does anyone know if there is a way to achieve this functionality?

Thank you in advance.


Create and change database to newly created db

$
0
0
Author:vuego
Posted: Wed Nov 11, 2015 6:30 pm (GMT+1)


When I try to switch current database to newly created worksheet, I get APIERR_BADDATABASE (The command cannot be executed on the current database). The worksheet is sucessfully created but changing database fails. What am I doing wrong here??

Code:

   GSErrCode               err;   
   API_DatabaseInfo         dbInfo;

   BNZeroMemory (&dbInfo, sizeof (API_DatabaseInfo));

   dbInfo.typeID = APIWind_WorksheetID;
   CHANSI2Unicode ("Det 1", (GS::Int32)strlen("Det 1"), dbInfo.name, API_UniLongNameLen);
   CHANSI2Unicode ("D10", (GS::Int32)strlen("D10"), dbInfo.ref, API_UniLongNameLen);

   if (ACAPI_Database (APIDb_NewDatabaseID, &dbInfo, NULL) == NoError) {
      err = ACAPI_Database (APIDb_ChangeCurrentDatabaseID, &dbInfo, NULL);
   }

_________________
ARCHICAD 18, Dell Studio i7, 8Gb Ram, Win7 64bit

We need to get the geometry information which API is best

$
0
0
Author:Arularasu
Posted: Thu Nov 12, 2015 6:29 am (GMT+1)


We need to get geometry and parameters for each elements from ArchiCAD. Geometry like extrude, revolve, polygons etc. Kindly lets us know which API we should use to get the information's (GDL or General API).

Extractelement 3d geometry using C++ API

$
0
0
Author:Arularasu
Posted: Thu Nov 12, 2015 6:33 am (GMT+1)


How to get the extrude profiles from a wall element. All we can get is polygons, edges & vertices. We need to get extrude profiles etc. It is possible to get extrude profile information's ??

Extractelement 3d geometry using C++ API

$
0
0
Author:Ralph Wessel
Posted: Thu Nov 12, 2015 11:44 am (GMT+1)


Arularasu wrote:
How to get the extrude profiles from a wall element. All we can get is polygons, edges & vertices. We need to get extrude profiles etc. It is possible to get extrude profile information's ??

The extrusion profile(s) for a wall with a custom profile can be retrieved from the profile attributes. Take a look at the documentation for API_ProfileAttrType and API_AttributeDefExt. You will need to calculate an extrusion profile for other types of walls, i.e. the API won't give you one.
_________________
Ralph Wessel
Cadimage

Create and change database to newly created db

$
0
0
Author:Oleg
Posted: Thu Nov 12, 2015 12:19 pm (GMT+1)


You need to open the window this database after creation, before the database using.
( I dont check it in last APIs, may be it changed ).

ACAPI_Automate( APIDo_ChangeWindowID, &m_db, NULL );

Viewing all 564 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>