Author:
Gill Gonnissen
Posted: Thu Oct 08, 2015 11:43 am (GMT+1)
Hi,
I've noticed that in the BlankAddOn the .grc file isn't entirely correct.
The info on the status bar should be:
'STR#' 32501 "Status bar strings" {
/* [ ] */ "Blank"
/* [ 1] */ "Do Nothing"
}
Instead of:
'STR#' 32520 "Status bar strings" {
/* [ ] */ "Blank"
}
↧
Author:
LesWoolsey
Posted: Thu Oct 08, 2015 9:52 pm (GMT+1)
I am rebuilding my add-on (and installer) for AC 18 & 19. The installer looks in the registry for "HKCU\\Software\GRAPHISOFT\ArchiCAD-64 18.0.0 INT R1\Add-On Manager" for the "Actual Path" key and uses its value for where to install the add-on.
But the "Add-On Manager" key does not always exist. It looks like its created the first time the Add-On manager is run. Is there another place where we can get the directory? Otherwise we will have to tell users to run the add-on manager before installing any add-ons which seems crude.
Your suggestions are appreciated.
Thanks
_________________
Les
↧
↧
October 12, 2015, 4:50 am
Author:
Akos Somorjai
Posted: Mon Oct 12, 2015 12:50 pm (GMT+1)
Rinovo wrote: |
Code: | IO::Location fileLoc ("C:\\temp\\MyLibpart.gsm");
API_LibPart libPart;
GSErrCode err;
BNZeroMemory (&libPart, sizeof (API_LibPart));
libPart.typeID = APILib_ObjectID;
libPart.location = &fileLoc;
err = ACAPI_LibPart_Register (&libPart); |
Any ideas why i'm getting MEMFULL error ? |
I agree that this is a misleading error. The problem is that you are trying to register a library part which is not in the embedded library.
Best, Akos
↧
October 12, 2015, 5:07 am
Author:
Akos Somorjai
Posted: Mon Oct 12, 2015 1:07 pm (GMT+1)
LesWoolsey wrote: |
I am rebuilding my add-on (and installer) for AC 18 & 19. The installer looks in the registry for "HKCU\\Software\GRAPHISOFT\ArchiCAD-64 18.0.0 INT R1\Add-On Manager" for the "Actual Path" key and uses its value for where to install the add-on.
But the "Add-On Manager" key does not always exist. It looks like its created the first time the Add-On manager is run. Is there another place where we can get the directory? Otherwise we will have to tell users to run the add-on manager before installing any add-ons which seems crude.
Your suggestions are appreciated.
Thanks |
Hi Les,
Well, you are more or less out of options. You can try to take the "Last Started Path", and append Add-Ons to it, but that'll only work in English-speaking territories.
Best, Akos
↧
October 12, 2015, 5:08 am
Author:
Akos Somorjai
Posted: Mon Oct 12, 2015 1:08 pm (GMT+1)
stefan wrote: |
Thank you for sharing. I can also suggest to start from the smallest Devkit example: Geometry_Test
It would be nice to have a blank add-in which also compiles on OSX. |
Both devkits have add-ins for their respective development environments, and those set up skeleton add-ons.
Best, Akos
↧
↧
October 12, 2015, 5:10 am
Author:
Akos Somorjai
Posted: Mon Oct 12, 2015 1:10 pm (GMT+1)
Gill Gonnissen wrote: |
Hi,
I've noticed that in the BlankAddOn the .grc file isn't entirely correct.
The info on the status bar should be: 'STR#' 32501 "Status bar strings" {
/* [ ] */ "Blank"
/* [ 1] */ "Do Nothing"
}
Instead of: 'STR#' 32520 "Status bar strings" {
/* [ ] */ "Blank"
} |
That depends on how you register your menu. The original is correct if you pass MenuCode_UserDef to your ACAPI_Register_Menu function.
Best, Akos
↧
October 12, 2015, 6:17 am
Author:
stefan
Posted: Mon Oct 12, 2015 2:17 pm (GMT+1)
Akos Somorjai wrote: |
stefan wrote: | Thank you for sharing. I can also suggest to start from the smallest Devkit example: Geometry_Test
It would be nice to have a blank add-in which also compiles on OSX. |
Both devkits have add-ins for their respective development environments, and those set up skeleton add-ons.
Best, Akos |
What is the recommended approach for developing Win + Mac add-ons? Preferably, we would have a single Add-in source folder, with Visual Studio & Xcode project files and with a single set of CPP/H files. Then it could be used in e.g. git or other source control systems to be shared among team members.
Alas, I've had not much luck on OSX with the add-on template and usually stick to copying an example project and renaming things over there.
I was even thinking of setting up a cmake or qmake script to generate two projects from a single source. This could make it more flexible in integrating it into your environments.
_________________
--- stefan boeykens --- architect-engineer-musician ---
ArchiCAD18-19/Revit2015/SketchUp2015/Cinema4D16/Rhino5/Unity5
rMBP15:i7Quad2.3Ghz+16GB+nVidia650M/Yosemite+Win8.1/64
http://bit.ly/17u87df
↧
October 12, 2015, 11:45 pm
Author:
Rinovo
Posted: Tue Oct 13, 2015 7:45 am (GMT+1)
Thanks Akos!
I was trying to add library part to embedded library.
I guess only way would be to make new one through creating new one.
↧
October 13, 2015, 1:33 am
Author:
ReignBough
Posted: Tue Oct 13, 2015 9:33 am (GMT+1)
Akos Somorjai wrote: |
Why would you like to copy an existing library part? The copyright section is there for a reason ![Smile]() |
But you can modify them on the dialog and save it with the new copyright. So, I assume that these values can be copied and/or modified. Also, the "Author" of the libraries that I want to copy is us.
I just want to make a copy of the libraries and modify the contents, like adding parameter. So instead of adding this parameter on multiple libraries one by one, I just need to do it through an add-on.
_________________
~ReignBough~
[ArchiCAD 18 INT 3006 FULL]
[Windows 7 Pro Intel Core i5 CPU 750 @ 2.67 GHz 8.00 GB 64-bit OS]
↧
↧
October 13, 2015, 10:38 am
Author:
LesWoolsey
Posted: Tue Oct 13, 2015 6:38 pm (GMT+1)
Thanks. I think I really want to put my Add-On into the selected folder which means I need to tell people how to initialize ArchiCAD,
Can you tell me exactly what a user needs to do to get that registry entry built. The only way I can see is to
1. start the Add-on Manager,
2. Expand the item at the bottom to "Edit the list of Add-ons
3. Click the change button for the designated Add-Ons folder
4. Browse to the currently selected folder
5. Click OK
6. Click OK again.
That seems really awkward and error prone. Is there another way?
Thanks
Les
_________________
Les
↧
October 13, 2015, 10:38 am
Author:
LesWoolsey
Posted: Tue Oct 13, 2015 6:38 pm (GMT+1)
Thanks. I think I really want to put my Add-On into the selected folder which means I need to tell people how to initialize ArchiCAD,
Can you tell me exactly what a user needs to do to get that registry entry built. The only way I can see is to
1. start the Add-on Manager,
2. Expand the item at the bottom to "Edit the list of Add-ons
3. Click the change button for the designated Add-Ons folder
4. Browse to the currently selected folder
5. Click OK
6. Click OK again.
That seems really awkward and error prone. Is there another way?
Thanks
Les
_________________
Les
↧
October 14, 2015, 4:48 am
Author:
Akos Somorjai
Posted: Wed Oct 14, 2015 12:48 pm (GMT+1)
stefan wrote: |
What is the recommended approach for developing Win + Mac add-ons? Preferably, we would have a single Add-in source folder, with Visual Studio & Xcode project files and with a single set of CPP/H files. Then it could be used in e.g. git or other source control systems to be shared among team members.
Alas, I've had not much luck on OSX with the add-on template and usually stick to copying an example project and renaming things over there.
I was even thinking of setting up a cmake or qmake script to generate two projects from a single source. This could make it more flexible in integrating it into your environments. |
You can see the setup we use in the Examples. Each add-on has the following folders (empty ones are usually omitted):
RFIX -- non-localisable resources
RFIX.mac -- non-localisable resources for OSX
RFIX.win -- non-localisable resources for Windows
RINT -- localisable resources
RINT.mac -- localisable resources for OSX
RINT.win -- localisable resources for Windows
Src -- source and header files (may contain subfolders); on its top level we usually keep the platform independent sources, platform specific stuff goes into subfolders
We keep external libraries and sources in a separate MakeAdds folder somewhere in a central location.
You may also add a Make.mac and a Make.win folder for the project files.
Please share with us if you manage to set up any cmake files; I'd be interested ![Smile]()
Best, Akos
↧
October 14, 2015, 4:54 am
Author:
Akos Somorjai
Posted: Wed Oct 14, 2015 12:54 pm (GMT+1)
Rinovo wrote: |
Thanks Akos!
I was trying to add library part to embedded library.
I guess only way would be to make new one through creating new one. |
Yeah, you can create one directly in the embedded library:
Code: |
IO::Location file; GS::UniString str; GetIndString (str, 32552, 1); // default name ACAPI_Interface (APIIo_GetLastValidEmbeddedLPNameID, &str, &file);
// Save As dialog bool bff = false; bool retIsOk; ACAPI_Interface (APIIo_SaveLibPartFileDialogID, &retIsOk, &file, &bff, &str);
if (retIsOk) { // Create the libpart API_LibPart libPart; CreateLibpart (libPart, file); }
|
You can skip the save dialog, just use the location from the APIIo_GetLastValidEmbeddedLPNameID call (but don't forget to replace the last local name).
Best, Akos[/code]
↧
↧
October 14, 2015, 4:57 am
Author:
Akos Somorjai
Posted: Wed Oct 14, 2015 12:57 pm (GMT+1)
ReignBough wrote: |
I just want to make a copy of the libraries and modify the contents, like adding parameter. So instead of adding this parameter on multiple libraries one by one, I just need to do it through an add-on. |
If you don't have to do it on the fly, then you can use the LP_XMLConverter tool for that (part of the Library Developer Kit, accessible from the same place where you got the API DevKit from).
This tool converts the library parts to and from XML format; it's way much easier than doing it from an add-on.
We ourselves keep our own libraries in XML form.
Best, Akos
↧
October 14, 2015, 5:22 am
Author:
Akos Somorjai
Posted: Wed Oct 14, 2015 1:22 pm (GMT+1)
LesWoolsey wrote: |
Thanks. I think I really want to put my Add-On into the selected folder which means I need to tell people how to initialize ArchiCAD,
Can you tell me exactly what a user needs to do to get that registry entry built. The only way I can see is to
1. start the Add-on Manager,
2. Expand the item at the bottom to "Edit the list of Add-ons
3. Click the change button for the designated Add-Ons folder
4. Browse to the currently selected folder
5. Click OK
6. Click OK again.
That seems really awkward and error prone. Is there another way?
Thanks
Les |
Hi Les,
The other option people are using is to find ARCHICAD's location (from the same registry entry), then append the localised name of the Add-Ons folder to it.
Please find enclosed the list of the localised names.
Best, Akos
↧
October 14, 2015, 5:29 am
Author:
Akos Somorjai
Posted: Wed Oct 14, 2015 1:29 pm (GMT+1)
Rinovo wrote: |
Thanks Akos,
Yes i was using GICN.
But GBMP is only usable with 'STR#' menu or with 'GDLG' dialog also ?
I specified my picture as GBMP but for unknown reason i get error "file not found"
Code: | 'GBMP' 32500 "picture" { "picture" } |
RFIX/Images/picture.bmp |
Yes, there is a separate Picture type dialog item (similar to Icon). On the other hand, icon buttons and the like can only use icons, not pictures.
Best, Akos
↧
October 16, 2015, 6:32 am
Author:
gehairing
Posted: Fri Oct 16, 2015 2:32 pm (GMT+1)
Hello all ![Smile]()
I try to modifiy an existing Library part by adding some parameters.
Here is a part of the code i use :
Code: |
API_LibPart libPart; BNZeroMemory (&libPart, sizeof (API_LibPart));
//TODO : Get type of libpart ? libPart.typeID = APILib_ObjectID; libPart.location = &destinationFile; // Register the copied library part file err = ACAPI_LibPart_Register(&libPart); if(err == NoError) { // Get the library part err = ACAPI_LibPart_Get(&libPart); if(err == NoError) {
// GS Doc says to free the location... if (libPart.location != NULL) { delete libPart.location; libPart.location = NULL; } // Add parameters/properties for this object API_LibPartSection section; BNZeroMemory (§ion, sizeof (API_LibPartSection)); section.sectType = API_SectParamDef;
GSHandle sectionHdl = NULL; err = ACAPI_LibPart_GetSection(libPart.index, §ion, §ionHdl, NULL);
short nPars = 3; API_AddParType** addPars = reinterpret_cast<API_AddParType**>(BMAllocateHandle (nPars * sizeof (API_AddParType), ALLOCATE_CLEAR, 0)); if (addPars != NULL) { API_AddParType* pAddPar = &(*addPars)[0]; pAddPar->typeID = APIParT_Mater; pAddPar->typeMod = 0; CHTruncate ("mat", pAddPar->name, sizeof (pAddPar->name)); GS::ucscpy (pAddPar->uDescname, L("Tom's Material")); pAddPar->value.real = 1; pAddPar = &(*addPars)[1]; pAddPar->typeID = APIParT_Length; pAddPar->typeMod = 0; CHTruncate ("len", pAddPar->name, sizeof (pAddPar->name)); GS::ucscpy (pAddPar->uDescname, L("Tom's Length")); pAddPar->value.real = 2.5;
pAddPar = &(*addPars)[2]; pAddPar->typeID = APIParT_CString; pAddPar->typeMod = 0; CHTruncate ("myStr", pAddPar->name, sizeof (pAddPar->name)); GS::ucscpy (pAddPar->uDescname, L("Tom's String parameter")); GS::ucscpy (pAddPar->value.uStr, L("This is Tom's string")); double aa = 1.0; double bb = 1.0; GSHandle Sect2DHdl = NULL; err = ACAPI_LibPart_GetSect_ParamDef (&libPart, addPars, &aa, &bb, Sect2DHdl, §ionHdl); API_LibPartDetails details; BNZeroMemory (&details, sizeof (API_LibPartDetails)); details.object.autoHotspot = false; err = ACAPI_LibPart_SetDetails_ParamDef (&libPart, sectionHdl, &details);
err = ACAPI_LibPart_UpdateSection (libPart.index, §ion, sectionHdl, NULL);
BMKillHandle (reinterpret_cast<GSHandle*>(&addPars)); BMKillHandle (§ionHdl); } |
After running this code on a valid library part the library part is no more valid. In the Library Part dialog there are messages indicating that the 2D symbol and 3D symbol are not valid.
Probably i'm not using correctly the APIs.
Do you have any idea what i am doing wrong ?
Thanks
↧
↧
October 16, 2015, 9:59 am
Author:
LesWoolsey
Posted: Fri Oct 16, 2015 5:59 pm (GMT+1)
Is there any documentation or examples for how to localize an AddOn? I have my English messages etc in a GRC file. The examples sort of lead me to believe that I need a GRC file for each language. But is there a naming convention or is there some way I indicate the language in the GRC file? Do I create a single Add-on or must I create one for each language? It's all very unclear without some sort of guidance. Any suggestions, pointers or examples would help.
Thanks
Les
_________________
Les
↧
October 16, 2015, 1:12 pm
Author:
Kinstewar
Posted: Fri Oct 16, 2015 9:12 pm (GMT+1)
Our client changed a menu of our plugin in the menu customization settings, removed some items probably and he cant see them and also a new ones that come with a new builds.
Is there any API which we can use to restore or detect such situation?
↧
October 19, 2015, 1:49 am
Author:
gehairing
Posted: Mon Oct 19, 2015 9:49 am (GMT+1)
Hi all
I want to launch some renderings in Archicad from our plugin.
For this i use this API call : ACAPI_Automate (APIDo_PhotoRenderID, xx, xx)
This call works but completely blocks Archicad during the rendering.
When i do rendering from Archicad by using the Render menu command the rendering is not blocking Archicad. I can interrupt the rendering by closing the render windows.
But when i launch a rendering from an Addon this is impossible. I must wait until the rendering is finished....even if it could take hours ;o)
Do you have an idea on how we could interrupt a rendering we launched from an addon through the API calls ?
Thanks a lot
↧