Last active
November 25, 2017 16:04
-
-
Save AlexArcPy/acf6cef798d55a326664b2fbca80e418 to your computer and use it in GitHub Desktop.
Basic PyQt5 application to run in ArcGIS Pro custom script tool: running in the thread of Pro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import arcpy | |
from PyQt5.QtWidgets import (QMainWindow, QLabel, QApplication) | |
from PyQt5.QtCore import Qt | |
class MainWindow(QMainWindow): | |
def __init__(self, *args, **kwargs): | |
super(MainWindow, self).__init__(*args, **kwargs) | |
self.setWindowTitle("Basic App") | |
project = arcpy.mp.ArcGISProject('current') | |
label = QLabel("The document version of the open project is {}".format( | |
project.documentVersion)) | |
label.setAlignment(Qt.AlignCenter) | |
self.setCentralWidget(label) | |
if __name__ == '__main__': | |
app = QApplication(sys.argv) | |
ex = MainWindow() | |
ex.show() | |
sys.exit(app.exec_()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment