프로젝트

일반

사용자정보

개정판 82ab5276

ID82ab52768c4a1463512f9886ddf57ca1d0b96ef4
상위 19d25294
하위 fc25ae44, 1b2e6664, c891ebf3

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

dev issue #507 : fix attribute

Change-Id: I9418a37e46570f2cb4f122f0d63e8b42c56be02c

차이점 보기:

DTI_PID/SPPIDConverter/ConverterDocking.cs
113 113
                            {
114 114
                                modeling.DocumentLabelText = string.Format("Drawing Name : {0} ({1}/{2})", document.DrawingName, i + 1, converterForm.Documents.Count);
115 115
                                modeling.Run();
116

  
117
                                List<string> endLine = new List<string>();
118
                                Placement placement = new Placement();
119
                                LMADataSource dataSource = placement.PIDDataSource;
120
                                
121
                                foreach (var lineNumber in document.LINENUMBERS)
122
                                {
123
                                    foreach (LineRun run in lineNumber.RUNS)
124
                                    {
125
                                        foreach (var item in run.RUNITEMS)
126
                                        {
127
                                            if (item.GetType() == typeof(Line))
128
                                            {
129
                                                Line line = item as Line;
130
                                                if (line != null && !endLine.Contains(line.SPPID.ModelItemId))
131
                                                {
132
                                                    LMModelItem _LMModelItem = dataSource.GetModelItem(line.SPPID.ModelItemId);
133
                                                    if (_LMModelItem != null && _LMModelItem.get_ItemStatus() == "Active")
134
                                                    {
135
                                                        foreach (var attribute in lineNumber.ATTRIBUTES)
136
                                                        {
137
                                                            LineNumberMapping mapping = document.LineNumberMappings.Find(x => x.UID == attribute.UID);
138
                                                            if (mapping != null && !string.IsNullOrEmpty(attribute.VALUE) && attribute.VALUE != "None" && mapping.SPPIDATTRIBUTENAME == "PlantGroup.Name")
139
                                                            {
140
                                                                LMAAttribute _LMAAttribute = _LMModelItem.Attributes[mapping.SPPIDATTRIBUTENAME];
141
                                                                if (_LMAAttribute != null)
142
                                                                {
143
                                                                    if (DBNull.Value.Equals(_LMAAttribute.get_Value()))
144
                                                                        _LMAAttribute.set_Value(attribute.VALUE);
145
                                                                    else if (_LMAAttribute.get_Value() != attribute.VALUE)
146
                                                                        _LMAAttribute.set_Value(attribute.VALUE);
147
                                                                }
148
                                                            }
149
                                                        }
150
                                                        _LMModelItem.Commit();
151
                                                    }
152
                                                    if (_LMModelItem != null)
153
                                                        ReleaseCOMObjects(_LMModelItem);
154
                                                    endLine.Add(line.SPPID.ModelItemId);
155
                                                }
156
                                            }
157
                                        }
158
                                    }
159
                                }
160

  
161
                                ReleaseCOMObjects(dataSource);
162
                                ReleaseCOMObjects(placement);
116 163
                            }
117 164
                        }
118 165
                    }

내보내기 Unified diff

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