Difference of calling Graphisoft Object by String or by Variable

Home Forums Problems and solutions in GDL Object design Difference of calling Graphisoft Object by String or by Variable

This topic contains 2 replies, has 2 voices, and was last updated by  Gergely Fehér 1 year, 4 months ago.

  • Author
    Posts
  • #2595

    Denny Wong
    Participant

    Hi Everyone,

    I had been working on some GDL objects for my architectural practice to use and had observed some very interesting behaviour.

    It mainly focuses around the calling of Graphisoft objects within the default Library – we do this for speed, especially for the interface scripts which can be uneconomically long to write in detail. In the case below which is a window, I am also calling a Retangular Window Opening 19 in 3D script to take advantage of its Reveal, Casing and sills etc so I don’t have to spend time on WALLHOLEs or WALLNICHEs. I understand that this approach of calling unmodified Graphisoft scripts is permitted and preferred:
    Policy on modifying standard library objects (see reply by laszlonagy)

    The interesting thing happen when the objects are called via a variable. When you call it by a constant string, the object acts properly. However as soon as you pass the string to a variable before calling it, the Reveal malfunctions. No errors or warnings were given.

    The reason this matters is that we hope to have the names of the Macros all collected at the start of the Master Script, so anyone who doesn’t know GDL can change them easily for subsequent versions of ArchiCAD Library. I understand that Graphisoft do not recommend calling Macros by variable or parameter, but as we are purely scripting this for internal use we are not concerned about background processing at all. In any case this behaviour does not seem to relate to background processing, it was simply a incomprehensible difference (to me at least) between calling a macro by string and the exact same value contained in a variable.

    I wonder if this is a bug or an intended behaviour?

    Speaking about similar problems, before we tried the actual placeable object of Rectangular Opening 19, we also tried to call the ArchiCAD internal object of gs_general_window_macro in the exact same way Rectangular Opening 19 did:
    call "gs_general_window_macro" parameters all iWindowClass=4, iWindowType=26
    In our case iWindowClass and iWindowType were stored as integer parameters but the principle is obviously the same.

    The bizarre thing is this works exactly like Rectangular Opening 19 on most computers (as expected) but it would fail on some others. The interface script would result in a number of errors and none of the ui_page would appear. The computers are all iMac15,1s with cloned harddrives, loading the same library from a network location – the only difference would be the ArchiCAD software license. I wasn’t able to replicate this consistently so if this is of interest to anyone let me know so that I can look deeper.

    Many thanks for reading all these!

    Denny
    Architect
    Ambo Architects London

  • #2598

    Denny Wong
    Participant

    …we also tried to call the ArchiCAD internal object of gs_general_window_macro in the exact same way Rectangular Opening 19 did:
    call "gs_general_window_macro" parameters all iWindowClass=4, iWindowType=26

    I beg your pardon, I meant Double-Hung Window 19. The two iWindow variables are for Double Hung windows.

  • #2604

    Gergely Fehér
    Keymaster

    Hi,

    It seems a bit strange, but if you send us a pla, we can try to investigate that. By the way I strongly suggest to avoid macro name storing in variables and calling placeable objects…

    Gergely Fehér
    Team Leader, Library Team
    GRAPHISOFT SE

You must be logged in to reply to this topic.