Graphics

 View Only
  • 1.  Primitive Lines script to link to X & Y of another object - To control the location of the end point

    Posted 01-17-2024 11:26

    Hi Ross Community-

    We need some help linking the end point of a Line to another object, so our producers can control the end point location on the map.  See screen shot below.  Has anyone done something like this that they could help us with a script?



    ------------------------------
    SS Blank
    KSL TV5
    ------------------------------


  • 2.  RE: Primitive Lines script to link to X & Y of another object - To control the location of the end point

    Posted 01-21-2024 15:34

    Not exactly what you asked but it should help you get started with scripting lines. 

    Here is a script I used to create an animated graph a couple of years ago. 

    dim Lines1, Lines2 as xpLinesObject
    dim count as xpTextObject
     
     
    scene.GetObjectByName("Lines1", Lines1)
    scene.GetObjectByName("Lines2", Lines2)
    scene.GetObjectByName("Count", count)
     
    dim c as integer = count.Text
     
    dim tPoint, ctPoint as xpTextObject
     
    dim x as integer = 1180 / c
    dim y as integer = 10
     
    Lines1.SetCurrentList(0)
     
    Lines1.ClearCurrentList
     
    Lines1.BeginUpdate()
    Lines1.AddPoint(0, 1000, 0, 5)
    dim i as integer
    for i = 1 to c
    scene.GetObjectByName("tTicket" & i, tPoint)
    dim t as integer = tPoint.Text
    engine.DebugMessage(tPoint.Text, 0)
    Lines1.AddPoint(i*x, t*y, 0, 5)
    Next
    'Lines1.AddPoint((c+1)*x, 0, 0, 5)
    Lines1.EndUpdate()
     
     
     
    Lines2.SetCurrentList(0)
     
    Lines2.ClearCurrentList
     
    Lines2.BeginUpdate()
    Lines2.AddPoint(0, 1000, 0, 5)
    for i = 1 to c
    scene.GetObjectByName("ctTicket" & i, ctPoint)
    dim t as integer = ctPoint.Text
    Lines2.AddPoint(i*x, t*y, 0, 5)
    Next
    'Lines2.AddPoint((c+1)*x, 0, 0, 5)
    Lines2.EndUpdate()


    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 3.  RE: Primitive Lines script to link to X & Y of another object - To control the location of the end point

    Posted 01-22-2024 11:12

    Thanks!  I ended up reworking a script I found and this worked!