Python script get proxy name

Hello,

In ParaView 5.5.2, I saved the Save State as a py file, but found that the proxy name was not saved. How can I save the name?

Best regards.

Hmm, that’s an interesting request. The variables that hold references to various sources are based off the names of the sources, but I assume that’s not sufficient. There isn’t a way to write out the proxy names when you save the state in Python, but you can retrieve the source name with

sources = GetSources()
sources.keys()[sources.values().index(s)][0]

where s is a source of interst.

Thank you very much for your help, thank you!
If I want to create a Sphere in Python code, can I specify the proxy name when I create sphere? Instead of renaming it after creation is done like this:

Cone = Cone()
RenameSource(“AAA”, cone)

Thank you!

Yes, it is possible.

cone = Cone(registrationName="AAA")

Hello! Thank you very much for your reply!

When ParaView was designed, did you consider internationalization to support multiple languages? I need to support Chinese now, but the project can’t generate Qt .ts file; when the Proxy Name is Chinese, save state generates pvsm file without any problem, but the py file will generate an error.
So, does ParaView have a special handling solution?

thank you very much!

Sadly, this would require a great amount of work. See here for more info :