示例#1
0
        //SemLocalPlacement3D _objectSemLocalPlacement;

        //public override SemLocalPlacement3D ObjectSemLocalPlacement {
        //    get { return _objectSemLocalPlacement; }
        //    protected set { _objectSemLocalPlacement = value; }
        //}

        SemAnnotation(string name, string type, SemElement element,
                      SemCoordinate3D position, SemDirection3D zAxis, SemDirection3D xAxis)
        {
            Element = element;

            SemPosition3D pos = SemPosition3D.Create(position, zAxis, xAxis);

            ObjectSemLocalPlacement = SemLocalPlacement3D.Create(
                Element.ObjectSemLocalPlacement, pos);

            var tg = SemTextGeometry.Create(name, SemPosition2D.DefaultPosition);


            IfcAnnotation = new IfcAnnotation {
                GlobalId        = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory    = SemHeaderSetting.Setting3D.IfcOwnerHistory,
                Name            = name,
                ObjectPlacement = ObjectSemLocalPlacement.IfcLocalPlacement,
                Representation  = tg.IfcProductDefinitionShape,
                ObjectType      = type,
            };


            IfcRelAssignsToProduct = new IfcRelAssignsToProduct {
                GlobalId        = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory    = SemHeaderSetting.Setting3D.IfcOwnerHistory,
                RelatedObjects  = new List <IfcObjectDefinition>(),
                RelatingProduct = IfcAnnotation,
            };


            IfcRelAssignsToProduct.RelatedObjects.Add(element.IfcObject);
        }
示例#2
0
        public static SemAnnotation Create(string name, string type, SemElement element,
                                           SemCoordinate3D position, SemDirection3D zAxis, SemDirection3D xAxis)
        {
            var ann = new SemAnnotation(name, type, element,
                                        position, zAxis, xAxis);

            SemInstanceDB.AddToExport(ann);
            return(ann);
        }