Example #1
0
def XMLRead():
    new_object = Wing()
    s = cad.GetXmlValue('col')
    if s != '':
        new_object.color = cad.Color(int(s))
    for i in range(0, len(sketch_xml_names)):
        new_object.sketch_ids[i] = int(cad.GetXmlValue(sketch_xml_names[i]))
    s = cad.GetXmlValue('mirror')
    if s != '': new_object.values['mirror'] = bool(s)

    return new_object
Example #2
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)
Example #3
0
    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
Example #4
0
 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()
Example #5
0
 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()
Example #6
0
 def ReadXml(self):
     child_element = cad.GetFirstXmlChild()
     while child_element != None:
         if child_element == 'depthop':
             self.clearance_height = cad.GetXmlFloat(
                 'clear', self.clearance_height)
             self.step_down = cad.GetXmlFloat('down', self.step_down)
             self.z_finish_depth = cad.GetXmlFloat('zfinish',
                                                   self.z_finish_depth)
             self.z_thru_depth = cad.GetXmlFloat('zthru', self.z_thru_depth)
             self.user_depths = cad.GetXmlValue('userdepths',
                                                self.user_depths)
             self.start_depth = cad.GetXmlFloat('startdepth',
                                                self.start_depth)
             self.final_depth = cad.GetXmlFloat('depth', self.final_depth)
             self.rapid_safety_space = cad.GetXmlFloat(
                 'r', self.rapid_safety_space)
         child_element = cad.GetNextXmlChild()
     SpeedOp.ReadXml(self)
Example #7
0
 def ReadXml(self):
     self.filepath = cad.GetXmlValue('filepath')
     if self.bottom_left == None:
         self.bottom_left = geom.Point3D(0, 0, 0)
         self.bottom_right = geom.Point3D(0, 0, 0)
         self.top_right = geom.Point3D(0, 0, 0)
         self.top_left = geom.Point3D(0, 0, 0)
     self.bottom_left.x = float(cad.GetXmlValue('x00'))
     self.bottom_left.y = float(cad.GetXmlValue('x01'))
     self.bottom_left.z = float(cad.GetXmlValue('x02'))
     self.bottom_right.x = float(cad.GetXmlValue('x10'))
     self.bottom_right.y = float(cad.GetXmlValue('x11'))
     self.bottom_right.z = float(cad.GetXmlValue('x12'))
     self.top_right.x = float(cad.GetXmlValue('x20'))
     self.top_right.y = float(cad.GetXmlValue('x21'))
     self.top_right.z = float(cad.GetXmlValue('x22'))
     self.top_left.x = float(cad.GetXmlValue('x30'))
     self.top_left.y = float(cad.GetXmlValue('x31'))
     self.top_left.z = float(cad.GetXmlValue('x32'))
     self.opacity = float(cad.GetXmlValue('opacity'))
     Object.ReadXml(self)
Example #8
0
 def ReadXml(self):
     self.str = cad.GetXmlValue('script')
     Operation.ReadXml(self)