r/visualbasic • u/Sonova_Vondruke • Sep 13 '22
I basically have nowhere else to turn to, I'm hoping someone can help me.
I'm using an application that uses VisualBasic Macros to handle more complex animations. It's a real-time graphics program created by ChyronHego called LyricX. There are no definitions or lists of functions and how to use their properties aren't available online. Attempts to receive help from ChyronHego have been useless, and their support is infrequent and spotty at best.
Basically what I'm trying to do is allow a user to add one image file through a choose file field and for it to automatically copy itself in the background (it will be a separate node and treated differently within the animation). I was given a bit of code to do the same to text and I got it to work just fine, but when I tried using it with an image and properties to it, it doesn't seem to want to work. This is what I have so far, and my VisualBasic Knowledge is limited so I'm sure I'm missing something very simple.
I've tried a variety of different versions with omitted different properties and variables but, they all came back with an error: Argument Not Optional, on the last line. Since I have no idea what I'm doing, and can't find a list of definitions with what arguments or parameters to use, I'm kind of lost.
Thank you for any help you may have.
'text field duplication
set t1a = ActiveCanvas.Scene.Template("LEFT TEAM NAME") 'main text field
set t1b = ActiveCanvas.Scene.Template("LEFT TEAM NAME OUTLINE") 'outline of text
set t1c = ActiveCanvas.Scene.Template("m.LEFT TEAM NAME MASK") 'masked animation
t1b.Text.Text = t1a.Text.Text
t1c.Text.Text = t1a.Text.Text
'helmet file duplciation
set HL1 = ActiveCanvas.Scene.Element("HELMET LEFT") 'primary helmet
set HL1bg = ActiveCanvas.Scene.Element( "BG HELMET LEFT") 'background helmet animation
HL1bg.Element.Element(0) = HL1.Element.Element(0)
3
u/Fergus653 Sep 13 '22
Do you have something called Object Explorer? It can view the object interfaces if you are able to use it and load the class library.
1
u/[deleted] Sep 14 '22
Lets start simple. Argument not optional means that the function/sub you are using is not being passed the correct number of objects. So if you call something like
Sub Example(option1 as string)
and all you use is
Example()
then you will get the error that Argument is not optional. If you are getting it on the last line then are you sure it's not something like HL1.Element.Element(0, 0) or HL1.Element(0).Element(0) or HL1.Element.Element("0")
Also are you certain that Element is something you can set versus being a method or read only?
As Fergus had asked, have you checked the Object Browser? Normally I think it's accessible with F2. It should tell you more about the members of the object and how to use them.