BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

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

Hyperlink on Modal Dialog

Anonymous
Not applicable
Hi there,

I'm very new in API add-on, I would like to create the simple button to browse to the website, eg. like the hyperlink in HTML. Would you guys please guide me which function I can use for the button on Modal Dialog?

Cheers
3 REPLIES 3
Ralph Wessel
Mentor
Fern wrote:
I'm very new in API add-on, I would like to create the simple button to browse to the website, eg. like the hyperlink in HTML. Would you guys please guide me which function I can use for the button on Modal Dialog?
I'm not sure if you're asking how to make the button work, launch a URL, or both. This is potentially a big subject, so I don't want to describe solutions for problems you've already solved. For example, do you understand how the callback passed to DGModalDialog works, in particular how to respond to a button click?

If you simply want to know how to launch the URL, I don't know of an ArchiCAD API function for this. I use the host OS API for this purpose.
Ralph Wessel BArch
Anonymous
Not applicable
Thanks Ralph for your reply. I simply want a button that can launch to the URL like when we click the button, and it open the web browser and launch to that URL.
I knows a bit for the callback function in DGModalDialog, such as DGCALLBACK. Does ArchiCAD API have the callback function to open the web browser when user click on the button.

Thanks in advance
Ralph Wessel
Mentor
Fern wrote:
I knows a bit for the callback function in DGModalDialog, such as DGCALLBACK. Does ArchiCAD API have the callback function to open the web browser when user click on the button.
The callback is invoked for a variety of reasons, including the user clicking on a button. You need to detect which event has triggered the callback. When it's a click in the button, you can then request that a browser open the specified URL. I don't know of a function in the ArchiCAD API to open a URL, so you will probably have to use a function in the host OS API.
Ralph Wessel BArch
Learn and get certified!