Graphical editing by using hotspot : bind two lenght parameter together

Home Forums Problems and solutions in GDL Graphical editing Graphical editing by using hotspot : bind two lenght parameter together

This topic contains 3 replies, has 2 voices, and was last updated by  Barry Kelly 3 weeks, 6 days ago.

  • Author
    Posts
  • #4758

    Jolan Ramel
    Participant

    Hello, I am trying to write a string in my main object script that allows binding two parameter together.

    Example : *Parameter1 + 1 = Parameter2* (both parameters are determined for base values) It didn’t work but this is the idea

    Values (example):
    Parameter1 = 100
    Parameter2 = 101

    This is the string I wrote in my script for graphical editing by using hotspot:

    HOTSPOT2 0, 0, UNID, Parameter2, 1+256
    HOTSPOT2 -1, 0, UNID, Parameter2, 3
    HOTSPOT2 Parameter2, 0, UNID, Parameter2, 2

    If i drag the hotspot to make Parameter2 set at 51 the object follows and it works, but the parameter1 stays at 100

    I would like those two parameter to be bound, and if the Parameter2 = 51 then the parameter1 would be 50

    I summarize :

    If I enter a value for parameter1, the parameter2 will follow
    If I enter a value for parameter2, the parameter1 will follow

    If you know a way to bind those two parameters, it would be so nice 🙂

  • #4759

    Barry Kelly
    Participant

    What about …

    if GLOB_MODPAR_NAME ="Parameter1" then
    Parameter2 = Parameter1 + 1
    PARAMETERS Parameter2 = Parameter2
    endif
    
    if GLOB_MODPAR_NAME ="Parameter2" then
    Parameter1 = Parameter2 - 1
    PARAMETERS Parameter1 = Parameter1
    endif

    Barry.

    Versions 6.5 to 22
    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

  • #4760

    Jolan Ramel
    Participant

    thank you so much, this worked perfectly ! I’m so glad I found help from you 🙂

  • #4761

    Barry Kelly
    Participant

    I am so glad to have helped you.
    Thank you for thanking me.

    Barry.

    Versions 6.5 to 22
    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

You must be logged in to reply to this topic.