Skip to content

Commit 7bc7b8a

Browse files
committed
add HPGL/2 viewer example script and sample plot files
1 parent c74e49a commit 7bc7b8a

File tree

5 files changed

+65
-1
lines changed

5 files changed

+65
-1
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ tox-all.ini
2929
/examples_dxf/insert_nesting_level_1.dxf
3030
/examples_dxf/mtext_simple_all_alignments.dxf
3131
/src/mypy-reports/
32-
/examples_hpgl2
32+
/examples_hpgl2_private
3333
/fonts/shapefiles
3434
/fonts/*.json

examples/addons/hpgl2_viewer.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2023, Manfred Moitzi
2+
# License: MIT License
3+
from __future__ import annotations
4+
try:
5+
from ezdxf.addons.xqt import QtWidgets
6+
except ImportError as e:
7+
print(str(e))
8+
exit(1)
9+
import sys
10+
import pathlib
11+
import signal
12+
from ezdxf.addons.hpgl2.viewer import HPGL2Viewer
13+
14+
HPGL2_EXAMPLES = pathlib.Path(__file__).parent.parent.parent / "examples_hpgl2"
15+
16+
17+
def main():
18+
signal.signal(signal.SIGINT, signal.SIG_DFL) # handle Ctrl+C properly
19+
app = QtWidgets.QApplication(sys.argv)
20+
viewer = HPGL2Viewer()
21+
viewer.load_plot_file(HPGL2_EXAMPLES / "BF_ISO.plt")
22+
sys.exit(app.exec())
23+
24+
25+
if __name__ == '__main__':
26+
main()

examples_hpgl2/BF_ISO.plt

+11
Large diffs are not rendered by default.

examples_hpgl2/GB01_Stahlbau.plt

+23
Large diffs are not rendered by default.

examples_hpgl2/HSG_ISO.plt

+4
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)