diff --git a/onshape_to_robot/onshape_to_robot.py b/onshape_to_robot/onshape_to_robot.py index b84d4cd..86adad3 100644 --- a/onshape_to_robot/onshape_to_robot.py +++ b/onshape_to_robot/onshape_to_robot.py @@ -51,8 +51,14 @@ def partIsIgnore(name): # Adds a part to the current robot link + def renamePart(name): + """Remove special characters from part names.""" + return name.replace('"', "in").replace("'", "ft") + def addPart(occurrence, matrix): part = occurrence['instance'] + part['name'] = renamePart(part['name']) + part['configuration'] = renamePart(part['configuration']) if part['suppressed']: return