public XbimShapeInstance(int id = -1) { _instanceLabel = id; _expressTypeId = 0; _ifcProductLabel = 0; _styleLabel = 0; _shapeLabel = -1; _representationContext = 0; _representationType = XbimGeometryRepresentationType.OpeningsAndAdditionsExcluded; _transformation = XbimMatrix3D.Identity; _boundingBox = XbimRect3D.Empty; }
/// <summary> /// Adds a shape instance to the database table /// </summary> /// <param name="ctxtId"></param> /// <param name="shapeLabel"></param> /// <param name="typeId"></param> /// <param name="productLabel"></param> /// <param name="repType"></param> /// <param name="bounds"></param> /// <param name="transform"></param> public int AddInstance(int ctxtId, int shapeLabel, int styleLabel, short typeId, int productLabel, XbimGeometryRepresentationType repType, byte[] transform) { int id = -1; using (var update = new Update(sesid, table, JET_prep.Insert)) { _colValRepresentationContext.Value = ctxtId; _colValIfcProductLabel.Value = productLabel; _colValIfcTypeId.Value = typeId; _colValShapeLabel.Value = shapeLabel; _colValStyleLabel.Value = styleLabel; _colValRepType.Value = (byte) repType; _colValTransformation.Value = transform; Api.SetColumns(sesid, table, _colValues); id = Api.RetrieveColumnAsInt32(sesid, table, _colIdInstanceLabel, RetrieveColumnGrbit.RetrieveCopy).Value; update.Save(); UpdateCount(1); } return id; ; }
/// <summary> /// Adds a shape instanceData to the database table /// </summary> /// <param name="ctxtId"></param> /// <param name="shapeLabel"></param> /// <param name="typeId"></param> /// <param name="productLabel"></param> /// <param name="repType"></param> /// <param name="bounds"></param> /// <param name="transform"></param> public int AddInstance(int ctxtId, int shapeLabel, int styleLabel, short typeId, int productLabel, XbimGeometryRepresentationType repType, byte[] transform) { var id = -1; using (var update = new Update(Sesid, Table, JET_prep.Insert)) { _colValRepresentationContext.Value = ctxtId; _colValIfcProductLabel.Value = productLabel; _colValIfcTypeId.Value = typeId; _colValShapeLabel.Value = shapeLabel; _colValStyleLabel.Value = styleLabel; _colValRepType.Value = (byte)repType; _colValTransformation.Value = transform; Api.SetColumns(Sesid, Table, _colValues); id = Api.RetrieveColumnAsInt32(Sesid, Table, _colIdInstanceLabel, RetrieveColumnGrbit.RetrieveCopy).Value; update.Save(); UpdateCount(1); } return(id);; }