Beispiel #1
0
        private PenetrVueTask(Element element, Sp3dPenTask task)
        {
            if (task == null)
            {
                return;
            }

            initialize_(element);

            Oid = task.Oid;
            UID = task.UID;

            rawLocation_ = (!App.Point3dEqual(task.Location, App.Point3dZero()))
            ?  task.Location :  Cell.Origin;

            long activeModelRef = App.ActiveModelReference.MdlModelRefP();

            if (ModelRef.IsAttachmentOf(App.ActiveModelReference))
            {
                rawLocation_ = App.Point3dScale(rawLocation_, UOR.subPerMaster);
            }

            Rotation = task.Rotation;

            Code = task.Code;
            // разбор типоразмера:
            parseTypeSize(task.Name);

            if (task.XAttrDoc.Root.GetChild("P3DEquipment") != null)
            {
                TaskType = TaskTypeEnum.PipeEquipment;
            }
            else if (task.XAttrDoc.Root.GetChild("P3DHangerPipeSupport") != null &&
                     task.XAttrDoc.Root.GetChild("P3DHangerStdComponent") != null)
            {
                TaskType = TaskTypeEnum.PipeOld;
            }
            else
            {
                TaskType = TaskTypeEnum.Pipe;
            }

            if (TaskType == TaskTypeEnum.Pipe)
            {
                findFlanges();
            }
            else
            {
                findFlangesOld();
            }

            scanInfo();

            // важно в конце - после определения пересечений
            RefPoints[0] = Location;
        }
Beispiel #2
0
        public static bool getFromElement(Element element, XDocument attrsXDoc, out PenetrVueTask penTask)
        {
            penTask = null;

            XDocument xDoc = ElementHelper.getSp3dXDocument(element);

            xDoc.Merge(attrsXDoc);

            Sp3dPenTask sp3dTask = new Sp3dPenTask(xDoc);

            if (sp3dTask.Type == Sp3dPenTask.TaskType.Pipe && sp3dTask.IsValid)
            {
                penTask = new PenetrVueTask(element, sp3dTask);
                Sp3dToDGMapping.Instance.LoadValuesFromXDoc(xDoc, penTask.DataGroupPropsValues);
            }

            return(penTask != null ? penTask.isValid : false);
        }