def getValueByKey( self, key ): "Get value by the key." if key in evaluate.globalElementValueDictionary: return evaluate.globalElementValueDictionary[key](self) if key in self.attributeDictionary: return evaluate.getEvaluatedLinkValue( self.attributeDictionary[key], self ) return None
def processXMLElementByGeometry(geometryOutput, xmlElement): "Process the xml element by geometryOutput." if geometryOutput == None: return geometryOutput = evaluate.getVector3ListsRecursively(geometryOutput) if 'target' in xmlElement.attributeDictionary and not evaluate.getEvaluatedBooleanDefault( False, 'copy', xmlElement): target = evaluate.getEvaluatedLinkValue( str(xmlElement.attributeDictionary['target']).strip(), xmlElement) if target.__class__.__name__ == 'XMLElement': target.removeChildrenFromIDNameParent() xmlElement = target if xmlElement.object != None: if xmlElement.parent.object != None: if xmlElement.object in xmlElement.parent.object.archivableObjects: xmlElement.parent.object.archivableObjects.remove( xmlElement.object) firstElement = None if len(geometryOutput) > 0: firstElement = geometryOutput[0] if firstElement.__class__ == list: if len(firstElement) > 1: path.convertXMLElementRenameByPaths(geometryOutput, xmlElement) else: path.convertXMLElementRename(firstElement, xmlElement) else: path.convertXMLElementRename(geometryOutput, xmlElement) path.processXMLElement(xmlElement)
def processXMLElementByGeometry(geometryOutput, xmlElement): "Process the xml element by geometryOutput." if geometryOutput == None: return geometryOutput = evaluate.getVector3ListsRecursively(geometryOutput) if 'target' in xmlElement.attributeDictionary and not evaluate.getEvaluatedBooleanDefault(False, 'copy', xmlElement): target = evaluate.getEvaluatedLinkValue(str(xmlElement.attributeDictionary['target']).strip(), xmlElement) if target.__class__.__name__ == 'XMLElement': target.removeChildrenFromIDNameParent() xmlElement = target if xmlElement.object != None: if xmlElement.parent.object != None: if xmlElement.object in xmlElement.parent.object.archivableObjects: xmlElement.parent.object.archivableObjects.remove(xmlElement.object) firstElement = None if len(geometryOutput) > 0: firstElement = geometryOutput[0] if firstElement.__class__ == list: if len(firstElement) > 1: path.convertXMLElementRenameByPaths(geometryOutput, xmlElement) else: path.convertXMLElementRename(firstElement, xmlElement) else: path.convertXMLElementRename(geometryOutput, xmlElement) path.processXMLElement(xmlElement)
def getValueByKey(self, key): 'Get value by the key.' if key in evaluate.globalElementValueDictionary: return evaluate.globalElementValueDictionary[key](self) if key in self.attributes: return evaluate.getEvaluatedLinkValue(self, self.attributes[key]) return None
def processXMLElementByFunction(manipulationFunction, xmlElement): 'Process the xml element.' if 'target' not in xmlElement.attributeDictionary: print('Warning, there was no target in processXMLElementByFunction in solid for:') print(xmlElement) return target = evaluate.getEvaluatedLinkValue(str(xmlElement.attributeDictionary['target']).strip(), xmlElement) if target.__class__.__name__ == 'XMLElement': manipulationFunction(target, xmlElement) return path.convertXMLElement(target, xmlElement) manipulationFunction(xmlElement, xmlElement)
def processElementNodeByFunction(elementNode, manipulationFunction): 'Process the xml element.' if 'target' not in elementNode.attributes: print('Warning, there was no target in processElementNodeByFunction in solid for:') print(elementNode) return target = evaluate.getEvaluatedLinkValue(elementNode, str(elementNode.attributes['target']).strip()) if target.__class__.__name__ == 'ElementNode': manipulationFunction(elementNode, target) return path.convertElementNode(elementNode, target) manipulationFunction(elementNode, elementNode)
def processXMLElementByFunction(manipulationFunction, xmlElement, xmlProcessor): "Process the xml element." if 'target' not in xmlElement.attributeDictionary: print('Warning, there was no target in processXMLElementByFunction in solid for:') print(xmlElement) return None target = evaluate.getEvaluatedLinkValue(str(xmlElement.attributeDictionary['target']).strip(), xmlElement) if target.__class__.__name__ == 'XMLElement': manipulationFunction(target, xmlElement, xmlProcessor) return lineation.processXMLElementByGeometry(target, xmlElement, xmlProcessor) manipulationFunction(xmlElement, xmlElement, xmlProcessor)
def processXMLElementByFunction(manipulationFunction, xmlElement): "Process the xml element." if "target" not in xmlElement.attributeDictionary: print("Warning, there was no target in processXMLElementByFunction in solid for:") print(xmlElement) return target = evaluate.getEvaluatedLinkValue(str(xmlElement.attributeDictionary["target"]).strip(), xmlElement) if target.__class__.__name__ == "XMLElement": manipulationFunction(target, xmlElement) return lineation.processXMLElementByGeometry(target, xmlElement) manipulationFunction(xmlElement, xmlElement)