Ejemplo n.º 1
0
        public override bool Execute(ExecutionInfo exInfo = null)
        {
            Result = false;
            if (FilePath.IsValid && Write)
            {
                if (Options == null)
                {
                    Options = new RobotConversionOptions(true);
                }

                Document.Model.GenerateNodes(new NodeGenerationParameters());
                var robot = new RobotController();
                robot.Message += HandleMessage;
                RobotIDMappingTable idMap = null;
                if (Document.IDMappings.ContainsKey(FilePath))
                {
                    idMap = Document.IDMappings[FilePath] as RobotIDMappingTable;
                }
                if (idMap == null)
                {
                    idMap = Document.IDMappings.GetLatest(".rtd") as RobotIDMappingTable;
                }
                if (idMap == null)
                {
                    idMap = new RobotIDMappingTable();
                    Document.IDMappings.Add(FilePath, idMap);
                }
                robot.UpdateRobotFromModel(FilePath, Model, ref idMap, Options);
                //robot.WriteModelToRobot(FilePath, Document.Model, ref idMap);
                robot.Close();
                robot.Release();
                Result = true;
            }
            return(true);
        }
 public override bool Execute(ExecutionInfo exInfo = null)
 {
     Options                = new RobotConversionOptions();
     Options.Nodes          = Nodes;
     Options.LinearElements = LinearElements;
     Options.PanelElements  = PanelElements;
     Options.Families       = Families;
     Options.DeleteObjects  = Delete;
     return(true);
 }