프로젝트

일반

사용자정보

개정판 8b069d9f

ID8b069d9f8472258b9baf30976b7418cb5294374c
상위 310aeb31
하위 c724afb0, 10c7195c

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #000 : 임시 라벨 모델링

Change-Id: If4dfabcadb25ed4d0b7aa3ed668b1be9f451ac23

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
116 116
                #region 임시 Label
117 117
                foreach (var item in document.SYMBOLS)
118 118
                {
119
                    if (item.TYPE.Contains("Labels"))
119
                    if (item.SPPID.MAPPINGNAME.Contains("Labels - "))
120 120
                    {
121 121
                        SPPIDSymbolInfo info = item.SPPID;
122 122
                        Array points = new double[] { 0, item.SPPID.ORIGINAL_X, item.SPPID.ORIGINAL_Y };
123 123
                        string symbolUID = item.ATTRIBUTES.Find(x => x.ATTRIBUTE == "SYMBOLOWNER").VALUE;
124 124
                        Symbol symbol = SPPIDUtil.FindObjectByUID(document, symbolUID) as Symbol;
125

  
126
                        LMSymbol _TargetItem = dataSource.GetSymbol(symbol.SPPID.RepresentationId);
127
                        LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(item.SPPID.MAPPINGNAME, ref points, Rotation: 0, LabeledItem: _TargetItem.AsLMRepresentation(), IsLeaderVisible: true);
128
                        LMModelItem _LMModelItem = _TargetItem.ModelItemObject;
129
                        LMAAttributes _Attributes = _LMModelItem.Attributes;
130

  
131
                        foreach (var attribute in item.ATTRIBUTES)
125
                        if (symbol != null)
132 126
                        {
133
                            AttributeMapping mapping = document.AttributeMappings.Find(x => x.UID == attribute.UID);
134
                            if (mapping != null)
127
                            LMSymbol _TargetItem = dataSource.GetSymbol(symbol.SPPID.RepresentationId);
128
                            LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(item.SPPID.MAPPINGNAME, ref points, Rotation: 0, LabeledItem: _TargetItem.AsLMRepresentation(), IsLeaderVisible: true);
129
                            LMModelItem _LMModelItem = _TargetItem.ModelItemObject;
130
                            LMAAttributes _Attributes = _LMModelItem.Attributes;
131

  
132
                            foreach (var attribute in item.ATTRIBUTES)
135 133
                            {
136
                                LMAAttribute _LMAAttribute = _Attributes[mapping.SPPIDATTRIBUTENAME];
137
                                if (_LMAAttribute != null)
138
                                    _LMAAttribute.set_Value(attribute.VALUE);
134
                                AttributeMapping mapping = document.AttributeMappings.Find(x => x.UID == attribute.UID);
135
                                if (mapping != null)
136
                                {
137
                                    LMAAttribute _LMAAttribute = _Attributes[mapping.SPPIDATTRIBUTENAME];
138
                                    if (_LMAAttribute != null)
139
                                        _LMAAttribute.set_Value(attribute.VALUE);
140
                                }
139 141
                            }
142
                            _LMModelItem.Commit();
143
                            _LMLabelPresist.Commit();
144
                            ReleaseCOMObjects(_TargetItem);
145
                            ReleaseCOMObjects(_LMLabelPresist);
146
                            ReleaseCOMObjects(_LMModelItem);
147
                            ReleaseCOMObjects(_Attributes);
140 148
                        }
141
                        _LMModelItem.Commit();
142
                        _LMLabelPresist.Commit();
143
                        ReleaseCOMObjects(_TargetItem);
144
                        ReleaseCOMObjects(_LMLabelPresist);
145
                        ReleaseCOMObjects(_LMModelItem);
146
                        ReleaseCOMObjects(_Attributes);
147 149
                    }
148 150
                }
149 151
                #endregion
......
1102 1104
                        {
1103 1105
                            LMAAttribute _Attribute = _Attributes[mapping.SPPIDATTRIBUTENAME];
1104 1106
                            if (_Attribute != null)
1105
                                _Attribute.set_Value(item.VALUE.Replace(" ", ""));
1107
                            {
1108
                                // 임시
1109
                                if (item.ATTRIBUTETYPE == "String")
1110
                                {
1111
                                    if (!string.IsNullOrEmpty(item.VALUE))
1112
                                    {
1113
                                        if (!DBNull.Value.Equals(_Attribute.get_Value()) && !string.IsNullOrEmpty(_Attribute.get_Value()))
1114
                                        {
1115
                                            string value = _Attribute.get_Value() + "\n" + item.VALUE;
1116
                                            _Attribute.set_Value(value);
1117
                                        }
1118
                                        else
1119
                                        {
1120
                                            _Attribute.set_Value(item.VALUE);
1121
                                        }
1122
                                    }
1123
                                }
1124
                                else
1125
                                {
1126
                                    _Attribute.set_Value(item.VALUE);
1127
                                }
1128
                            }
1106 1129
                        }
1107 1130
                    }
1108 1131

  
......
1127 1150
            LMSymbol _LMSymbol = null;
1128 1151
            try
1129 1152
            {
1130
                if (text.ASSOCIATION && !string.IsNullOrEmpty(text.OWNER) && text.OWNER != "None")
1153
                //if (text.ASSOCIATION && !string.IsNullOrEmpty(text.OWNER) && text.OWNER != "None")
1154
                if (text.ASSOCIATION)
1131 1155
                {
1132 1156
                    object owner = SPPIDUtil.FindObjectByUID(document, text.OWNER);
1133 1157
                    if (owner.GetType() == typeof(Symbol))
DTI_PID/SPPIDConverter/ConverterForm.cs
545 545
#if DEBUG
546 546
            this.Visible = false;
547 547

  
548
            SPPID_Document document = new SPPID_Document(@"Z:\HanKyouHo\temp\Isocynates\Temp\11111.xml");
548
            //SPPID_Document document = new SPPID_Document(@"Z:\HanKyouHo\temp\Isocynates\Temp\11111.xml");
549 549
            //SPPID_Document document = new SPPID_Document(@"Z:\HanKyouHo\temp\Isocynates\Temp\zIsocynates-325_Page75.xml");
550
            //SPPID_Document document = new SPPID_Document(@"Z:\HanKyouHo\temp\Isocynates\Temp\Isocynates-325_Page49.xml");
550
            SPPID_Document document = new SPPID_Document(@"Z:\HanKyouHo\temp\Isocynates\Temp\Isocynates-325_Page49.xml");
551 551
            document.SymbolMappings = symbolMappings;
552 552
            document.ChildSymbolMappings = childSymbolMappings;
553 553
            document.LineMappings = lineMappings;

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)