Ejemplo n.º 1
0
        private void CreateBarEndRelease(List <AnalyticalBar> barInfo)
        {
            if (barInfo.Any(x => x.EndRelease.Length != 12))
            {
                throw new Exception("End Release value must be 12 values formatted as 'x'(free) and 'f'(fixed)");
            }

            //create a bar end release
            IRobotLabel             rel1          = _structure.Labels.Create(IRobotLabelType.I_LT_BAR_RELEASE, "CatiaBarRelease");
            IRobotBarReleaseData    relData1      = rel1.Data as IRobotBarReleaseData;
            IRobotBarEndReleaseData relStartData1 = relData1.StartNode;
            IRobotBarEndReleaseData relEndData1   = relData1.EndNode;

            IRobotBarEndReleaseValue[] relVals = new IRobotBarEndReleaseValue[12];
            char[] letters = _barInfo[0].EndRelease.ToCharArray();

            for (int i = 0; i < _barInfo[0].EndRelease.Length; i++)
            {
                if (letters[i].ToString() == "f")
                {
                    relVals[i] = IRobotBarEndReleaseValue.I_BERV_FIXED;
                }
                else if (letters[i].ToString() == "x")
                {
                    relVals[i] = IRobotBarEndReleaseValue.I_BERV_NONE;
                }
            }

            relStartData1.UX = relVals[0];
            relStartData1.UY = relVals[1];
            relStartData1.UZ = relVals[2];
            relStartData1.RX = relVals[3];
            relStartData1.RY = relVals[4];
            relStartData1.RZ = relVals[5];
            relEndData1.UX   = relVals[6];
            relEndData1.UY   = relVals[7];
            relEndData1.UZ   = relVals[8];
            relEndData1.RX   = relVals[9];
            relEndData1.RY   = relVals[10];
            relEndData1.RZ   = relVals[11];

            _structure.Labels.Store(rel1);
        }
Ejemplo n.º 2
0
        private void CreateBarEndRelease(List<AnalyticalBar> barInfo)
        {
            if (barInfo.Any(x => x.EndRelease.Length != 12))
                throw new Exception("End Release value must be 12 values formatted as 'x'(free) and 'f'(fixed)");

            //create a bar end release
            IRobotLabel rel1 = _structure.Labels.Create(IRobotLabelType.I_LT_BAR_RELEASE, "CatiaBarRelease");
            IRobotBarReleaseData relData1 = rel1.Data as IRobotBarReleaseData;
            IRobotBarEndReleaseData relStartData1 = relData1.StartNode;
            IRobotBarEndReleaseData relEndData1 = relData1.EndNode;

            IRobotBarEndReleaseValue[] relVals = new IRobotBarEndReleaseValue[12];
            char[] letters = _barInfo[0].EndRelease.ToCharArray();

            for (int i = 0; i < _barInfo[0].EndRelease.Length; i++)
            {
                if (letters[i].ToString() == "f")
                {
                    relVals[i] = IRobotBarEndReleaseValue.I_BERV_FIXED;
                }
                else if (letters[i].ToString() == "x")
                {
                    relVals[i] = IRobotBarEndReleaseValue.I_BERV_NONE;
                }
            }

            relStartData1.UX = relVals[0];
            relStartData1.UY = relVals[1];
            relStartData1.UZ = relVals[2];
            relStartData1.RX = relVals[3];
            relStartData1.RY = relVals[4];
            relStartData1.RZ = relVals[5];
            relEndData1.UX = relVals[6];
            relEndData1.UY = relVals[7];
            relEndData1.UZ = relVals[8];
            relEndData1.RX = relVals[9];
            relEndData1.RY = relVals[10];
            relEndData1.RZ = relVals[11];

            _structure.Labels.Store(rel1);
        }