We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.

Serious issues exporting component lists for estimating.

Anonymous
Not applicable
Hello,

My company is using v7r3 of Archicad under windows NT and 2000 and have noticed a strange bug when saving text windows. This is causing problems with our estimating when we have been saving a component list scheme.

As a solution for this I have tried writing my own export function using ACAPI_Element_GetComponents. My code is very similar to the code in the help file for this function but it does not do what I expect.

For simple property scripts the output is correct. However for scripts that use global variables like WALL_LENGTH_A (ie. those which the GDL manual says are 'for listing only) this approach does not work. The 'for listing only' global variables have values of 0. This makes the getComponents function pretty much useless as our property scripts use these variables extensively.

Is there a way to get component quantities from scripts that use these global variables in version 7?

If we upgrade to version 8 or 9 will our apx be able to get the component quantities?


Even if this is available I would still like to know if the problem we encountered below is a known bug in Archicad 7 and have described it below.

We have set up out own component list scheme which our drafters access by the calculate / list components menu. We use the file / save as command to save this tab delimited output to a network file system. This has been working fine for at least the last year. In the last few weeks the save dialog box has been occasionally not working. Every now and then when we click save nothing happens. After clicking save several times eventually it will ask 'do you want to overwrite the file'. This has caused many problems as some files are not getting saved and modified standard designs are using the old estimate files.

If this a known problem in Archicad 7, I'd like to know what the cause of this problem is, is there a workaround and has this been fixed in version 8, 8.1, 9?

Thanks,
Adam
4 REPLIES 4
Karl Ottenstein
Moderator
Welcome, Adam.
adambutler wrote:
For simple property scripts the output is correct. However for scripts that use global variables like WALL_LENGTH_A (ie. those which the GDL manual says are 'for listing only) this approach does not work. The 'for listing only' global variables have values of 0.
Perhaps someone who has looked at this specific situation can can respond. I haven't tried anything with the 'listing only' variables ... and suspect that they are just that.
Is there a way to get component quantities from scripts that use these global variables in version 7?

If we upgrade to version 8 or 9 will our apx be able to get the component quantities?
This is a pretty specific request. Most of us on 9 are separated from you by many API releases. If you want to PM me with a zip of your add-on and a tiny PLA (like one element that your property script attaches to), I'll take a look.
Even if this is available I would still like to know if the problem we encountered below is a known bug in ArchiCAD 7 and have described it below.
This is a tough one, unless someone experienced it and knows the answer. I don't know that anybody tracks bugs in any release other than the current one...
In the last few weeks the save dialog box has been occasionally not working.
This is suspicious, but you don't give enough information to explain if this is a problem with your system (reinstall AC?), or if it is just the project you're working on? Or is it just listings that are over a certain length? If you open an old version of the project, when things used to work for you, do they still work?

Too little information to be of much help I fear... Tell us more. 😉

Karl
One of the forum moderators
AC 28 USA and earlier   •   macOS Sonoma 14.7.1, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Anonymous
Not applicable
Thanks for the prompt reply.

The property scripts with problems are in gps files.
eg:
We have a script walls.gps which is linked to all wall elements. This script creates components for the lengths of the different wall types. It uses the variable WALL_LENGTH_A to get the length of the wall.

The property scripts seem like the ideal way to do estimating as each library part can contain costing details for itself. Is there any other way to cost wall lengths in ArchiCAD?

Upon looking at the version 9 documentation I see that ACAPI_GetComponents is still available, and the 'for listing only' gdl global varialbles are also available. My problem is that I am unable to find if there is a way to get them working together, short of buying V9 and trying it.

Due to company policies I can't send you my plugin source. The property script can consist of a single component line using WALL_LENGTH_A as its quantity and the function that generates the component output is almost identical to the example on this page:
http://download.graphisoft.com/ftp/techsupport/documentation/developer_docs/APIDevKit61/APIHTMLLibra...

As far as the save errors, I am unable to reliably duplicate the problem. It happens with numerous plans to several different people on several different computers. I tried saving on mine and got the error consistently, then I deleted my APX and the problem seemed to be fixed when I put the APX back it stopped happening.

The saved files are all < 30KB, this happens on numerous projects. Not sure what other info I can give, I was hoping somebody else might have had this happen.

Getting the component list through code is my ideal solution as it will save the drafters time and I can ensure that the files are saved correctly.

Thanks,
Adam
Akos Somorjai
Graphisoft
Graphisoft
adambutler wrote:
The property scripts seem like the ideal way to do estimating as each library part can contain costing details for itself. Is there any other way to cost wall lengths in ArchiCAD?
Yes, through the API
adambutler wrote:
Upon looking at the version 9 documentation I see that ACAPI_GetComponents is still available, and the 'for listing only' gdl global variables are also available. My problem is that I am unable to find if there is a way to get them working together, short of buying V9 and trying it.
In v9 they work the same way as ArchiCAD 7; you will get 0 for those calculated values which refer to 'for listing only' GDL globals. If you'd like I can enter it as a bug. The interesting thing here is that if I define the variable this way:
component "my_length", 5, "m", 2  !  2-> proportional to length
then the calculated value is correct; whereas if the component is
component "my_length", 5*WALL_LENGTH_A, "m"
then the value is 0.
adambutler wrote:
Getting the component list through code is my ideal solution as it will save the drafters time and I can ensure that the files are saved correctly.
You can also use the ACAPI_Element_GetQuantities function, which exports most of the calculated values (e.g. the length12 field of API_WallQuantity is the same as WALL_LENGTH_A), and export in the format you need.

HTH,

Akos
Anonymous
Not applicable
Thanks for your reply. Please enter this as a bug if it was intended to be used this way.

The problem with using the proportional values is that the options given do not cover all 'for listing only' variables that we use.

I've been dreading using GetQuantities. Once I get time I'll rewrite our gps scripts in c (don't really want to write my own gdl parser for the gps files).

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!