die SVGs für Weichenkörper und Parallelweischen sind updated

This commit is contained in:
2025-07-14 14:06:59 +02:00
parent 5d015c0545
commit 72164d66cb
34 changed files with 159 additions and 455 deletions
@@ -1,4 +1,4 @@
{
{
"shapeMode": 0,
"name": "Weichenkörper Einfach 22.5° rechts M",
"family": "OFWeiche",
@@ -1,4 +1,4 @@
{
{
"shapeMode": 0,
"name": "Weichenkörper Einfach 22.5° rechts P",
"family": "OFWeiche",
@@ -1,4 +1,4 @@
{
{
"shapeMode": 0,
"name": "Weichenkörper Einfach 22.5° links P",
"family": "OFWeiche",
@@ -1,4 +1,4 @@
{
{
"shapeMode": 0,
"name": "Einfach Parallel 200/750 links M",
"family": "OFWeiche",
@@ -62,7 +62,7 @@
"zMin": "",
"zMax": "",
"zStep": "",
"direction": 360,
"direction": 360.0,
"linkClass": "Omniflo",
"label": "",
"isDimension": true
+8 -9
View File
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 484.671 1000.000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width="0.198153mm" vector-effect="non-scaling-stroke" transform="matrix(5.0466 0 0 5.0466 -2998.19 -1300.45)">
<path d="M 612.014 455.841 L 635.132 455.841" stroke-width="1px" />
<path d="M 668.741 264.265 L 690.14 273.128" stroke-width="1px" />
<path d="M 612.014 257.688 L 635.132 257.688" stroke-width="1px" />
<path d="M 623.573 257.688 L 623.573 455.841" stroke-width="1px" />
<path d="M 623.573 403.124 L 679.441 268.697" stroke-width="1px" />
<path d="M 594.101 447.346 L 623.573 455.841" stroke-width="1px" />
<svg viewBox="0 0 485.31 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g transform="matrix(5.0276 0 0 5.0276 -2986.9 -1293.7)" fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width=".19815mm" vector-effect="non-scaling-stroke">
<path d="m612.01 455.84h23.118" stroke-width="1px" />
<path d="m668.74 264.26 21.399 8.863" stroke-width="1px" />
<path d="m612.01 257.69h23.118" stroke-width="1px" />
<path d="m623.57 257.69v198.15" stroke-width="1px" />
<path d="m623.57 403.12 55.868-134.43" stroke-width="1px" />
<path d="m594.1 447.35 29.472 8.495" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 888 B

After

Width:  |  Height:  |  Size: 784 B

+8 -9
View File
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 484.671 1000.000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g fill="none" stroke="#1bff38" stroke-linecap="square" stroke-width="0.198153mm" vector-effect="non-scaling-stroke" transform="matrix(5.0466 0 0 5.0466 -2998.19 -1300.45)">
<path d="M 612.014 455.841 L 635.132 455.841" stroke-width="1px" />
<path d="M 668.741 264.265 L 690.14 273.128" stroke-width="1px" />
<path d="M 612.014 257.688 L 635.132 257.688" stroke-width="1px" />
<path d="M 623.573 257.688 L 623.573 455.841" stroke-width="1px" />
<path d="M 623.573 403.124 L 679.441 268.697" stroke-width="1px" />
<path d="M 594.101 447.346 L 623.573 455.841" stroke-width="1px" />
<svg viewBox="0 0 485.31 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g transform="matrix(5.0276 0 0 5.0276 -2986.9 -1293.7)" fill="none" stroke="#1bff38" stroke-linecap="square" stroke-width=".19815mm" vector-effect="non-scaling-stroke">
<path d="m612.01 455.84h23.118" stroke-width="1px" />
<path d="m668.74 264.26 21.399 8.863" stroke-width="1px" />
<path d="m612.01 257.69h23.118" stroke-width="1px" />
<path d="m623.57 257.69v198.15" stroke-width="1px" />
<path d="m623.57 403.12 55.868-134.43" stroke-width="1px" />
<path d="m594.1 447.35 29.472 8.495" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 888 B

After

Width:  |  Height:  |  Size: 784 B

+8 -9
View File
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 484.671 1000.000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width="0.129983mm" vector-effect="non-scaling-stroke" transform="matrix(7.6933 0 0 7.6933 -3533.68 -2850.87)">
<path d="M 495.402 500.548 L 510.567 500.548" stroke-width="1px" />
<path d="M 459.318 380.693 L 473.355 374.879" stroke-width="1px" />
<path d="M 495.402 370.565 L 510.567 370.565" stroke-width="1px" />
<path d="M 502.985 370.565 L 502.985 500.548" stroke-width="1px" />
<path d="M 466.336 377.786 L 502.985 465.967" stroke-width="1px" />
<path d="M 502.985 500.548 L 522.317 494.976" stroke-width="1px" />
<svg viewBox="0 0 485.31 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g transform="matrix(7.6643 0 0 7.6643 -3517.9 -2838.3)" fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width=".12998mm" vector-effect="non-scaling-stroke">
<path d="m495.4 500.55h15.165" stroke-width="1px" />
<path d="m459.32 380.69 14.037-5.814" stroke-width="1px" />
<path d="m495.4 370.56h15.165" stroke-width="1px" />
<path d="m502.98 370.56v129.98" stroke-width="1px" />
<path d="m466.34 377.79 36.649 88.181" stroke-width="1px" />
<path d="m502.98 500.55 19.332-5.572" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 783 B

+8 -9
View File
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 484.671 1000.000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g fill="none" stroke="#1bff38" stroke-linecap="square" stroke-width="0.129983mm" vector-effect="non-scaling-stroke" transform="matrix(7.6933 0 0 7.6933 -3533.68 -2850.87)">
<path d="M 495.402 500.548 L 510.567 500.548" stroke-width="1px" />
<path d="M 459.318 380.693 L 473.355 374.879" stroke-width="1px" />
<path d="M 495.402 370.565 L 510.567 370.565" stroke-width="1px" />
<path d="M 502.985 370.565 L 502.985 500.548" stroke-width="1px" />
<path d="M 466.336 377.786 L 502.985 465.967" stroke-width="1px" />
<path d="M 502.985 500.548 L 522.317 494.976" stroke-width="1px" />
<svg viewBox="0 0 485.31 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g transform="matrix(7.6643 0 0 7.6643 -3517.9 -2838.3)" fill="none" stroke="#1bff38" stroke-linecap="square" stroke-width=".12998mm" vector-effect="non-scaling-stroke">
<path d="m495.4 500.55h15.165" stroke-width="1px" />
<path d="m459.32 380.69 14.037-5.814" stroke-width="1px" />
<path d="m495.4 370.56h15.165" stroke-width="1px" />
<path d="m502.98 370.56v129.98" stroke-width="1px" />
<path d="m466.34 377.79 36.649 88.181" stroke-width="1px" />
<path d="m502.98 500.55 19.332-5.572" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 783 B

+13 -19
View File
@@ -1,24 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 366.218 1000.000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g fill="none" stroke="#ffe31b" stroke-linecap="square" vector-effect="non-scaling-stroke" transform="matrix(6.5411 0 0 6.5411 -3108.24 -2121.48)">
<path d="M 515.973 477.209 L 524.537 477.209" stroke-width="1px" />
</g>
<g fill="none" stroke="#ffe31b" stroke-linecap="square" vector-effect="non-scaling-stroke" transform="matrix(6.5411 0 0 6.5411 -3108.24 -2121.48)">
<path d="M 479.475 324.33 L 479.475 337.134" stroke-width="1px" />
</g>
<g fill="none" stroke="#ffe31b" stroke-linecap="square" vector-effect="non-scaling-stroke" transform="matrix(6.5411 0 0 6.5411 -3108.24 -2121.48)">
<path d="M 515.973 403.807 L 524.537 403.807" stroke-width="1px" />
</g>
<g fill="none" stroke="#ffe31b" stroke-linecap="square" vector-effect="non-scaling-stroke" transform="matrix(6.5411 0 0 6.5411 -3108.24 -2121.48)">
<path d="M479.475,337.134 A112.141,112.141 0 0,0 488.011,380.049" stroke-width="1px" />
<path d="M 488.011 380.049 L 496.672 400.958" stroke-width="1px" />
</g>
<g fill="none" stroke="#ffe31b" stroke-linecap="square" vector-effect="non-scaling-stroke" transform="matrix(6.5411 0 0 6.5411 -3108.24 -2121.48)">
<path d="M 475.185 324.33 L 483.765 324.33" stroke-width="1px" />
<path d="M 520.255 403.807 L 520.255 477.209" stroke-width="1px" />
<path d="M 496.672 400.958 L 520.255 457.892" stroke-width="1px" />
<path d="M 520.255 477.209 L 531.172 474.062" stroke-width="1px" />
<svg viewBox="0 0 368.9 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g transform="matrix(6.5164 0 0 6.5164 -3094.6 -2111.6)" fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width=".58025" vector-effect="non-scaling-stroke">
<g stroke-width=".58025">
<path d="m515.97 477.21h8.564" stroke-width="1px" />
<path d="m479.48 324.33v12.804" stroke-width="1px" />
<path d="m515.97 403.81h8.564" stroke-width="1px" />
<path d="m479.48 337.13a112.14 112.14 0 0 0 8.536 42.915" stroke-width="1px" />
<path d="m488.01 380.05 8.661 20.909" stroke-width="1px" />
<path d="m475.18 324.33h8.58" stroke-width="1px" />
<path d="m520.26 403.81v73.402" stroke-width="1px" />
<path d="m496.67 400.96 23.583 56.934" stroke-width="1px" />
</g>
<path d="m520.26 477.21 10.917-3.147" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

+1 -1
View File
@@ -12,7 +12,7 @@
<path d="m520.26 403.81v73.402" stroke-width="1px" />
<path d="m496.67 400.96 23.583 56.934" stroke-width="1px" />
</g>
<path d="m520.26 477.21 10.917-3.147" style="stroke:none;fill:none;" stroke-width="1px" />
<path d="m520.26 477.21 10.917-3.147" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

+11 -19
View File
@@ -1,24 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 366.221 1000.000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g fill="none" stroke="#ffe31b" stroke-linecap="square" vector-effect="non-scaling-stroke" transform="matrix(6.0322 0 0 6.0322 -4172.13 -1820.96)">
<path d="M 698.84 467.651 L 708.126 467.651" stroke-width="1px" />
</g>
<g fill="none" stroke="#ffe31b" stroke-linecap="square" vector-effect="non-scaling-stroke" transform="matrix(6.0322 0 0 6.0322 -4172.13 -1820.96)">
<path d="M 747.703 301.874 L 747.703 315.759" stroke-width="1px" />
</g>
<g fill="none" stroke="#ffe31b" stroke-linecap="square" vector-effect="non-scaling-stroke" transform="matrix(6.0322 0 0 6.0322 -4172.13 -1820.96)">
<path d="M 698.84 388.057 L 708.126 388.057" stroke-width="1px" />
</g>
<g fill="none" stroke="#ffe31b" stroke-linecap="square" vector-effect="non-scaling-stroke" transform="matrix(6.0322 0 0 6.0322 -4172.13 -1820.96)">
<path d="M738.447,362.294 A121.603,121.603 0 0,0 747.703,315.759" stroke-width="1px" />
<path d="M 729.055 384.967 L 738.447 362.294" stroke-width="1px" />
</g>
<g fill="none" stroke="#ffe31b" stroke-linecap="square" vector-effect="non-scaling-stroke" transform="matrix(6.0322 0 0 6.0322 -4172.13 -1820.96)">
<path d="M 743.051 301.874 L 752.355 301.874" stroke-width="1px" />
<path d="M 703.483 388.057 L 703.483 467.651" stroke-width="1px" />
<path d="M 703.483 446.705 L 729.055 384.967" stroke-width="1px" />
<path d="M 691.644 464.239 L 703.483 467.651" stroke-width="1px" />
<svg viewBox="0 0 366.73 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g transform="matrix(6.0091 0 0 6.0091 -4156.2 -1812.1)" fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-linejoin="miter" stroke-width=".62921" vector-effect="non-scaling-stroke">
<path d="m698.84 467.65h9.286" stroke-width="1px" />
<path d="m747.7 301.87v13.885" stroke-width="1px" />
<path d="m698.84 388.06h9.286" stroke-width="1px" />
<path d="m738.45 362.29a121.6 121.6 0 0 0 9.256-46.535" stroke-width="1px" />
<path d="m729.06 384.97 9.392-22.673" stroke-width="1px" />
<path d="m743.05 301.87h9.304" stroke-width="1px" />
<path d="m703.48 388.06v79.594" stroke-width="1px" />
<path d="m703.48 446.7 25.572-61.738" stroke-width="1px" />
<path d="m691.64 464.24 11.839 3.412" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1012 B

+3 -4
View File
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 368.9 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g transform="matrix(6.0067 0 0 6.0067 -4152.2 -1811.4)" fill="none" stroke="#1bff38" stroke-linecap="square" stroke-linejoin="miter" stroke-width=".62921" vector-effect="non-scaling-stroke">
<svg viewBox="0 0 366.73 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g transform="matrix(6.0091 0 0 6.0091 -4156.2 -1812.1)" fill="none" stroke="#1bff38" stroke-linecap="square" stroke-linejoin="miter" stroke-width=".62921" vector-effect="non-scaling-stroke">
<path d="m698.84 467.65h9.286" stroke-width="1px" />
<path d="m747.7 301.87v13.885" stroke-width="1px" />
<path d="m698.84 388.06h9.286" stroke-width="1px" />
@@ -11,7 +10,7 @@
<path d="m743.05 301.87h9.304" stroke-width="1px" />
<path d="m703.48 388.06v79.594" stroke-width="1px" />
<path d="m703.48 446.7 25.572-61.738" stroke-width="1px" />
<path d="m691.64 464.24 11.839 3.412" stroke-width="1px" />
<path d="m691.64 464.24 11.839 3.412" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1012 B

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 1000 538.1" preserveAspectRatio="none" position="absolute" overflow="visible">
@@ -14,8 +13,8 @@
<path d="m448.1 232.97 35.334 84.924" stroke-width="1px" />
<path d="m547.75 382.21 84.935 35.339" stroke-width="1px" />
<path d="m661.97 411.14v12.828" stroke-width="1px" />
<path d="m238.93 417.55v16.354" stroke="none" stroke-width="1px" />
<path d="m657.26 417.55v16.354" stroke="none" stroke-width="1px" />
<path d="m238.93 417.55v16.354" style="stroke:none;fill:none;" />
<path d="m657.26 417.55v16.354" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 585.36 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
@@ -13,7 +12,7 @@
<path d="m493.4 373.5v75.965" stroke-width="1px" />
<path d="m469 370.55 24.394 58.81" stroke-width="1px" />
</g>
<path d="m493.4 449.47 11.298-3.257" fill="none" stroke="none" stroke-width="1px" />
<path d="m493.4 449.47 11.298-3.257" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 1000 956.82" preserveAspectRatio="none" position="absolute" overflow="visible">
@@ -13,7 +12,7 @@
<path d="m506.59 422.16 13.602 32.789" stroke-width="1px" />
<path d="m520.19 423.28v43.07" stroke-width="1px" />
</g>
<path d="m520.19 466.35 6.406-1.846" stroke="none" stroke-width="1px" />
<path d="m520.19 466.35 6.406-1.846" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 368.9 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
@@ -13,7 +12,7 @@
<path d="m520.26 403.81v73.402" stroke-width="1px" />
<path d="m496.67 400.96 23.583 56.934" stroke-width="1px" />
</g>
<path d="m520.26 477.21 10.917-3.147" fill="none" stroke="none" stroke-width="1px" />
<path d="m520.26 477.21 10.917-3.147" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<g transform="rotate(0)">
<svg viewBox="0 0 484.671 1000.000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width="0.129983mm" vector-effect="non-scaling-stroke" transform="matrix(7.6933 0 0 7.6933 -3533.68 -2850.87)">
<path d="M 495.402 500.548 L 510.567 500.548" stroke-width="1px" />
<path d="M 459.318 380.693 L 473.355 374.879" stroke-width="1px" />
<path d="M 495.402 370.565 L 510.567 370.565" stroke-width="1px" />
<path d="M 502.985 370.565 L 502.985 500.548" stroke-width="1px" />
<path d="M 466.336 377.786 L 502.985 465.967" stroke-width="1px" />
<path d="M 502.985 500.548 L 522.317 494.976" stroke-width="1px" />
<svg viewBox="0 0 485.31 1000" preserveAspectRatio="none" position="absolute" overflow="visible">
<g transform="matrix(7.6643 0 0 7.6643 -3517.9 -2838.3)" fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width=".12998mm" vector-effect="non-scaling-stroke">
<path d="m495.4 500.55h15.165" stroke-width="1px" />
<path d="m459.32 380.69 14.037-5.814" stroke-width="1px" />
<path d="m495.4 370.56h15.165" stroke-width="1px" />
<path d="m502.98 370.56v129.98" stroke-width="1px" />
<path d="m466.34 377.79 36.649 88.181" stroke-width="1px" />
<path d="m502.98 500.55 19.332-5.572" style="stroke:none;fill:none;" />
</g>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 783 B

+9 -14
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<PROCESS Id="RDK:0001" Name="MAIN_SSG" ModernUI="True" Options="(GITSAVEMODE)(NOUPDATEINCLUDEFILES)" Expanded="True">
<PROCESSPROPERTY CrUser="pmarani [ENGMARANI17R]" CrDate="2022-05-05T18:05:31" ModUser="s.hensch [ANGEBOT-NB06]" ModDate="2025-07-02T15:38:18" LanguageVersion="2014.1.3.699" />
<PROCESSPROPERTY CrUser="pmarani [ENGMARANI17R]" CrDate="2022-05-05T18:05:31" ModUser="y.wang [ANGEBOT-NB02]" ModDate="2025-07-14T13:08:55" LanguageVersion="2014.1.3.698" />
<GROUP Id="RDK:0002" Name="Declarations" SubType="Declarations" Expanded="True">
<GROUP Id="RDK:0003" Name="Types" SubType="TypeSet" IncludeDate="0">
<GROUP Id="RDK:26387" Name="SSG_Group" SubType="TypeSet" IncludeDate="0">
@@ -90,7 +90,7 @@
<FIELD Id="RDK:22007211" Name="KurvenRichtung" Type="string" DesignTimeRemark="true, wenn eine Rechtskurve, ansonsten links" />
<FIELD Id="RDK:21700894" Name="isOk" Type="boolean" DesignTimeRemark="True beide Punkte angebunden sind und die Höhen der Nachbarn passen" />
</TYPE>
<TYPE Id="RDK:23747149" Name="TEFBogenType" Expanded="True" SubType="structure" HasArrayType="True">
<TYPE Id="RDK:23747149" Name="TEFBogenType" SubType="structure" HasArrayType="True">
<TYPE_VALUES />
<FIELD Id="RDK:23747141" Name="Beschreibung" Type="string" />
<FIELD Id="RDK:23747143" Name="Hoehe" Type="double" />
@@ -99,7 +99,7 @@
<FIELD Id="RDK:23747694" Name="innnen" Type="bool" DesignTimeRemark="wenn TRUE, dann Innen ansonsten aussen Kurve" />
<FIELD Id="RDK:23747148" Name="isOk" Type="boolean" DesignTimeRemark="True wenn es an eine Strecke angebunden ist" />
</TYPE>
<TYPE Id="RDK:23747165" Name="TEFGeradeType" Expanded="True" SubType="structure" HasArrayType="True">
<TYPE Id="RDK:23747165" Name="TEFGeradeType" SubType="structure" HasArrayType="True">
<TYPE_VALUES />
<FIELD Id="RDK:23747158" Name="Beschreibung" Type="string" />
<FIELD Id="RDK:23747159" Name="L1" Type="double" />
@@ -174,7 +174,7 @@
<FIELD Id="RDK:973716" Name="Beschreibung" Type="string" />
<FIELD Id="RDK:973714" Name="Weichenart" Type="string" />
</TYPE>
<TYPE Id="RDK:23017103" Name="OFGeradeType" Expanded="True" SubType="structure">
<TYPE Id="RDK:23017103" Name="OFGeradeType" SubType="structure">
<TYPE_VALUES />
<FIELD Id="RDK:23017087" Name="Beschreibung" Type="string" />
<FIELD Id="RDK:24227748" Name="Sivasnr" Type="string" />
@@ -23244,15 +23244,6 @@ SSGConnectionPoint.x_M
<PAR Name="aktiv">
<EXP><![CDATA[$=$IIF(me.x_M<=(Shape_Prototype.OFGeradeDefinition.L1-Shape_Prototype.OFGeradeDefinition.d_min),TRUE,FALSE)]]></EXP>
</PAR>
<PAR Name="id" />
<PAR Name="x_M" />
<PAR Name="x_S" />
<PAR Name="x" />
<PAR Name="y" />
<PAR Name="z" />
<PAR Name="direction" />
<PAR Name="linkClass" />
<PAR Name="label" />
</EXEC_ON_VALUES>
</GROUP>
</CASEGROUP>
@@ -26436,7 +26427,7 @@ SSGConnectionPoint.x_M
<EXP><![CDATA[$=$LibID]]></EXP>
<PAR Name="AdvancedOptions" />
</SET>
<SET Id="RDK:23763746" VarRef="Shape_Prototype.OFWeicheDefinition.Sivasnr">
<SET Id="RDK:23763746" VarRef="Shape_Prototype.OFWeicheDefinition.Sivasnr" Suppressed="True">
<EXP><![CDATA[$=$LibID]]></EXP>
<PAR Name="AdvancedOptions" />
</SET>
@@ -26449,6 +26440,10 @@ SSGConnectionPoint.x_M
<EXP><![CDATA[$=$OFWeicheData_defaults]]></EXP>
<PAR Name="AdvancedOptions" />
</SET>
<SET Id="RDK:24351598" VarRef="Shape_Prototype.OFWeicheDefinition.Sivasnr">
<EXP><![CDATA[$=$LibID]]></EXP>
<PAR Name="AdvancedOptions" />
</SET>
<CALLFUNCTION Id="RDK:23222250">
<PAR Name="FuncName">
<EXP><![CDATA[$C$GetOFWeicheData]]></EXP>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" space="preserve" version="1.1" viewBox="0 0 368.9 1000" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(6.0067 0 0 6.0067 -4152.2 -1811.4)" fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-linejoin="miter" stroke-width=".62921" vector-effect="non-scaling-stroke">
<svg fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" space="preserve" version="1.1" viewBox="0 0 366.73 1000" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(6.0091 0 0 6.0091 -4156.2 -1812.1)" fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-linejoin="miter" stroke-width=".62921" vector-effect="non-scaling-stroke">
<path d="m698.84 467.65h9.286"/>
<path d="m747.7 301.87v13.885"/>
<path d="m698.84 388.06h9.286"/>
@@ -9,6 +9,6 @@
<path d="m743.05 301.87h9.304"/>
<path d="m703.48 388.06v79.594"/>
<path d="m703.48 446.7 25.572-61.738"/>
<path d="m691.64 464.24 11.839 3.412"/>
<path d="m691.64 464.24 11.839 3.412" fill="none" stroke="none"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 771 B

After

Width:  |  Height:  |  Size: 798 B

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" space="preserve" version="1.1" viewBox="0 0 368.9 1000" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(6.0067 0 0 6.0067 -4152.2 -1811.4)" fill="none" stroke="#1bff38" stroke-linecap="square" stroke-linejoin="miter" stroke-width=".62921" vector-effect="non-scaling-stroke">
<svg fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" space="preserve" version="1.1" viewBox="0 0 366.73 1000" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(6.0091 0 0 6.0091 -4156.2 -1812.1)" fill="none" stroke="#1bff38" stroke-linecap="square" stroke-linejoin="miter" stroke-width=".62921" vector-effect="non-scaling-stroke">
<path d="m698.84 467.65h9.286"/>
<path d="m747.7 301.87v13.885"/>
<path d="m698.84 388.06h9.286"/>
@@ -9,6 +9,6 @@
<path d="m743.05 301.87h9.304"/>
<path d="m703.48 388.06v79.594"/>
<path d="m703.48 446.7 25.572-61.738"/>
<path d="m691.64 464.24 11.839 3.412"/>
<path d="m691.64 464.24 11.839 3.412" fill="none" stroke="none"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 771 B

After

Width:  |  Height:  |  Size: 798 B

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 484.671 1000.000" version="1.1" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" width="484.671" height="1000.000" space="preserve" xmlns="http://www.w3.org/2000/svg">
<g fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width="0.129983mm" vector-effect="non-scaling-stroke" transform="matrix(7.6933 0 0 7.6933 -3533.68 -2850.87)">
<path d="M 495.402 500.548 L 510.567 500.548" />
<path d="M 459.318 380.693 L 473.355 374.879" />
<path d="M 495.402 370.565 L 510.567 370.565" />
<path d="M 502.985 370.565 L 502.985 500.548" />
<path d="M 466.336 377.786 L 502.985 465.967" />
<path d="M 502.985 500.548 L 522.317 494.976" />
</g>
<svg fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" space="preserve" version="1.1" viewBox="0 0 485.31 1000" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(7.6643 0 0 7.6643 -3517.9 -2838.3)" fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width=".12998mm" vector-effect="non-scaling-stroke">
<path d="m495.4 500.55h15.165"/>
<path d="m459.32 380.69 14.037-5.814"/>
<path d="m495.4 370.56h15.165"/>
<path d="m502.98 370.56v129.98"/>
<path d="m466.34 377.79 36.649 88.181"/>
<path d="m502.98 500.55 19.332-5.572" fill="none" stroke="none"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 647 B

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 484.671 1000.000" version="1.1" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" width="484.671" height="1000.000" space="preserve" xmlns="http://www.w3.org/2000/svg">
<g fill="none" stroke="#1bff38" stroke-linecap="square" stroke-width="0.129983mm" vector-effect="non-scaling-stroke" transform="matrix(7.6933 0 0 7.6933 -3533.68 -2850.87)">
<path d="M 495.402 500.548 L 510.567 500.548" />
<path d="M 459.318 380.693 L 473.355 374.879" />
<path d="M 495.402 370.565 L 510.567 370.565" />
<path d="M 502.985 370.565 L 502.985 500.548" />
<path d="M 466.336 377.786 L 502.985 465.967" />
<path d="M 502.985 500.548 L 522.317 494.976" />
</g>
<svg fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" space="preserve" version="1.1" viewBox="0 0 485.31 1000" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(7.6643 0 0 7.6643 -3517.9 -2838.3)" fill="none" stroke="#1bff38" stroke-linecap="square" stroke-width=".12998mm" vector-effect="non-scaling-stroke">
<path d="m495.4 500.55h15.165"/>
<path d="m459.32 380.69 14.037-5.814"/>
<path d="m495.4 370.56h15.165"/>
<path d="m502.98 370.56v129.98"/>
<path d="m466.34 377.79 36.649 88.181"/>
<path d="m502.98 500.55 19.332-5.572" fill="none" stroke="none"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 647 B

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 484.671 1000.000" version="1.1" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" width="484.671" height="1000.000" space="preserve" xmlns="http://www.w3.org/2000/svg">
<g fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width="0.198153mm" vector-effect="non-scaling-stroke" transform="matrix(5.0466 0 0 5.0466 -2998.19 -1300.45)">
<path d="M 612.014 455.841 L 635.132 455.841" />
<path d="M 668.741 264.265 L 690.14 273.128" />
<path d="M 612.014 257.688 L 635.132 257.688" />
<path d="M 623.573 257.688 L 623.573 455.841" />
<path d="M 623.573 403.124 L 679.441 268.697" />
<path d="M 594.101 447.346 L 623.573 455.841" />
</g>
<svg fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" space="preserve" version="1.1" viewBox="0 0 485.31 1000" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(5.0276 0 0 5.0276 -2986.9 -1293.7)" fill="none" stroke="#ffe31b" stroke-linecap="square" stroke-width=".19815mm" vector-effect="non-scaling-stroke">
<path d="m612.01 455.84h23.118"/>
<path d="m668.74 264.26 21.399 8.863"/>
<path d="m612.01 257.69h23.118"/>
<path d="m623.57 257.69v198.15"/>
<path d="m623.57 403.12 55.868-134.43"/>
<path d="m594.1 447.35 29.472 8.495" fill="none" stroke="none"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 722 B

After

Width:  |  Height:  |  Size: 648 B

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 484.671 1000.000" version="1.1" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" width="484.671" height="1000.000" space="preserve" xmlns="http://www.w3.org/2000/svg">
<g fill="none" stroke="#1bff38" stroke-linecap="square" stroke-width="0.198153mm" vector-effect="non-scaling-stroke" transform="matrix(5.0466 0 0 5.0466 -2998.19 -1300.45)">
<path d="M 612.014 455.841 L 635.132 455.841" />
<path d="M 668.741 264.265 L 690.14 273.128" />
<path d="M 612.014 257.688 L 635.132 257.688" />
<path d="M 623.573 257.688 L 623.573 455.841" />
<path d="M 623.573 403.124 L 679.441 268.697" />
<path d="M 594.101 447.346 L 623.573 455.841" />
</g>
<svg fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" space="preserve" version="1.1" viewBox="0 0 485.31 1000" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(5.0276 0 0 5.0276 -2986.9 -1293.7)" fill="none" stroke="#1bff38" stroke-linecap="square" stroke-width=".19815mm" vector-effect="non-scaling-stroke">
<path d="m612.01 455.84h23.118"/>
<path d="m668.74 264.26 21.399 8.863"/>
<path d="m612.01 257.69h23.118"/>
<path d="m623.57 257.69v198.15"/>
<path d="m623.57 403.12 55.868-134.43"/>
<path d="m594.1 447.35 29.472 8.495" fill="none" stroke="none"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 722 B

After

Width:  |  Height:  |  Size: 648 B

+3 -2
View File
@@ -13,8 +13,9 @@ if %ERRORLEVEL% neq 0 (
:: Run the Python script
echo Running SVG optimizer...
python %RD_CONF_LIB%\3_svg_optimizer-Step1.py %*
python %RD_CONF_LIB%\3_svg_optimizer_Step1.py %*
python %RD_CONF_LIB%\3_svg_scaler_Step2.py %*
python %RD_CONF_LIB%\3_svg_scaler_Step3.py %*
:: Check if Python script succeeded
if %ERRORLEVEL% equ 0 (
echo SVG optimization completed successfully
+3 -2
View File
@@ -35,8 +35,9 @@ if %ERRORLEVEL% equ 3 set "arg=--weichen"
if %ERRORLEVEL% equ 4 set "arg=--tefweichen"
REM Execute Python script with selected argument
python "%RD_CONF_LIB%\3_svg_optimizer-Step1.py" %arg%
python %RD_CONF_LIB%\3_svg_optimizer_Step1.py %*
python %RD_CONF_LIB%\3_svg_scaler_Step2.py %*
python %RD_CONF_LIB%\3_svg_scaler_Step3.py %*
REM Check execution status
if %ERRORLEVEL% equ 0 (
echo SVG optimization completed successfully!
+3 -1
View File
@@ -6,11 +6,13 @@ set RD_CONF=%cd%
set RD_CONF_BIN=%RD_CONF%\bin
set RD_CONF_CFG=%RD_CONF%\cfg
set RD_CONF_WORK=%RD_CONF%\work
set RD_CONF_OUTPUT=%RD_CONF%\Weichen\outputdir
set RD_CONF_LIB=%RD_CONF%\lib
set RD_CONF_BOGEN=%RD_CONF%\Bogen
set RD_CONF_TEFBOGEN=%RD_CONF%\TEFBogen
set RD_CONF_WEICHEN=%RD_CONF%\Weichen\neu_backup
set RD_CONF_WEICHEN=%RD_CONF%\Weichen\neu_original_backup
set RD_CONF_TEFWEICHEN=%RD_CONF%\TEFWeichen
+17 -1
View File
@@ -3,13 +3,29 @@
für die Umsetzung der 2D-Library im Rule Designer sind folgende Schritte vorgesehen unterteilt in TXT und SVG:
**TXT-Daten:**
**PROPS-TXT-Daten:**
1. JSON-Struktur vorbereiten: inkl. Gesamtbreite, Gesamthöhe sowie Breite und Höhe der Mittellinie.
2. CPs (Connection Points): Richtung und Position der CPs berechnen.
3. Daten aus JSON in der lokalen RD-Installation als Props importieren.
**Props-Bearbeitung:**
1. Führe run_OFWeiche.bat im Ordner OFWeiche aus.
2. Kopiere den Ordner SSG erneut in den Git-Ordner.
3. Führe git push aus.
**SVG-Daten:**
1. DWG-Dateien exportieren und in SVG umwandeln.
2. SVG optimieren: z.B. Polylinien in einfache Linien umwandeln.
3. Viewbox im SVG definieren, um saubere Skalierung zu gewährleisten.
4. Aus dem SVG Symbol generieren.
**SVG-Bearbeitung:**
1. Führe optimize_easy.bat im Ordner SSG-Ruledesigner-Konfigurator\SVGs\Omniflo\bin aus, um die SVGs vorzubereiten.
2. Bearbeite die SVGs im Ordner outputdir manuell in Inkscape : Passe den viewbox an und entferne Hilfslinien (füge fill:none, stroke:none hinzu) bei Einfachweichen und Deltaweichen.
3. Kopiere die bearbeiteten Dateien in outputdir_kopie, um pneumatische Weichen-SVGs zu erstellen.
4. Füge die SVGs manuell im 2D-Wizard hinzu.
5. Führe 6_update_XML_Strich_WK.py im Ordner OFWeiche aus, um Hilfslinien erneut zu deaktivieren.
6. Kopiere den Ordner SSG aus C:\Program Files\RuleDesigner\...\Editor2D in den Git-Ordner Editor2DLibrary.
7. Führe git push aus.
@@ -153,6 +153,6 @@ def batch_process_svg(input_dir: str, output_dir: str):
print("\nAll files processed successfully!")
if __name__ == '__main__':
input_dir = r'C:\Users\y.wang\Documents\SSG-Ruledesigner-Konfigurator\SVGs\Omniflo\work'
output_dir = r'C:\Users\y.wang\Documents\SSG-Ruledesigner-Konfigurator\SVGs\Omniflo\Weichen'
input_dir = os.environ.get('RD_CONF_WORK')
output_dir = os.environ.get('RD_CONF_WORK')
batch_process_svg(input_dir, output_dir)
@@ -154,7 +154,7 @@ def batch_process_svgs(input_dir: str, output_dir: str):
print(f"\nCompleted: {success_count} files processed")
if __name__ == '__main__':
input_dir = r'C:\Users\y.wang\Documents\SSG-Ruledesigner-Konfigurator\SVGs\Omniflo\Weichen'
output_dir = r'C:\Users\y.wang\Documents\SSG-Ruledesigner-Konfigurator\SVGs\Omniflo\Weichen\outputdir'
input_dir = os.environ.get('RD_CONF_WORK')
output_dir = os.environ.get('RD_CONF_OUTPUT')
# Example usage:
batch_process_svgs(input_dir, output_dir)
@@ -1,125 +0,0 @@
import os
import json
import re
import shutil
def extract_sivasnr_from_svg(filename):
"""
Extracts the sivasnr (numeric ID) from the SVG filename.
Example: "DeltaWeiche_1400_700_M_834372400.svg" "834372400"
"""
match = re.search(r'_(\d+)\.svg$', filename)
return match.group(1) if match else None
def convert_svg_to_xml(svg_path, output_folder):
"""
Converts an SVG file to an XML file (renames it) and saves it in `output_folder`.
Returns the relative path in the format: "SSG/shapes/svg/{sivasnr}.xml"
"""
os.makedirs(output_folder, exist_ok=True)
sivasnr = extract_sivasnr_from_svg(os.path.basename(svg_path))
if not sivasnr:
raise ValueError(f"Could not extract sivasnr from SVG: {svg_path}")
xml_filename = f"{sivasnr}.xml"
xml_relative_path = f"SSG/shapes/svg/{xml_filename}" # Format: "SSG/shapes/svg/834372400.xml"
xml_abs_path = os.path.join(output_folder, xml_filename)
# Copy SVG to XML (same content, just renamed)
shutil.copy2(svg_path, xml_abs_path)
return xml_relative_path # Return the relative path for TXT file
def update_txt_srcsvg(txt_path, new_srcsvg_value):
"""
Updates the "srcSVG" field in a TXT file with the relative path.
Format: "SSG/shapes/svg/{sivasnr}.xml"
"""
try:
with open(txt_path, 'r', encoding='utf-8') as f:
data = json.load(f)
data["srcSVG"] = new_srcsvg_value # Write the relative path
with open(txt_path, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=4, ensure_ascii=False)
return True
except Exception as e:
print(f"❌ Failed to update {txt_path}: {str(e)}")
return False
def process_svg_files(svg_folder, prorps_folder, output_folder="shapes/svg"):
"""
Processes all SVG files:
1. Extracts sivasnr.
2. Converts SVG to XML in `output_folder`.
3. Updates the TXT file with "SSG/shapes/svg/{sivasnr}.xml".
"""
if not os.path.exists(svg_folder):
print(f"❌ Error: SVG folder not found: {svg_folder}")
return
if not os.path.exists(prorps_folder):
print(f"❌ Error: Prorps folder not found: {prorps_folder}")
return
os.makedirs(output_folder, exist_ok=True)
svg_files = [f for f in os.listdir(svg_folder) if f.endswith('.svg')]
total_files = len(svg_files)
success_count = 0
failed_count = 0
print(f"\n🔍 Found {total_files} SVG files in: {svg_folder}")
print(f"📂 TXT files will be read from: {prorps_folder}")
print(f"💾 XML files will be saved to: {output_folder}\n")
for svg_filename in svg_files:
svg_path = os.path.join(svg_folder, svg_filename)
sivasnr = extract_sivasnr_from_svg(svg_filename)
if not sivasnr:
print(f"❌ Skipping {svg_filename}: Could not extract sivasnr.")
failed_count += 1
continue
print(f"🔄 Processing: {svg_filename} (sivasnr={sivasnr})")
try:
# Step 1: Convert SVG to XML and get relative path
xml_relative_path = convert_svg_to_xml(svg_path, output_folder)
print(f" ✅ Converted to XML: {xml_relative_path}")
# Step 2: Update TXT file with relative path
txt_path = os.path.join(prorps_folder, f"{sivasnr}.txt")
if not os.path.exists(txt_path):
print(f" ❌ TXT file not found: {os.path.basename(txt_path)}")
failed_count += 1
continue
if update_txt_srcsvg(txt_path, xml_relative_path):
print(f" ✅ Updated TXT: {os.path.basename(txt_path)}")
success_count += 1
else:
failed_count += 1
except Exception as e:
print(f" ❌ Error processing {svg_filename}: {str(e)}")
failed_count += 1
# Print summary
print("\n📊 Processing Summary:")
print(f" - Total SVG files: {total_files}")
print(f" - Successfully processed: {success_count}")
print(f" - Failed: {failed_count}")
if total_files > 0:
print(f" - Success rate: {(success_count / total_files) * 100:.2f}%")
if __name__ == "__main__":
# Configuration - modify these paths as needed
SVG_FOLDER = r"C:\Users\y.wang\Documents\SSG-Ruledesigner-Konfigurator\SVGs\Omniflo\Weichen\outputdir" # Folder containing SVG files
PRORPS_FOLDER = r"C:\Program Files\RuleDesigner\RDConfigurator Fusion\WebApi\Editor2D\SSG\shapes\props" # Folder containing txt files
OUTPUT_FOLDER = r"C:\Program Files\RuleDesigner\RDConfigurator Fusion\WebApi\Editor2D\SSG\shapes\svg"
# Start processing
process_svg_files(SVG_FOLDER, PRORPS_FOLDER, OUTPUT_FOLDER)
print("\nProcessing complete.")
@@ -1,150 +0,0 @@
"""
SVG XML Batch Modifier Script
This script:
1. Reads a JSON array of items
2. For each item, extracts the "Sivasnr" value
3. Locates and modifies the corresponding XML file
4. Provides comprehensive reporting
"""
import json
import os
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import Element, SubElement, tostring
def process_xml_file(xml_path):
"""
Process a single XML file with proper namespace handling
Returns modification statistics
"""
try:
tree = ET.parse(xml_path)
root = tree.getroot()
# Register and handle SVG namespace
ET.register_namespace('', 'http://www.w3.org/2000/svg')
namespaces = {'svg': 'http://www.w3.org/2000/svg'}
stats = {
'ffe31b_groups': 0,
'ec2525_groups': 0,
'elements_modified': 0,
'modified': False
}
# Process all group elements
for g in root.findall('.//svg:g', namespaces):
stroke = g.get('stroke')
if stroke == "#ffe31b":
stats['ffe31b_groups'] += 1
if 'stroke-width' in g.attrib:
del g.attrib['stroke-width']
stats['modified'] = True
if 'stroke-miterlimit' in g.attrib:
del g.attrib['stroke-miterlimit']
stats['modified'] = True
for child in g.findall('.//svg:path', namespaces):
child.set('stroke-width', '1px')
stats['elements_modified'] += 1
stats['modified'] = True
elif stroke == "#ec2525":
stats['ec2525_groups'] += 1
for attr in ['stroke', 'stroke-width', 'stroke-linejoin']:
if attr in g.attrib:
del g.attrib[attr]
stats['modified'] = True
for child in g.findall('.//svg:path[@stroke-width="1px"]', namespaces):
del child.attrib['stroke-width']
child.set('style', 'stroke:#ec2525;stroke-width:2px')
stats['elements_modified'] += 1
stats['modified'] = True
# Save changes if modified
if stats['modified']:
xml_str = ET.tostring(root, encoding='unicode')
xml_str = xml_str.replace('><', '>\n<').replace('</svg>', '\n</svg>')
with open(xml_path, 'w', encoding='utf-8') as f:
f.write(xml_str)
return stats
except Exception as e:
print(f" Error processing file: {str(e)}")
return None
def main():
"""
Main processing function
"""
json_path=os.environ.get("JSON_PATH","JSON")
json_file_path = os.path.join(json_path,"omniflo_weichen_output.json")
svg_folder_path = os.environ.get("XML_PATH","svg")
try:
# Read and parse JSON file
with open(json_file_path, 'r', encoding='utf-8') as f:
data = json.load(f)
# Verify we have a list of items
if not isinstance(data, list):
print("Error: JSON data should be an array of items")
return
print(f"\nFound {len(data)} items in JSON file")
# Process each item in the JSON array
for index, item in enumerate(data, 1):
if not isinstance(item, dict):
print(f"\nItem {index}: Not a dictionary, skipping")
continue
sivasnr = item.get("Sivasnr")
if not sivasnr:
print(f"\nItem {index}: Missing 'Sivasnr' value, skipping")
continue
print(f"\nProcessing item {index}: Sivasnr = {sivasnr}")
# Build XML filename and path
xml_filename = f"{sivasnr}.xml"
xml_path = os.path.join(svg_folder_path, xml_filename)
if not os.path.exists(xml_path):
print(f" XML file not found: {xml_path}")
continue
print(f" Found XML file: {xml_path}")
# Process the XML file
stats = process_xml_file(xml_path)
if stats is None:
print(" Processing failed")
elif stats['modified']:
print(" File successfully modified")
print(f" - #ffe31b groups: {stats['ffe31b_groups']}")
print(f" - #ec2525 groups: {stats['ec2525_groups']}")
print(f" - Elements modified: {stats['elements_modified']}")
else:
print(" No modifications needed")
print("\nProcessing complete")
except FileNotFoundError:
print("\nError: JSON file not found")
except json.JSONDecodeError:
print("\nError: Invalid JSON format")
except Exception as e:
print(f"\nUnexpected error: {str(e)}")
if __name__ == "__main__":
print("SVG XML Batch Modifier - Starting execution")
main()
@@ -1,12 +0,0 @@
@echo off
set OFWeiche_PATH=%~dp0
set XML_PATH=C:\Program Files\RuleDesigner\RDConfigurator Fusion\WebApi\Editor2D\SSG\shapes\svg
set JSON_PATH=%OFWeiche_PATH%JSON
python 5_OFWeiche_SVG_XML_Modifier_Script.py
pause