Skip to main content
11-Garnet
April 12, 2024
Solved

How to quickly add properties in thingshape?

  • April 12, 2024
  • 1 reply
  • 1793 views

Hello,everyone!企业微信截图_17128939282188.png

How to quickly add properties in thingshape?

 

Best answer by Velkumar

Hi @Snoopy_hu 

 

As @Rocko  mentioned it is not visible to the end user. But you can create custom service to do it

 

ThingShapes["SHAPE_NAME"].AddPropertyDefinition({
	indexed: undefined /* BOOLEAN {"defaultValue":false} */,
	defaultValue: undefined /* STRING */,
	remoteBindingAspects: undefined /* JSON */,
	description: undefined /* STRING {"defaultValue":""} */,
	readOnly: undefined /* BOOLEAN {"defaultValue":false} */,
	type: undefined /* BASETYPENAME */,
	remote: undefined /* BOOLEAN {"defaultValue":false} */,
	remotePropertyName: undefined /* STRING */,
	timeout: undefined /* INTEGER {"defaultValue":0} */,
	pushType: undefined /* STRING */,
	dataChangeThreshold: undefined /* NUMBER */,
	logged: undefined /* BOOLEAN {"defaultValue":false} */,
	name: undefined /* STRING */,
	pushThreshold: undefined /* NUMBER */,
	dataChangeType: undefined /* STRING */,
	category: undefined /* STRING */,
	persistent: undefined /* BOOLEAN {"defaultValue":false} */,
	dataShape: undefined /* DATASHAPENAME */
});

 

/VR

1 reply

19-Tanzanite
April 12, 2024

Hi @Snoopy_hu 

 

Do you mean adding property through service ?

 

https://www.ptc.com/en/support/article/CS233812

 

/VR

Snoopy_hu11-GarnetAuthor
11-Garnet
April 12, 2024

Hi @Velkumar 

Thanks! I would like to add multiple attributes through a service, I tried the help you provided and found it, but unfortunately why doesn't thingshape have this service?

 

Rocko
19-Tanzanite
April 12, 2024

ThingShape is not in the same inheritance line as ThingTemplate and therefore the services are not visible to the end user.