Skip to main content
15-Moonstone
June 24, 2016
Question

Adding fields in data shapes at run time from Windchill Object

  • June 24, 2016
  • 4 replies
  • 2488 views

Wondering if there is a way to add a field in data shape dynamically? Example - In Windchill CAD document, if a new IBA is added. Is there a way to get this attribute added to data shape as a field pragmatically? Today  I have to add this new attribute manually into data shape. Same in mashup.

thanks.

4 replies

1-Visitor
June 27, 2016

Yes it's, I create DataShape's on demand

Load DataShape:

var dataShapeReference = DataShapes["dataShapeName"];

dataShapeReference.AddFieldDefinition({ name: "newFieldName", type: "FIELD_TYPE", ordinal: 9 });

15-Moonstone
June 28, 2016

thanks Carles for replying. Have you used CreateDataShape service in PTC-Windchill-Demo-Thing?

1-Visitor
June 28, 2016

No we don't use Windchill / Windchild extension. But CreateDataShape it's not related to WindChild extension it's a standard TW feature.

15-Moonstone
June 28, 2016

yes Carles.

My findings so far on this is - we can get IBA information from CreateDataShape service. The IBAs on WIndchill Object needs to be added manually to the data shape. This is not good. It really takes away configurability.