Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

[Wish] Scripting in AC

Karl Ottenstein
Moderator
stefan wrote:
--> side thought: I have a very small example running into our internal CAD-tool (still very much pre-alpha) but believe that this is achievable in ArchiCAD as well, as long as I learn how to step through the 3D-geometry and the materials.
--> I don't even know if it'll work through a Rendering-plugin or more as a direct export-plugin.
--> This is actually the kind of things that other applications can perform using scripting.
How do others feel about the advantages of being able to script AC rather than have only the heavy-iron API solution?

For some time, I've thought of writing an add-on that provided scripting facilities for all AC users. As you know, the power of such an add-on would be limited to the functionality exposed by the current API. (Let's make API functionality extension a separate group of wish-topics.)

An alternative (or addition) that I have wished for is a fully exposed server interface to AC so that AC could be scripted from external tools such as Visual Basic, which are more friendly to more users.

A few of the advantages I see to a scripting solution include:

- makes customization more accessible to a wide range of users, not just C++ programmers

- lets the same source-level script be shared on both Mac and Windows platforms, no need to have both a Mac and PC, Codwarrier and Visual Studio ($$ and knowledge) to compile two versions of an add-on

- is safer for the end-user. An add-on can do anything, including erasing the user's disk - by mistake or intentionally. Scripting can be easily controled - limiting the types of operations that can be performed, and user-enabled warning dialogs could be displayed before changes or deletions to the model are made.

Other thoughts?

Karl
One of the forum moderators   •   AC 25 USA and earlier   •   MacOS 11.6.1, iMac Pro
17 REPLIES 17

Oleg
Advocate
Karl wrote:
How do others feel about the advantages of being able to script AC rather than have only the heavy-iron API solution?

Other thoughts?
It is good idea certainly, but I think completely it can by implemented by Graphisoft only.

However, I did worked experiments with JavaScript embedding. And I assume to use it for specialized task ( basically not for end user scripting ).

Karl Ottenstein
Moderator
Oleg wrote:
It is good idea certainly, but I think completely it can by implemented by Graphisoft only.

However, I did worked experiments with JavaScript embedding. And I assume to use it for specialized task ( basically not for end user scripting ).
Indeed, Javascript is what I thought should be the scripting language, as something common to both platforms. (But, part of me would like to see VBA licensed from Microsoft for the Windows platform since Visual Basic is known by so many people and is so easy to work with. It would defeat the idea of having scripts sharable between platforms though, unless RealBasic is source-compatible on the Mac.)

I agree that GS should be the one delivering a scripting solution - particularly if it is an automation one. But, don't you think, Oleg, that if the API exposed all AC functionality, then a 3rd party could produce the scripter? (The limited functionality of the current API should be a separate thread...) Or, do you see deeper issues that I'm not seeing?

Thanks,
Karl

PS I'm glad you changed your avatar to a photo: good to finally 'see' you after all these years!
One of the forum moderators   •   AC 25 USA and earlier   •   MacOS 11.6.1, iMac Pro

Geoff Briggs
Booster
Yes. I worked with VectorScript prior to my move to ArchiCAD and miss the ability to easily control the entire application. Make sure to include PlotMaker while we’re at it.
Regards,
Geoff Briggs
DeForest Architects
Seattle, USA

AC24 INT, Mac (home), Win10 (work)
Yes, you read that correctly, we are in the US but use the INT version.

Aussie John
Newcomer
Being a scriptable application for Applescript would be a good start.
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019
[/size]

Oleg
Advocate
Karl wrote:
But, part of me would like to see VBA licensed from Microsoft for the Windows platform since Visual Basic is known by so many people and is so easy to work with.
If to speak about Win specific solutions, it is possible to use VBScript, JScript (not VBA) without any licensing. I tried it too.
Besides I am interested by MS .NET technology. But it will work only on Windows.
Karl wrote:
But, don't you think, Oleg, that if the API exposed all AC functionality, then a 3rd party could produce the scripter? (The limited functionality of the current API should be a separate thread...) Or, do you see deeper issues that I'm not seeing?
My English so poor to discuss it in more detail. I think, theoretically and technically to make full API exposed for scripting is feasible, but practically hardly.
I dont see deeper, just IMHO.
My opinion, that the first huge difficulty is how to expose API functionality. To design the coordinated and convenient interfaces and functions exposed in a scripting language is a very complicated task. I do not think, that, to show API function directly is a good approach. The current API design in my opinion is not so good and does not approach for directly exposing it in a dynamic typed, garbage collected scripting language.

The second difficulty is complexity of implementation. It is required thousand and tens thousand functions (actually most fields of the big API structures should be accessible through function / property). Huge time and expenses. I think it can not be made by small group of enthusiasts.

However, customization of some complex AddOns or to expose the limited interface/functions set for the specialized tasks seems a good approach.

Karl Ottenstein
Moderator
Oleg wrote:
Karl wrote:
But, part of me would like to see VBA licensed from Microsoft for the Windows platform since Visual Basic is known by so many people and is so easy to work with.
If to speak about Win specific solutions, it is possible to use VBScript, JScript (not VBA) without any licensing. I tried it too.
Yes, there is a license fee for adding VBA to a program:
http://msdn.microsoft.com/vba/partner/benefits.asp
but a few years ago, MS was so eager to have people do this, that I don't think they wanted that much money.

The cool thing, as you know, about VBA is the visual dialog editor and easy programming of all interaction, plus autofill coding (intellisense), debugging tools, etc. GS would have to provide ActiveX controls that correspond to pens, fills, linetypes, etc resources, but just think about how easy it could be to build something useful with an attractive interface. Plus, it is familiar to anyone using any MS Office application, AutoCAD, Corel, etc. (MS claims VBA ships with over 100 3rd party applications). Even if it cost GS $50 per user for the license, it would be worthwhile IMHO if only there was a way of providing equivalent support for Mac users. (Of course, the huge expense for GS would be providing the necessary object model for VBA to access AC features.)

Are there visual dialog creation tools available for VBScript, JScript or standard javascript?

Thanks for your other comments explaining your reservations. Your English is fine!

Karl
One of the forum moderators   •   AC 25 USA and earlier   •   MacOS 11.6.1, iMac Pro

Anonymous
Not applicable
How about VBA for Windows and Xcode for Mac? It sure would beat having to shell out for Code Warrior.

Karl Ottenstein
Moderator
Matthew wrote:
How about VBA for Windows and Xcode for Mac? It sure would beat having to shell out for Code Warrior.
Just browsed over to
http://developer.apple.com/tools/macosxtools.html
to read about Xcode since I'm reasonably Mac-ignorant.

It appears that Xcode is an alternative to CodeWarrior for C++ application development.... looks powerful and free! But, it is a development environment for skilled programmers, not a scripting environment. Has anyone in this forum tried Xcode? Or are there features in the API SDK that tie it to CodeWarrior?

VBA is a RAD (Rapid Application Development) tool... and is designed for the more average person to quickly build a solution. I don't know what would offer a similar power with a visual dialog editor on the Mac, being Mac-ignorant.

Karl
One of the forum moderators   •   AC 25 USA and earlier   •   MacOS 11.6.1, iMac Pro

Anonymous
Not applicable
I realize that VBA and Xcode are very different beasts. I was just thinking out loud about some things that would be nice for extending the reach of ArchiCAD.

The free alternative to VBA on the Mac is Applescript but AFAIK it is not a true RAD as it is primarily for system automation and application interaction (there is no corollary that I know of in Windows). Applescript support in AC & PM would be tremendous for Mac users but might make Windows people a bit jealous.

Revolution is a RAD tool which I believe is cross platform but I don't know too much about it.

One of my favorite RAD tools (which is also cross platform) is 4D (4th Dimension) which isn't really a RAD tool but a database that can build standalone apps. I actually built a wood framing add-on demo for AC with it about 12 years ago.

What is the coolest stuff on the Windows side these days? The last Windows only programming I did was for speedikon with Microstation, a text editor and a DOS based compiler (for a UNIX core app. - go figure).

Ralph Wessel
Mentor
Karl wrote:
Has anyone in this forum tried Xcode? Or are there features in the API SDK that tie it to CodeWarrior?
I use it, but you can't directly build add-ons for ArchiCAD with XCode because it doesn't support building executables for the old CFM architecture (it only supports Mach-O).
However, you can use bridge technology in the Mac OS to call into a dyld-based bundle from CFM. I used this in GBS Energy because it opens up a wealth of developer resources that aren't otherwise usable in a CFM executable.
In short, you can use XCode, but you will always have to use CodeWarrior as well (for the meantime). I prefer CodeWarrior anyway (it's by far the fastest), but there are many very nice features in XCode.
Ralph Wessel BArch

stefan
Booster
I like MAXscript in 3ds max. It's not too difficult and is very, very powerfull. If you imagine what plugins have been created using only the scripting language, it's amazing!

---

I also like VBA. I've used it quite a bit in Excel and recently in AutoCAD and it is very approachable. In fact, I think it's better then GDL.

I like the VBA IDE. It's clean, it's usable and it get's the job done. This is the interface that is missing for GDL development.

---

Would it be possible to extend GDL into a complete scripting language, that is usable to control ArchiCAD completely? In that case, a lot of Add-ons could be built in GDL.

Or am I missing the point completely?

Free GDL from it's objects. Make it able to reach the whole project and the whole application.
--- stefan boeykens --- architect-engineer-musician ---
ARCHICAD25/Revit2022/Rhino6/Unity2020/Solibri
MBP2019:i9Octo2.4GHz32GBVega20/BigSur+Win11
ARCHICAD-user since 1998

stefan
Booster
It's quiet in this forum...
--- stefan boeykens --- architect-engineer-musician ---
ARCHICAD25/Revit2022/Rhino6/Unity2020/Solibri
MBP2019:i9Octo2.4GHz32GBVega20/BigSur+Win11
ARCHICAD-user since 1998

Karl Ottenstein
Moderator
stefan wrote:
It's quiet in this forum...
Shhhh. We were sleeping! 😉
stefan wrote:
I like the VBA IDE. It's clean, it's usable and it get's the job done. This is the interface that is missing for GDL development.
I agree! ... but for API development as well: compare building a dialog box in the VBA environment and making it function properly to doing the same task with the dialog resources in the API SDK. Being platform independent (Windows/Mac OS) has its downsides ... GS would have to build or purchase a platform independent IDE, which I suspect would cost much more than the potential financial return to them. I sure hate reality sometimes. 😉
Would it be possible to extend GDL into a complete scripting language, that is usable to control ArchiCAD completely? In that case, a lot of Add-ons could be built in GDL.
I don't see why not ... I've built several compilers and interpreters in my day. I just see that the GDL language and environment is so primitive now, that doing this would be a bit of work ... and, as above, think GS would have to see how to get a return on their investment before thinking about it.

It is possible to write an independent scripting add-on, and I've thought about doing that ... but frankly and IMHO the API does not provide the needed functionality at present. Too much information is read-only, or not accessible. Yes, add-ons can be written that do remarkable things, but for scripting, IMHO, you should minimally be able to 'automate' every menu command and dialog ... and this is not possible at present. (An example: you can retrieve the current ghost story index, but you cannot set the ghost story to another floor. Another: publisher settings are not available.)

Money can solve all of these things of course... but what argument could be made to GS that they would make enough new sales if they made the investment?

There is a poll happening at:
http://archicad-talk.graphisoft.com/viewtopic.php?p=21589#21589
perhaps more feedback there will tell all of us what the user community feels.

Karl
One of the forum moderators   •   AC 25 USA and earlier   •   MacOS 11.6.1, iMac Pro

Anonymous
Not applicable
This topic has been quiet a while, but I think it's a great idea.

What about Python? It's cross platform, very flexible, easy to learn...no fees. It can be compiled which might give you some speed advantage over normal scripting, but at the same time it's easy to modify.

Not sure what would be required, but there are bindings for Python to MANY languages, C++ included.

I've done scripting for Bentley Microstation for a while now. For most problems, their C-based MDL requires too much effort- the ability to script really enables even average users to speed up repetitive or specialized processes.

Anonymous
Not applicable
A program of that magnitude without scripting is unacceptaple.
GDL is very good for creating basic objects BUT it lacks even basic user interaction.

A vba like solution whould be very very good.
I hope we will get some sort of solution soon.

stefan
Booster
Ruby is used in SketchUp. It's Object-Oriented and Cross-platform.
I think Python and Javascript are good options too.

VBA is nice, but tied to Windows.

In fact, AutoCAD, 3ds max, Softimage XSI, Maya and others support more then one interaction:

C++ development for add-ons (only for developers)
Scripting for (experienced) end-users
Macro-recording for less experienced end-users.

Some go as far as supporting several programming languages: e.g. AutoCAD can use command scripts, Lisp, VBA, C++, .NET and probably some others too. And look at what it has done to the market for AutoCAD add-ons!
--- stefan boeykens --- architect-engineer-musician ---
ARCHICAD25/Revit2022/Rhino6/Unity2020/Solibri
MBP2019:i9Octo2.4GHz32GBVega20/BigSur+Win11
ARCHICAD-user since 1998

Anonymous
Not applicable
Matthew wrote:
...One of my favorite RAD tools (which is also cross platform) is 4D (4th Dimension) which isn't really a RAD tool but a database that can build standalone apps. I actually built a wood framing add-on demo for AC with it about 12 years ago...
Matthew,
What ever happened with that wood framing add-on? Wasn't it called "FrameMaster" something like that? I remember meeting you in San Francisco and seeing a printout about it back around 1992... I think I still have a copy of the printout buried deep somewhere in my files.

This "scripting in AC" thread is timely and interesting. There are so many specialized features/uses an end users might need ...we all need a better ability to tweak ArchiCAD to meet our "unique" requirements.

ArchiCAD is a powerful tool but I find it amazing that 15 years or so after entering the US market it still doesn't have a useable suite of floor, wall, and roof framing tools. It looks like CadImage may be filling that gap with its new framing add-on but AFAIK this is only for wall framing.

Any possibilty of resurrecting FrameMaster and building a more complete suite of framing tools?

Dan K

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!