Beispiel #1
0
 private void buttonQuantity_Click(object sender, EventArgs e)
 {
     using (FormSelectQuantity form = new FormSelectQuantity(this.m_base as DocEntity, this.m_project, false))
     {
         if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
         {
             string       value     = form.GenerateValuePath();
             CvtValuePath valuepath = CvtValuePath.Parse(value, this.m_map);
             LoadValuePath(valuepath);
         }
     }
 }
Beispiel #2
0
        private void buttonQuantity_Click(object sender, EventArgs e)
        {
            using (FormSelectQuantity form = new FormSelectQuantity(this.m_base as DocEntity, this.m_project, false))
            {
                if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    string suffix = null;
                    switch (form.SelectedQuantity.QuantityType)
                    {
                    case DocQuantityTemplateTypeEnum.Q_AREA:
                        suffix = @"IfcQuantityArea.AreaValue\IfcAreaMeasure";
                        break;

                    case DocQuantityTemplateTypeEnum.Q_COUNT:
                        suffix = @"IfcQuantityCount.CountValue\IfcInteger";
                        break;

                    case DocQuantityTemplateTypeEnum.Q_LENGTH:
                        suffix = @"IfcQuantityLength.LengthValue\IfcLengthMeasure";
                        break;

                    case DocQuantityTemplateTypeEnum.Q_TIME:
                        suffix = @"IfcQuantityTime.TimeValue\IfcTimeMeasure";
                        break;

                    case DocQuantityTemplateTypeEnum.Q_VOLUME:
                        suffix = @"IfcQuantityVolume.VolumeValue\IfcVolumeMeasure";
                        break;

                    case DocQuantityTemplateTypeEnum.Q_WEIGHT:
                        suffix = @"IfcQuantityWeight.WeightValue\IfcWeightMeasure";
                        break;
                    }

                    string value = @"\" + this.m_base.Name + @".IsDefinedBy['" + form.SelectedQuantitySet +
                                   @"']\IfcRelDefinesByProperties.RelatingPropertyDefinition\IfcElementQuantity.Quantities['" + form.SelectedQuantity +
                                   @"']\" + suffix;

                    CvtValuePath valuepath = CvtValuePath.Parse(value, this.m_map);
                    LoadValuePath(valuepath);
                }
            }
        }
Beispiel #3
0
        private void toolStripButtonQuantity_Click(object sender, EventArgs e)
        {
            DocEntity docBaseEntity = this.m_project.GetDefinition(this.m_template.Type) as DocEntity;

            if (this.m_conceptroot != null && this.m_conceptroot.ApplicableEntity != null)
            {
                docBaseEntity = this.m_conceptroot.ApplicableEntity;
            }

            using (FormSelectQuantity form = new FormSelectQuantity(docBaseEntity, this.m_project, false))
            {
                if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    string value = form.GenerateValuePath();

                    Dictionary <string, DocObject> mapEntity = new Dictionary <string, DocObject>();
                    foreach (DocSection docSection in this.m_project.Sections)
                    {
                        foreach (DocSchema docSchema in docSection.Schemas)
                        {
                            foreach (DocEntity docEntity in docSchema.Entities)
                            {
                                mapEntity.Add(docEntity.Name, docEntity);
                            }
                            foreach (DocType docType in docSchema.Types)
                            {
                                mapEntity.Add(docType.Name, docType);
                            }
                        }
                    }

                    CvtValuePath valuepath = CvtValuePath.Parse(value, mapEntity);

                    this.ChangeTemplate(valuepath.ToTemplateDefinition());

                    this.LoadTemplateGraph();
                    this.ContentChanged(this, EventArgs.Empty);
                }
            }
        }
Beispiel #4
0
        private void buttonQuantity_Click(object sender, EventArgs e)
        {
            using (FormSelectQuantity form = new FormSelectQuantity(this.m_base as DocEntity, this.m_project, false))
            {
                if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    string suffix = null;
                    switch (form.SelectedQuantity.QuantityType)
                    {
                        case DocQuantityTemplateTypeEnum.Q_AREA:
                            suffix = @"IfcQuantityArea.AreaValue\IfcAreaMeasure";
                            break;

                        case DocQuantityTemplateTypeEnum.Q_COUNT:
                            suffix = @"IfcQuantityCount.CountValue\IfcInteger";
                            break;

                        case DocQuantityTemplateTypeEnum.Q_LENGTH:
                            suffix = @"IfcQuantityLength.LengthValue\IfcLengthMeasure";
                            break;

                        case DocQuantityTemplateTypeEnum.Q_TIME:
                            suffix = @"IfcQuantityTime.TimeValue\IfcTimeMeasure";
                            break;

                        case DocQuantityTemplateTypeEnum.Q_VOLUME:
                            suffix = @"IfcQuantityVolume.VolumeValue\IfcVolumeMeasure";
                            break;

                        case DocQuantityTemplateTypeEnum.Q_WEIGHT:
                            suffix = @"IfcQuantityWeight.WeightValue\IfcWeightMeasure";
                            break;
                    }

                    string value = @"\" + this.m_base.Name + @".IsDefinedBy['" + form.SelectedQuantitySet +
                        @"']\IfcRelDefinesByProperties.RelatingPropertyDefinition\IfcElementQuantity.Quantities['" + form.SelectedQuantity +
                        @"']\" + suffix;

                    CvtValuePath valuepath = CvtValuePath.Parse(value, this.m_map);
                    LoadValuePath(valuepath);
                }
            }
        }