cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

Exception during IFC property hook execution Archicad 29

Emkave
Enthusiast

Hello guys. I was coding the hookers for Archicad 29 and something went wrong. I was following the examples in IFC_Test, and I wrote the code:

Emkave_0-1757669104747.png

 

I have also executed this code that gave no errors:

IFCAPI::GetHookManager().RegisterPropertyHook(IFCHook::property_hook);


However, for some reason, after the ending of execution of property_hook(), I received this exception error:

 

Screenshot 2025-09-12 105725.png

 

I want also to point out that the ifc values were creating fine, without any errors. I was checking it a lot of times through the debugger.

 

Have someone dealt with this issue before? I would be glad if someone could point me to my mistake. Thank you in advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

OK, I just saw a possible solution. Are you making a Debug build? Try compiling it as a Release build.

 

Somebody else seemed to have a very similar problem in AC29 TP and this was their solution. (https://community.graphisoft.com/t5/Graphisoft-Technology-Preview/Crashes-when-invoking-property-hoo...)

 

This relates to an issue I had a while back with Debug builds. Check this post to see how you can adapt your Debug build once you've confirmed that it was the issue by trying the Release build: https://community.graphisoft.com/t5/Archicad-C-API/Crash-for-GetOrganizationIds-in-DEBUG-builds-link...

 

 

Automating Archicad with Add-Ons, GDL-Objects & Python Archi-XT.com

View solution in original post

17 REPLIES 17
Emkave
Enthusiast

Also I noticed that it is trying to load up IFCInOutAPI.pdb from somewhere. I went to check out in the devkit for AC29 and it does not exist there.

 

Emkave_0-1757945610765.png

 

I also tried to search for IFCInOutAPI.dll, but it does not exist either

 

Emkave_1-1757945643460.png

Emkave
Enthusiast

And here is the debug message:

Exception code: C0000005 ACCESS_VIOLATION reading location: 0000000000000000
Fault address: 00007FF9CC1969FE 01:000059FE IFCInOutAPI.dll
TOS address: 0000024C56406448 00:00000000

Registers:
RAX:00000000000014C8
RBX:0000000000000000
RCX:903BE332AC2C0000
RDX:00007FF9B5F303C0
RSI:000000C6706FC930
RDI:0000024C98F82280
R8: 7FFFFFFFFFFFFFFC
R9: 000000C6704BA000
R10:0000024C5FA70000
R11:000000C6706FAFE0
R12:000000C6706FD9D0
R13:0000000000000000
R14:0000000000000000
R15:000000C6706FC8B8
CS:RIP:0033:00007FF9CC1969FE
SS:RSP:002B:000000C6706FC820 RBP:000000C6706FC8F0
DS:002B ES:002B FS:0053 GS:002B
Flags:00010346

Floating point Registers:
CTRL:027F STAT:0000 TAGS:0000
CS:RIP:0000:00000000E0A49EC1
DS:EDO:0000:0000000000004978
MxCsr:00001FA0

XMM0 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM1 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM2 = 0000000000000000000000003F400000 === +0.000000000000e+00 +5.242821631975e-315 === +7.500000e-01 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM3 = 00000000000000000000000040000000 === +0.000000000000e+00 +5.304989477413e-315 === +2.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM4 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM5 = 000000003A495041000000007373616C === +3.637369144105e+233 +1.254570642471e+16 === +1.928259e+31 +1.982856e+02 +7.679500e-04 +2.937459e+29
XMM6 = 00000000000000000000000047AE147B === +0.000000000000e+00 +2.000000000000e-02 === +8.912896e+04 +1.160000e+00 +0.000000e+00 +0.000000e+00
XMM7 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00

XMM8 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM9 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM10 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM11 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM12 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM13 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM14 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00
XMM15 = 00000000000000000000000000000000 === +0.000000000000e+00 +0.000000000000e+00 === +0.000000e+00 +0.000000e+00 +0.000000e+00 +0.000000e+00




Address space statistics:

Available free memory: 130999.50 GB
The number of free memory blocks: 1478
The average size of free memory blocks: 88.63 GB
The number of free memory blocks < 10 kbyte: 64 (416.00 KB)
The number of free memory blocks < 100 kbyte: 1151 (56460.00 KB)
The number of free memory blocks < 1 Mbyte: 90 (41.87 MB)
The number of free memory blocks < 10 Mbyte: 103 (395.59 MB)
The number of free memory blocks < 100 Mbyte: 48 (1404.78 MB)
The number of free memory blocks < 1 Gbyte: 10 (2.57 GB)
The number of free memory blocks > 1 Gbyte: 12 (130995.07 GB)
The biggest free block:
0x00003A4C00000000 46928.00 GB free 0x0000000000000000 NOACCESS

Emkave_0-1758022644381.png

 

I also tried this test code example. But it also gave the same exception error.

Emkave
Enthusiast

Please someone expalin or share the way or explain why I do receive the exception! I will be very glad! 

Hiromichi Shinkawa
Graphisoft
Graphisoft

Hi, please let me confirm what problem you're facing, did you mean you meet the error even using API29 Examples code? I noticed there are similar code like AddProperty() in IFCHook_Test.cpp.

Hello. Thank you for the reply. The issue I face is when the PropertyHook function finishes its execution after I had put values into the property vector. 

Emkave_0-1758533493681.png

 

In this screenshot I am emplacing the test value. Then the execution line goes out of this function and Visual Studio complains about the exception:

Emkave_1-1758533546714.png

 

I suspect that I have emplaced the property incorrectly, however I am sure I correctly understood the way it supposed to be according to the examples from Graphisoft. 

I have tried again; did read the examples and documentation and wrote this code:

 

Emkave_0-1758618371231.png

 

however it still causes Archicad to crash with the same exception when the execution of PropertyHook ends.

Hiromichi Shinkawa
Graphisoft
Graphisoft

Hi, could you reproduced the same crash using the example code AddProperty() in IFCHook_Test.cpp?

Emkave_0-1758706425205.png

 

Yes. Crashed again when I tried to use AddProperty from IFCHook_Test.cpp.

I have literally copied and pasted their functionality.