I want to update the image of the “Image sampler” component using python,.But I have some problems,I updated the image link, but the “Image sampler” component is not updated display.
like this:
I want to ask if there is any function that can update the display of the “Image sampler” component.
Thanks for anyone’s advice,Thanks
This is my code:
from Grasshopper.Kernel.Special import GH_ImageSampler
from Grasshopper.Kernel.Special import GH_ImageSamplerAttributes
ghDoc = ghenv.Component.OnPingDocument()
ghObjects = ghDoc.Objects
for i in ghObjects:
if type(i) is GH_ImageSampler:
# print i
i.ImageFilePath = x
#i.DisplaySettings()
a = i.ImageFilePath
my gh file:
Image_sampler_test.gh (354.8 KB)