示例#1
0
 def ReadXml(self):
     self.comment = cad.GetXmlValue('comment', self.comment)
     self.active = cad.GetXmlBool('active', self.active)
     self.tool_number = cad.GetXmlInt('tool_number', self.tool_number)
     self.pattern = cad.GetXmlInt('pattern', self.pattern)
     self.surface = cad.GetXmlInt('surface', self.surface)
     CamObject.ReadXml(self)
示例#2
0
    def ReadXml(self):
        self.color = cad.Color(cad.GetXmlInt('col', self.color.ref()))
        for i in range(0, len(sketch_xml_names)):
            self.sketch_ids[i] = cad.GetXmlInt(sketch_xml_names[i], 0)
        self.mirror = cad.GetXmlBool('mirror')
        self.centre_straight = cad.GetXmlBool('centre_straight')
        self.render_wing = cad.GetXmlBool('render_wing', True)
        self.render_pattern = cad.GetXmlBool('render_pattern', False)
        self.pattern_border = cad.GetXmlFloat('pattern_border', 10.0)
        self.pattern_x_step = cad.GetXmlFloat('pattern_x_step', 20.0)
        self.pattern_y_step = cad.GetXmlFloat('pattern_y_step', 30.0)
        self.pattern_wall = cad.GetXmlFloat('pattern_wall', 2.0)
        self.split_into_pieces = cad.GetXmlInt('split_into_pieces', 6)
        self.split_wall_width = cad.GetXmlFloat('split_wall_width', 4.0)

        Object.ReadXml(self)
示例#3
0
文件: Object.py 项目: danheeks/PyCAD
 def ReadXml(self):
     if self.id_named:
         self.title = cad.GetXmlValue('title', self.title)
         self.title_made_from_id = cad.GetXmlBool('title_from_id',
                                                  self.title_made_from_id)
     if self.CallsObjListReadXml():
         cad.ObjList.ReadXml(self)
     else:
         self.ReadObjectXml()
示例#4
0
    def ReadXml(self):
        child_element = cad.GetFirstXmlChild()
        while child_element != None:
            if child_element == 'params':
                self.dwell = cad.GetXmlFloat('dwell', self.dwell)
                self.retract_mode = cad.GetXmlInt('retract_mode',
                                                  self.retract_mode)
                self.spindle_mode = cad.GetXmlInt('spindle_mode',
                                                  self.spindle_mode)
                self.internal_coolant_on = cad.GetXmlBool(
                    'internal_coolant_on', self.internal_coolant_on)
                self.rapid_to_clearance = cad.GetXmlBool(
                    'rapid_to_clearance', self.rapid_to_clearance)
            elif child_element == 'Point':
                self.points.append(cad.GetXmlInt('id'))

            child_element = cad.GetNextXmlChild()
        DepthOp.ReadXml(self)
示例#5
0
    def ReadXml(self):
        self.tolerance = cad.GetXmlFloat('tolerance', self.tolerance)
        self.material_allowance = cad.GetXmlFloat('material_allowance',
                                                  self.material_allowance)
        self.same_for_each_pattern_position = cad.GetXmlBool(
            'same_for_posns', self.same_for_each_pattern_position)

        child_element = cad.GetFirstXmlChild()
        while child_element != None:
            if child_element == 'solid':
                solid = cad.GetXmlInt('id')
                self.solids.append(solid)
            child_element = cad.GetNextXmlChild()
        CamObject.ReadXml(self)
示例#6
0
文件: Program.py 项目: danheeks/PyCAM
    def ReadXml(self):
        self.machine = self.GetMachine(cad.GetXmlValue('machine'))
        self.output_file = cad.GetXmlValue('output_file')
        self.output_file_name_follows_data_file_name = cad.GetXmlBool(
            'output_file_name_follows_data_file_name')
        self.units = cad.GetXmlFloat('units')
        self.path_control_mode = cad.GetXmlInt('ProgramPathControlMode')
        self.motion_blending_tolerance = cad.GetXmlFloat(
            'ProgramMotionBlendingTolerance')
        self.naive_cam_tolerance = cad.GetXmlFloat('ProgramNaiveCamTolerance')

        CamObject.ReadXml(self)

        self.ReloadPointers()

        self.add_initial_children()  # add any missing children
示例#7
0
文件: Tool.py 项目: danheeks/PyCAM
 def ReadXml(self):
     self.tool_number = cad.GetXmlInt('tool_number')
     self.title = cad.GetXmlValue('title')
     
     child_element = cad.GetFirstXmlChild()
     while child_element != None:
         if child_element == 'params':
             self.diameter = cad.GetXmlFloat('diameter', self.diameter)
             self.tool_length_offset = cad.GetXmlFloat('tool_length_offset', self.tool_length_offset)
             self.automatically_generate_title = cad.GetXmlBool('automatically_generate_title', self.automatically_generate_title)
             self.material = cad.GetXmlInt('material', self.material)
             type_str = GetToolTypeXMLString(self.type)
             xml_value = cad.GetXmlValue('type', type_str)
             self.type = GetToolTypeFromString(xml_value)
             self.corner_radius = cad.GetXmlFloat('corner_radius', self.corner_radius)
             self.flat_radius = cad.GetXmlFloat('flat_radius', self.flat_radius)
             self.cutting_edge_angle = cad.GetXmlFloat('cutting_edge_angle', self.cutting_edge_angle)
             self.cutting_edge_height = cad.GetXmlFloat('cutting_edge_height', self.cutting_edge_height)
         child_element = cad.GetNextXmlChild()
         
     CamObject.ReadXml(self)
         
     self.ResetTitle()
示例#8
0
    def ReadXml(self):
        child_element = cad.GetFirstXmlChild()
        while child_element != None:
            if child_element == 'params':
                self.tool_on_side = cad.GetXmlInt('side', self.tool_on_side)
                self.cut_mode = cad.GetXmlInt('cut_mode', self.cut_mode)
                self.auto_roll_on = cad.GetXmlBool('auto_roll_on',
                                                   self.auto_roll_on)
                self.roll_on_point.x = cad.GetXmlFloat('roll_onx',
                                                       self.roll_on_point.x)
                self.roll_on_point.y = cad.GetXmlFloat('roll_ony',
                                                       self.roll_on_point.y)
                self.roll_on_point.z = cad.GetXmlFloat('roll_onz',
                                                       self.roll_on_point.z)
                self.auto_roll_off = cad.GetXmlBool('auto_roll_off',
                                                    self.auto_roll_off)
                self.roll_off_point.x = cad.GetXmlFloat(
                    'roll_offx', self.roll_off_point.x)
                self.roll_off_point.y = cad.GetXmlFloat(
                    'roll_offy', self.roll_off_point.y)
                self.roll_off_point.z = cad.GetXmlFloat(
                    'roll_offz', self.roll_off_point.z)
                self.auto_roll_radius = cad.GetXmlFloat(
                    'roll_radius', self.auto_roll_radius)
                self.start_given = cad.GetXmlBool('start_given',
                                                  self.start_given)
                self.start.x = cad.GetXmlFloat('startx', self.start.x)
                self.start.y = cad.GetXmlFloat('starty', self.start.y)
                self.start.z = cad.GetXmlFloat('startz', self.start.z)
                self.end_given = cad.GetXmlBool('end_given', self.end_given)
                self.end.x = cad.GetXmlFloat('endx', self.end.x)
                self.end.y = cad.GetXmlFloat('endy', self.end.y)
                self.end.z = cad.GetXmlFloat('endz', self.end.z)
                self.end_beyond_full_profile = cad.GetXmlBool(
                    'end_beyond_full_profile', self.end_beyond_full_profile)
                self.sort_sketches = cad.GetXmlBool('sort_sketches',
                                                    self.sort_sketches)
                self.offset_extra = cad.GetXmlFloat('offset_extra',
                                                    self.offset_extra)
                self.do_finishing_pass = cad.GetXmlBool(
                    'do_finishing_pass', self.do_finishing_pass)
                self.only_finishing_pass = cad.GetXmlBool(
                    'only_finishing_pass', self.only_finishing_pass)
                self.finishing_h_feed_rate = cad.GetXmlFloat(
                    'finishing_feed_rate', self.finishing_h_feed_rate)
                self.finishing_cut_mode = cad.GetXmlInt(
                    'finish_cut_mode', self.finishing_cut_mode)
                self.finishing_step_down = cad.GetXmlFloat(
                    'finishing_step_down', self.finishing_step_down)
                self.extend_at_start = cad.GetXmlFloat('extend_at_start',
                                                       self.extend_at_start)
                self.extend_at_end = cad.GetXmlFloat('extend_at_end',
                                                     self.extend_at_end)
                self.lead_in_line_len = cad.GetXmlFloat(
                    'lead_in_line_len', self.lead_in_line_len)
                self.lead_out_line_len = cad.GetXmlFloat(
                    'lead_out_line_len', self.lead_out_line_len)
            if child_element == 'Tags':
                self.tags = cad.GetXmlObject()
                self.Add(self.tags)

            child_element = cad.GetNextXmlChild()

        SketchOp.ReadXml(self)