Delete GeometryInstance

add primitive by geometryInstances : Array.<GeometryInstance>,now i want delete one GeometryInstance?

@zyy1987 I’m not exactly sure what you’re asking. Could you please provide a bit more context and code showing what you are trying to do? Thanks!

I create a primitive object by:
const polylinepc = ;
const coordinates = ;
const colors = ;
entity.geometry.coordinates.forEach((i) => {
coordinates.push(S3DP.Cartesian3.fromDegrees(i[0], i[1], i[2]));

        const polyline = new S3DP.PolylineGeometry({
          positions: coordinates,
          width: polylineWidth,
          // colors: colors,

        const objId = S3DP.createGuid();
        geometry = new S3DP.GeometryInstance({
          id: objId,
          geometry: polyline,
          attributes: {
            show: new S3DP.ShowGeometryInstanceAttribute(true),
            color: S3DP.ColorGeometryInstanceAttribute.fromColor(graphicsColor),
            width: new S3DP.GeometryInstanceAttribute({
              componentDatatype: S3DP.ComponentDatatype.UNSIGNED_BYTE,
              componentsPerAttribute: 1,
              normalize: false,
              value: [polylineWidth],

new S3DP.Primitive({
geometryInstances: polylinepc,
appearance: new S3DP.PolylineColorAppearance({
flat: true,
renderState: {
depthTest: false,

In some cases,I want delete one GeometryInstance?