diff --git a/pyaedt/maxwell.py b/pyaedt/maxwell.py index 99a61115fe3..88553f1486b 100644 --- a/pyaedt/maxwell.py +++ b/pyaedt/maxwell.py @@ -1007,7 +1007,12 @@ def assign_voltage(self, assignment, amplitude=1, name=None): else: props = OrderedDict({"Faces": assignment, "Value": amplitude}) else: - props = OrderedDict({"Faces": assignment, "Voltage": amplitude}) + props = OrderedDict({"Faces": [], "Objects": [], "Voltage": amplitude}) + for element in assignment: + if isinstance(element, str) and element in self.modeler.object_names: + props["Objects"].append(element) + else: + props["Faces"].append(element) bound = BoundaryObject(self, name, props, "Voltage") if bound.create(): self._boundaries[bound.name] = bound