Hey, guys. I have a similar problem.
I read in this forum (https://discussions.rossvideo.com/forum/default-forum-gc1/vision-production-switchers-gc15/1081-datalinq-with-material) how to replace the image from a material according to numerical or code value from datalinq. I tried to do it like you show there but remaking the code to work with conditional, but it doesn't work. I don't use the function for, i use if for every candidate.
This is my script:
--------
dim Nombre1, Nombre2, Nombre3, Nombre4, Nombre5, Apellido1 as xptextobject
dim Slab1 as xpBaseObject [I]'Slab1 is the name my empty slab[/I]
dim Slab1Mat as xpMaterial
dim Slab1Shad as xpBaseShader
dim FilePath as String
FilePath = Engine.ProjectPath
self.getobjectbyname("Nombre1" ,Nombre1)
self.getobjectbyname("Apellido1" ,Apellido1)
self.getobjectbyname("Nombre2" ,Nombre2)
self.getobjectbyname("Nombre3" ,Nombre3)
self.getobjectbyname("Nombre4" ,Nombre4)
self.getobjectbyname("Nombre5" ,Nombre5)
Self.GetObjectByName("Slab1 " , Slab1) [I]'Here i call my slab[/I]
[I]'Casilla 1 - Candidate 1[/I]
if Nombre1.text = "001" then
Nombre1.text = replace(Nombre1.text, "001", "Gustavo Petro")
[I] 'So, inside this conditional i execute the function.[/I]
Slab1.GetMaterial(1, Slab1Mat)
Slab1Mat.GetShader(1, Slab1Shad)
Slab1Shad.SetFileName(FilePath + "Candidatos" + Nombre1.Text + ".png")
end if
------------------------
I think that the layer inside material needs to be called.
But, how i put the image inside material. I have Xpression 6.5.
Thanks for your help and sorry for my english .
#XPression