append current value to the list with ui_​​button

Home Forums Problems and solutions in GDL Graphical UI and parameters list append current value to the list with ui_​button

This topic contains 6 replies, has 3 voices, and was last updated by  Gergely Fehér 3 months ago.

  • Author
    Posts
  • #3478

    Maciek Bajor
    Participant

    Hello,

    I wonder if somebody could help me with my problem. I have added several fields to the layout info and I am reading these from my object (from LAYOUT_REVISION_HISTORY).

    Now I would like to have a button to append current values of these fields to some array and display them.

    I try to find a way to trigger action of appending current value to the list from UI. Is it possible to trigger some macro from interface or parameter script that would append current value? Also I want to store this array within gdl object rather than write to file.

    Thank you for help,

    Maciek

  • #3481

    Maciek Bajor
    Participant

    Related question: Is there a way in GDL to check if some variable changed its value?

  • #3482

    Gergely Fehér
    Keymaster

    You should not store any values, as they can be changed without running the object’s paramscript.

    Gergely Fehér
    Team Leader, Library Team
    GRAPHISOFT SE

  • #3493

    Maciek Bajor
    Participant

    Gergerly – that’s fine I didn’t want to have real-time values.

    If anybody wondered – I ended up up with attached script (will append first custom field from layout info). Need to make these buttons work nicer but it works.

    Previous question: Is there a way in GDL to check if some variable changed its value?
    There is GLOB_MODPAR_NAME but returns null after you click UI_Button.

  • #3495

    Barry Kelly
    Participant

    I think GLOB_MODPAR_NAME might only work in the Master or Parameter scripts, not the UI script.

    Barry.

    Versions 6.5 to 20
    Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
    Dell Precision M6800 - i7 4700MQ @ 2.40GHz, 16GB RAM, AMD FirePro M6100 (2GB), Windows 7 64bit

  • #3498

    Maciek Bajor
    Participant

    Yes I think so too. Probably worth to mention common workaround – Create global variable var and then in parameter script write
    parameters var = GLOB_MODPAR_NAME
    than you can reference to var in Master and 2D. In case anybody wondered – because that is not intuitive at all.

  • #3499

    Gergely Fehér
    Keymaster

    Value of GLOB_MODPAR_NAME should not be stored in a parameter… It is not a core data of an object.

    Gergely Fehér
    Team Leader, Library Team
    GRAPHISOFT SE

You must be logged in to reply to this topic.