ScriptSpot

Forum topic · General Scripting

Script to remove Quotation Marks from Object Names

By dmhokie · 2017-06-30

Description

Does anyone know of a way or a script to automatically remove quotation marks from a bunch of objects? Many objects that come from Revit are name something like 8" CMU. Using the batch UE4 FBX exporter exports objects based on their name. But you cannot name a file with a quotation mark in it. Is there any way to search the scene and remove just the " and ' from the names without manually doing it?

Comments (3)

fajar · 2017-07-03

theres a way to that problem, its already answered by Barigazy sometimes ago, maybe you could trace it in this forum

`

pixamoon · 2017-07-03

Hi,

I think you can use just:


for o in objects do (
	o.name = substituteString o.name "\"" ""
	o.name = substituteString o.name "'" ""
)

or for selection only


for o in selection do (
	o.name = substituteString o.name "\"" ""
	o.name = substituteString o.name "'" ""
)

Best,
Pixamoon

dmhokie · 2017-07-05

That is perfect! Thank you. You have saved me a ton of time now.