External Python Editor

This add-on enables the editing of python scripts inside Python Script and Process Handler behaviors in an external editor. The script is opened in an editor associated with .py files in the OS. The add-on supports VC 4.2 Professional/Premium only.

A right-click context menu is added for opening and disabling external script:
image

External script files are created in the system’s temp folder and monitored for changes. Whenever the external script is saved, it is compiled in VC. In case the simulation is running, compiling will be executed once the simulation is reset, similar to the internal editor. Script files in the temp folder are garbage collected once the component or behavior is deleted in VC. Renaming the external script file or the behavior is allowed. Relocating the script file is not supported.

The external script is automatically disabled when the VC internal editor is opened for editing the same script. After closing the internal editor, a prompt is displayed if the script contents differ:
image

The external script can be manually disabled from the right-click context menu.

Disclaimer: Debug features such as breakpoints and tracing are not possible with any external editor. But the VC internal editor can be used when necessary. Also, the autocompletion of VC API is not provided.

Install by placing the .dll inside Visual Components installation folder e.g. “C:\Program Files\Visual Components\Visual Components Premium 4.2” (administration rights required). Relaunch if VC is running.

VC 4.2 :
UPDATE (14/12/2020, version 1.0.3):
Fixed crash when a component or a behavior name contained invalid filename characters.
Plugin.ExternalPyEditor_1.0.3.zip (8.3 KB)

4 Likes

this is awesome hi’ve been looking for a long time for a plugin like this. Thanks! :+1:

2 Likes

Hello there!

Good News: in the latest version of VC an external Code Editor can be used by default.

Unfortunately there still is no autocompletion since vcScript import could not be resolved.
Maybe one of you guys has a solution or workaround for this problem?

Thank you

1 Like

When I was using Plugin.ExternalPyEditor, I encountered the error in the screenshot. I tried to replace the plug-in, reinstall Pycharm, delete cached data and other methods, but the problem couldn’t be solved. Can anyone tell me how to deal with it? (Note: It was used normally the day before, I do not know what operation caused it.)

Do you have software such as translation software running? This may cause errors in writing Python scripts.

I did not run the translation software, I also tried to close the irrelevant software, but this error still occurs.

Problem solved, I uninstall the current 2023 version of Pycharm and reinstall the 2020 version. Thank you very much!