Hey, is it possible to import an image into grasshopper that comes from a remote server? E.g.
(It´s a image that is created “on-the-fly”)
Thanks in advance!
Hey, is it possible to import an image into grasshopper that comes from a remote server? E.g.
(It´s a image that is created “on-the-fly”)
Thanks in advance!
I don’t own a single Apple hardware… I am not able to assist you
Isn’t the component giving any sort of error?
Try to change the path string with a path you know can be freely used (so remove that “GetTempPath” …)
I know much of Heron does not work on a Mac, but I am curious if the GdalWarp tool works. Can you give it a try?
20210318_WMSquery.gh (12.0 KB)Hey Brian, the GdalWarp component throws an exception
…the component does not give me any error. In fact it seems that it indeed output a “display material” but this one seems to be completly white.
…checked your advice to change the path string. ohmy god it works!
So for all mac users: change c# component to:
System.Net.WebRequest request = System.Net.WebRequest.Create(URL);
System.Net.WebResponse response = request.GetResponse();
System.IO.Stream responseStream = response.GetResponseStream();
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(responseStream);
string path = "/Users/your_name/Desktop/wms_nw_dop.png";
bitmap.Save(path, System.Drawing.Imaging.ImageFormat.Png);
Rhino.DocObjects.Texture texture = new Rhino.DocObjects.Texture();
texture.FileName = path;
Rhino.Display.DisplayMaterial mat = new Rhino.Display.DisplayMaterial();
mat.SetBitmapTexture(texture, true);
Grasshopper.Kernel.Types.GH_Material GHmat = new Grasshopper.Kernel.Types.GH_Material();
GHmat.Value = mat;
TextureMaterial = GHmat;
Thank you Riccardo!