Пример #1
0
        }//addRobotBars

        //Generate the label for constraints in the entire struture
        private string getConstraintLabel()
        {
            IRobotLabel supportLabel = iRobotApp.Project.Structure.Labels.Create(IRobotLabelType.I_LT_SUPPORT, "Apoios");

            IRobotNodeSupportData supports = (RobotNodeSupportData)supportLabel.Data;

            supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RX, 0);
            supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RY, 0);
            supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RZ, 0);
            supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UX, 1);
            supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UY, 1);
            supports.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UZ, 1);

            iRobotApp.Project.Structure.Labels.Store(supportLabel);

            return(supportLabel.Name);
        }//getConstraintLabel
Пример #2
0
        private void CreateNodes()
        {
            IRobotLabel           sup      = _structure.Labels.Create(IRobotLabelType.I_LT_SUPPORT, "CatiaSupport");
            IRobotNodeSupportData sup_data = sup.Data as IRobotNodeSupportData;

            sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UX, 1);
            sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UY, 1);
            sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_UZ, 1);
            sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RX, 0);
            sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RY, 0);
            sup_data.SetFixed(IRobotNodeSupportFixingDirection.I_NSFD_RZ, 0);

            _structure.Labels.Store(sup);

            int nodeId = 100;

            for (int i = 0; i < _nodeInfo.Count; i++)
            {
                Console.WriteLine("Now creating " + nodeId.ToString() + "...");
                var n = (AnalyticalNode)_nodeInfo[i];

                //create the robot node
                _nodes.Create(nodeId, n.X, n.Y, n.Z);

                if (n.IsFixed == true)
                {
                    Console.WriteLine("Fixing node " + nodeId.ToString() + "...");
                    IRobotNode node = _nodes.Get(nodeId) as IRobotNode;
                    node.SetLabel(IRobotLabelType.I_LT_NODE_SUPPORT, "CatiaSupport");
                }

                //set the robot node information in the List
                //to be pushed back into the XML
                n.Id = nodeId; //the robot node Id
                //n.displaceX = 0.0;
                //n.displaceY = 0.0;
                //n.displaceZ = 0.0;

                nodeId++;
            }
        }