Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hi, I am having some difficulties to figure something out.
I have things based on my lets say: myTemplate_01. Some of these things should contain some ThingShape and others not (or different).
As far as I can tell, there is no service setThingShape on some Thing.
Is there a way how to achieve this?
Thanks
Solved! Go to Solution.
Hi,
You may use the snippets AddShapeToThing and AddShapeToThingTemplate
Hi,
You may use the snippets AddShapeToThing and AddShapeToThingTemplate
Hi,
Thanks a lot, Honestly I was not thinking about EntityServices, I was looking directly at the Thing level thinking that there would be such a service.
Just for the record, after Adding Thing Shape, if on the same code execution thread you want to use the new shape on the given Things, you should get a new reference to the Thing again ( as the Thing will restart ).
For instance if you add a ThingShape to yourself:
Resources["EntityServices"].AddShapeToThing({ name: me.name, thingShapeName: "whatevershape" });
// -- Now if you want to call a service or a property don't use me.propertyName or me.serviceName
// -- you should use Things[me.name].propertyName and/or Things[me.name].serviceName
// -- but you can't use me.name , then you should save previously your ThingName to a temp Variable
// -- Things[thingName].propertyName
Hi Carles,
good to know. Thanks for the tip.
I was just about to doing that