프로젝트

일반

사용자정보

개정판 f4880c6a

IDf4880c6aae5e38bdaf2dd6639910971323feaa23
상위 f2baa6a3
하위 ea80efaa

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

dev issue #000 : Line Number ConnLIne 적용으로 제일 가까운 Connector에 Label 생성

Change-Id: I935bb062697fba65c796f2174b23fa8af54657a5

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
987 987

  
988 988
        private void LineNumberModeling(LineNumber lineNumber)
989 989
        {
990
            Line line = null;
991
            foreach (var lineRun in lineNumber.RUNS)
992
            {
993
                foreach (var item in lineRun.RUNITEMS)
994
                {
995
                    line = item as Line;
996
                    if (line != null && !string.IsNullOrEmpty(line.SPPID.ModelItemId))
997
                        break;
998
                    else
999
                        line = null;
1000
                }
1001
                if (line != null)
1002
                    break;
1003
            }
1004

  
1005
            if (line != null && !string.IsNullOrEmpty(line.SPPID.ModelItemId))
990
            Line line = SPPIDUtil.FindObjectByUID(document, lineNumber.CONNLINE) as Line;
991
            Dictionary<LMConnector, List<double[]>> connectorVertices = GetPipeRunVertices(line.SPPID.ModelItemId);
992
            LMConnector connectedLMConnector = FindTargetLMConnectorByPoint(connectorVertices, lineNumber.SPPID.ORIGINAL_X, lineNumber.SPPID.ORIGINAL_Y);
993
            if (connectedLMConnector != null)
1006 994
            {
1007 995
                Array points = new double[] { 0, lineNumber.SPPID.ORIGINAL_X, lineNumber.SPPID.ORIGINAL_Y };
1008
                LMPipeRun _pipeRun = dataSource.GetPipeRun(line.SPPID.ModelItemId);
1009
                if (_pipeRun != null)
1010
                {
1011
                    foreach (LMRepresentation rep in _pipeRun.Representations)
1012
                    {
1013
                        if (rep.get_RepresentationType() == "Connector" && rep.get_ItemStatus() == "Active")
1014
                        {
1015
                            LMConnector _LmConnector = dataSource.GetConnector(rep.Id);
1016
                            LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, ref points, Rotation: lineNumber.ANGLE, LabeledItem: _LmConnector.AsLMRepresentation(), IsLeaderVisible: false);
1017
                            _LmLabelPresist.Commit();
996
                LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, ref points, Rotation: lineNumber.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: false);
997
                _LmLabelPresist.Commit();
1018 998

  
1019
                            if (_LmConnector != null)
1020
                                ReleaseCOMObjects(_LmConnector);
1021
                            if (_LmLabelPresist != null)
1022
                            {
1023
                                lineNumber.SPPID.RepresentationId = _LmLabelPresist.AsLMRepresentation().Id;
1024
                                ReleaseCOMObjects(_LmConnector);
1025
                            }
1026

  
1027
                            break;
1028
                        }
1029
                    }
1030

  
1031
                    ReleaseCOMObjects(_pipeRun);
999
                foreach (var item in connectorVertices)
1000
                    ReleaseCOMObjects(item.Key);
1001
                if (_LmLabelPresist != null)
1002
                {
1003
                    lineNumber.SPPID.RepresentationId = _LmLabelPresist.AsLMRepresentation().Id;
1004
                    ReleaseCOMObjects(_LmLabelPresist);
1032 1005
                }
1033 1006
            }
1034 1007
        }

내보내기 Unified diff

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