Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
I am trying to figure out how to get property definitions for a template. I've tried creating my own service with "TemplateName" as an input using this snippet:
var params = {
category: undefined /* STRING */,
type: undefined /* BASETYPENAME */,
dataShape: undefined /* DATASHAPENAME */
};
// result: INFOTABLE dataShape: PropertyDefinition
var result = ThingTemplates[TemplateName]GetPropertyDefinitions(params);
But it is returning a blank infotable, I'm assuming because my parameters are all undefined?
The only way I can seem to get a list of properties is by ThingName.
It seems to be a bug, becouse the same for services works:
var params = {
category: undefined /* STRING */,
type: undefined /* BASETYPENAME */,
dataShape: undefined /* DATASHAPENAME */
};
// result: INFOTABLE dataShape: ServiceDefinition
var result = ThingTemplates["wupUtilityUseThermalTT"].GetServiceDefinitions(params);
Either if you do a GetMetadata no Property definitions
var result = ThingTemplates["wupUtilityUseThermalTT"].GetMetadata();
Use GetInstancePropertyDefinitions instead of GetPropertyDefinitions.
I don't see that service anywhere?
I don't know if the service is documented, but in the script editor you can find it in the Entities tab after you select your ThingTemplate.
Found it! Thank you!