Commits

Manfred Moitzi committed 14099cf

completed RangingRebars.smt

Comments (0)

Files changed (5)

RangingRebars.smt

-<?xml version="1.0" encoding="UTF-8"?><ScriptObject><Version>1.0</Version>
+<?xml version="1.0" encoding="UTF-8"?>
+<ScriptObject><Version>1.0</Version>
 <ScriptVersion>1.0</ScriptVersion>
 <Name><![CDATA[RangingRebars]]></Name>
 <LibPath><![CDATA[]]></LibPath>
 <Type>1</Type>
 <SubType>0</SubType>
-<UUID>b03f7c20-889a-4bb4-9828-578a2cbfe944</UUID>
+<UUID>ebe9d693-a633-46e8-acd3-d636328e71c9</UUID>
 <Language>de</Language>
 <StringTable>
 </StringTable>
 <SeparateExecParts>1</SeparateExecParts>
 <Group>0</Group>
 <AutoPlaceResourceObjects>1</AutoPlaceResourceObjects>
-<AutoReferenceBox>0</AutoReferenceBox>
+<AutoReferenceBox>1</AutoReferenceBox>
 <Scale>1</Scale>
 <Use3DPreview>0</Use3DPreview>
 <Link>0</Link>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue/>
+<StringValue></StringValue>
 <DoubleValue>0.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 <Values>
 <Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>0.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>-0.194595749999</DoubleValue>
 </Value>
 <Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>1.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>2.805404250001</DoubleValue>
 </Value>
 <Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>1.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>3.805404250001</DoubleValue>
 </Value>
 <Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>0.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>-1.194595749999</DoubleValue>
 </Value>
 <Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>0.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>-0.019425708333</DoubleValue>
 </Value>
 <Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>0.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>-0.019425708333</DoubleValue>
 </Value>
 <Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>1.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>4.980574291667</DoubleValue>
 </Value>
 <Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>1.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>4.980574291667</DoubleValue>
 </Value>
 </Values>
 </ValueArray>
 </Parameter>
 <Parameter>
-<Identifier>cut_line_end_pos</Identifier>
-<Name><![CDATA[Endposition]]></Name>
-<Group><![CDATA[]]></Group>
-<Type>1</Type>
-<Attribute>-1</Attribute>
-<SystemID>0</SystemID>
-<Expandable>0</Expandable>
-<Hidden>0</Hidden>
-<Lock>0</Lock>
-<Export>0</Export>
-<Save>1</Save>
-<CurrentValue>
-<Value>
-<Type>6</Type>
-<StringValue/>
-<DoubleValue>0.500000000000</DoubleValue>
-</Value>
-</CurrentValue>
-</Parameter>
-<Parameter>
 <Identifier>layer0</Identifier>
 <Name><![CDATA[Layer]]></Name>
 <Group><![CDATA[]]></Group>
 <Save>1</Save>
 <CurrentValue>
 <Value>
-<Type>5</Type>
-<StringValue/>
-<DoubleValue>0.000000000000</DoubleValue>
+<Type>6</Type>
+<StringValue></StringValue>
+<DoubleValue>3864.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 </Parameter>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue/>
+<StringValue></StringValue>
 <DoubleValue>7.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 <CurrentValue>
 <Value>
 <Type>5</Type>
-<StringValue/>
-<DoubleValue>2.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>28.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 </Parameter>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>1.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>0.500000000000</DoubleValue>
 </Value>
 </CurrentValue>
 </Parameter>
 <Save>1</Save>
 <CurrentValue>
 <Value>
-<Type>5</Type>
-<StringValue/>
-<DoubleValue>1.000000000000</DoubleValue>
-</Value>
-</CurrentValue>
-</Parameter>
-<Parameter>
-<Identifier>rebar_pitch</Identifier>
-<Name><![CDATA[Stababstand]]></Name>
-<Group><![CDATA[]]></Group>
-<Type>1</Type>
-<Attribute>-1</Attribute>
-<SystemID>0</SystemID>
-<Expandable>0</Expandable>
-<Hidden>0</Hidden>
-<Lock>0</Lock>
-<Export>0</Export>
-<Save>1</Save>
-<CurrentValue>
-<Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>0.000000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>3.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 </Parameter>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue/>
+<StringValue></StringValue>
 <DoubleValue>1.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue/>
+<StringValue></StringValue>
 <DoubleValue>1.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue/>
+<StringValue></StringValue>
 <DoubleValue>1.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue/>
+<StringValue></StringValue>
 <DoubleValue>1.000000000000</DoubleValue>
 </Value>
 </CurrentValue>
 </Parameter>
 <Parameter>
-<Identifier>cut_line_start_pos</Identifier>
-<Name><![CDATA[Startposition]]></Name>
+<Identifier>show_construction_lines</Identifier>
+<Name><![CDATA[zeige Hilfslinien]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>4</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>4</Type>
+<StringValue></StringValue>
+<DoubleValue>1.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>show_table</Identifier>
+<Name><![CDATA[zeige Wertetabelle]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>4</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>4</Type>
+<StringValue></StringValue>
+<DoubleValue>0.000000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>table_char_height</Identifier>
+<Name><![CDATA[Tabellentexth�he]]></Name>
 <Group><![CDATA[]]></Group>
 <Type>1</Type>
 <Attribute>-1</Attribute>
 <CurrentValue>
 <Value>
 <Type>6</Type>
-<StringValue/>
-<DoubleValue>0.500000000000</DoubleValue>
+<StringValue></StringValue>
+<DoubleValue>1.500000000000</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>table_pos_x</Identifier>
+<Name><![CDATA[Wertetabelle-X]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>6</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue></StringValue>
+<DoubleValue>4.206249431868</DoubleValue>
+</Value>
+</CurrentValue>
+</Parameter>
+<Parameter>
+<Identifier>table_pos_y</Identifier>
+<Name><![CDATA[Wertetabelle-Y]]></Name>
+<Group><![CDATA[]]></Group>
+<Type>6</Type>
+<Attribute>-1</Attribute>
+<SystemID>0</SystemID>
+<Expandable>0</Expandable>
+<Hidden>0</Hidden>
+<Lock>0</Lock>
+<Export>0</Export>
+<Save>1</Save>
+<CurrentValue>
+<Value>
+<Type>6</Type>
+<StringValue></StringValue>
+<DoubleValue>4.735477456467</DoubleValue>
 </Value>
 </CurrentValue>
 </Parameter>
 ! (c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
 ! License: GPLv3, www.fsf.org
 
-
-
-start_length = SQR( (defpoints[1][1]-defpoints[4][1])^2 + (defpoints[1][2]-defpoints[4][2])^2 )
-end_length = SQR( (defpoints[2][1]-defpoints[3][1])^2 + (defpoints[2][2]-defpoints[3][2])^2 )
-
 VALUES "rebar_count" RANGE [2, ) STEP 2, 1
-VALUES "cut_line_start_pos" RANGE [0, start_length]
-VALUES "cut_line_end_pos" RANGE [0, end_length]]]></Text>
+]]></Text>
 </PartParameter>
 <PartMaster>
 <Enable>1</Enable>
 
 
 
+
 !--- definitions
 spaces = rebar_count - 1
 ! base line = defpoints[1] -> defpoints[2]
-DIM base_points[rebar_count][2] ! coords of: base line divided into 'spaces' points 
+DIM base_points[rebar_count][2] ! coords of: base line divided into 'spaces' parts
 ! target line = defpoints[4] -> defpoints[3]
-DIM target_points[rebar_count][2] ! coords of: target line divided into 'spaces' points 
-DIM unit_vectors[rebar_count][2] ! unit vectors for lines from base line to target line
-DIM cut_line_distances[rebar_count] ! distance from base line to cut line
-DIM cut_points[rebar_count][2] ! coords of the cutting points = interscetion of rebar with cut line
+DIM target_points[rebar_count][2] ! coords of: target line divided into 'spaces' parts 
+DIM unit_vectors[rebar_count][2] ! unit vectors for rebar direction lines from base line to target line
+DIM placing_line_points[rebar_count][2] ! coords of: interscetion of rebar with placing line
 DIM rebar_start_points[rebar_count][2] ! coords
 DIM rebar_end_points[rebar_count][2] ! coords
+DIM rebar_length[rebar_count] ! rebar lenght by polygonal placing
+DEFINE STYLE "pitch" "Arial", 1.5, 6, 0
+DEFINE STYLE "table" "Arial", table_char_height, 7, 0
+LAYER layer0
 
 !--- calculations
-GOSUB "set_base_line"
-GOSUB "set_target_line"
-GOSUB "calc_unit_vectors"
-GOSUB "calc_cut_line_distances"
-GOSUB "calc_cut_points"
+GOSUB "setup_base_line"
+GOSUB "setup_target_line"
+GOSUB "calc_rebar_length_and_unit_vectors"
+GOSUB "calc_placing_line_points"
 GOSUB "calc_rebar_points"
 
 !--- graphics
-GOSUB "set_properties"
-IF PREV_MODE GOSUB "draw_preview"
+IF PREV_MODE OR (show_construction_lines) GOSUB "draw_construction_lines"
+GOSUB "set_rebar_styles"
 FOR counter = 1 to rebar_count
-	GOSUB "draw_rebar"
+   GOSUB "draw_rebar"
 NEXT counter
+IF show_table THEN GOSUB "draw_table"
 
 !--- interactive part
 GOSUB "place_handles"
 END
 
-!--- subroutines
-"draw_preview":
+!--- SUBROUTINES ------------------------------------------
+"draw_construction_lines":
+! enter construction line mode
 AUX_MODE 1
-LINE2 cut_points[1][1], cut_points[1][2], cut_points[rebar_count][1], cut_points[rebar_count][2]
+
+! draw rebar direction lines
 FOR i = 1 to rebar_count
-	LINE2 base_points[i][1], base_points[i][2],
-	target_points[i][1], target_points[i][2]
+   LINE2 base_points[i][1], base_points[i][2],   target_points[i][1], target_points[i][2]
 NEXT i
+
+! draw placing line
+LINE2 placing_line_points[1][1], placing_line_points[1][2],   placing_line_points[rebar_count][1], placing_line_points[rebar_count][2]
+
+! write rebar pitches
+STYLE "pitch"
+
+! base line pitch
+PUT defpoints[1][1], defpoints[1][2], 
+    defpoints[2][1], defpoints[2][2]
+GOSUB "draw_rebar_pitch_text"
+
+! rebar start line pitch
+PUT rebar_start_points[1][1], rebar_start_points[1][2], 
+    rebar_start_points[rebar_count][1], rebar_start_points[rebar_count][2]
+GOSUB "draw_rebar_pitch_text"
+
+! placing line pitch
+PUT placing_line_points[1][1], placing_line_points[1][2], 
+    placing_line_points[rebar_count][1], placing_line_points[rebar_count][2]
+GOSUB "draw_rebar_pitch_text"
+
+! rebar end line pitch
+PUT rebar_end_points[1][1], rebar_end_points[1][2], 
+    rebar_end_points[rebar_count][1], rebar_end_points[rebar_count][2]
+GOSUB "draw_rebar_pitch_text"
+
+! target line pitch
+PUT defpoints[4][1], defpoints[4][2], 
+    defpoints[3][1], defpoints[3][2] 
+GOSUB "draw_rebar_pitch_text"
+
+! exit construction line mode
 AUX_MODE 0
+
+RETURN
+
+"draw_table":
+PEN 1
+COLOR 1
+STROKE 1
+STYLE "table"
+! setup table data
+! row[1] = table header
+DIM length_table[rebar_count + 1][3]
+
+! first row = table header
+length_table[1][1] = `UPos.`
+length_table[1][2] = `L�nge [m]`
+length_table[1][3] = `Delta [cm]`
+
+FOR rebar_num = 1 TO rebar_count
+   ! calculate delta length to previouse rebar
+   IF rebar_num = 1 THEN
+      delta = 0
+   ELSE
+      delta = ABS(rebar_length[rebar_num] - rebar_length[rebar_num-1])
+   ENDIF
+   table_row = INT(rebar_num + 1)
+   length_table[table_row][1] = STR ( rebar_num, 3, 0 )
+    length_table[table_row][2] = STR ( "%5.2m" , rebar_length [ rebar_num ] )
+    length_table[table_row][3] = STR ( "%5.2cm" , delta )
+NEXT rebar_num
+GOSUB "table_writer"
+RETURN
+
+"table_writer":
+
+__nrows__ = VARDIM1(length_table)
+__ncolumns__ = VARDIM2(length_table)
+DIM __column_width__[__ncolumns__]
+
+__text_x_offset__ = 0.05
+
+! setup  row height and table height
+__row_height__ = table_char_height / 1000 * GLOB_SCALE * 2
+__table_height__ = (__nrows__ + 0.5) * __row_height__ 
+
+! calc column widths and table width
+! first row = table header
+__table_width__ = 0
+FOR i = 1 TO __ncolumns__
+   __text_width__ = STW(length_table[1][i]) / 1000 * GLOB_SCALE
+   __column_width__[i] = __text_width__
+   __table_width__ = __table_width__ + __text_width__
+NEXT i
+
+! draw table borders
+RECT2 table_pos_x, table_pos_y, (table_pos_x + __table_width__), (table_pos_y - __table_height__)
+
+! setup first row writing location
+TRANS2 (table_pos_x + __text_x_offset__), (table_pos_y - __row_height__)
+
+! write table rows
+FOR __current_row__ = 1 TO __nrows__
+   GOSUB "__write_table_row__"
+   TRANS2 0, -__row_height__
+NEXT __current_row__
+
+RESTORE __nrows__ +  1
+GOTO "__end_of__table_writer__":
+
+!--- local subroutine
+"__write_table_row__":
+__xpos__ = 0 ! column x position
+FOR __col__ = 1 to __ncolumns__
+   TEXT2 __xpos__, 0, length_table[__current_row__][__col__]
+   __xpos__ = __xpos__ + __column_width__[__col__]
+NEXT __col__
+RETURN
+"__end_of__table_writer__":
+
 RETURN
 
 "draw_rebar":
 rebar_end_points[counter][1], rebar_end_points[counter][2]
 RETURN
 
-"set_properties":
-LAYER layer0
+"draw_rebar_pitch_text":!(x1, y1, x2, y2)
+x1 = GET(1)
+y1 = GET(1)
+x2 = GET(1)
+y2 = GET(1)
+dx = x2-x1
+dy = y2-y1
+placing_length = SQR(dx^2 + dy^2)
+pitch = placing_length / spaces
+pitch_text = "e= " + STR("%.1cm", pitch) + " cm "
+IF dx <> 0 THEN
+   placing_angle = ATAN(dy/dx)
+   IF dx < 0 THEN
+      placing_angle = placing_angle + 180
+   ENDIF
+ELSE
+   IF dy > 0 THEN
+      placing_angle = 90
+   ELSE
+      placing_angle = -90
+   ENDIF
+ENDIF
+TRANS2 x1, y1
+ROT2 placing_angle
+TEXT2 0, 0, pitch_text
+RESTORE 2
+RETURN
+
+"set_rebar_styles":
 COLOR rebar_color
-PEN rebar_color
+PEN rebar_pen
 STROKE rebar_stroke
 RETURN
 
-"set_base_line": ! divide base line = defpoints[1] -> defpoints[2]
+"setup_base_line": ! divide base line = defpoints[1] -> defpoints[2]
 
 delta_x = (defpoints[2][1] - defpoints[1][1]) / spaces
 delta_y = (defpoints[2][2] - defpoints[1][2]) / spaces
 FOR i = 1 to rebar_count
-	base_points[i][1] = defpoints[1][1] + delta_x * (i - 1)
-	base_points[i][2] = defpoints[1][2] + delta_y * (i - 1)
+   base_points[i][1] = defpoints[1][1] + delta_x * (i - 1)
+   base_points[i][2] = defpoints[1][2] + delta_y * (i - 1)
 NEXT i
 
 RETURN
 
-"set_target_line": ! divide target line = defpoints[4] -> defpoints[3]
+"setup_target_line": ! divide target line = defpoints[4] -> defpoints[3]
 
 delta_x = (defpoints[3][1] - defpoints[4][1]) / spaces
 delta_y = (defpoints[3][2] - defpoints[4][2]) / spaces
 FOR i = 1 to rebar_count
-	target_points[i][1] = defpoints[4][1] + delta_x * (i - 1)
-	target_points[i][2] = defpoints[4][2] + delta_y * (i - 1)
+   target_points[i][1] = defpoints[4][1] + delta_x * (i - 1)
+   target_points[i][2] = defpoints[4][2] + delta_y * (i - 1)
 NEXT i
 
 RETURN
 
-"calc_unit_vectors":
+"calc_rebar_length_and_unit_vectors":
 FOR i = 1 TO rebar_count
-	dx = target_points[i][1] - base_points[i][1]
-	dy = target_points[i][2] - base_points[i][2]
-	vector_length = SQR(dx^2 + dy^2)
-	unit_vectors[i][1] = dx / vector_length
-	unit_vectors[i][2] = dy / vector_length
+   dx = target_points[i][1] - base_points[i][1]
+   dy = target_points[i][2] - base_points[i][2]   
+   vector_length = SQR(dx^2 + dy^2)
+   ! set rebar length by polygonal placing
+   rebar_length[i] = vector_length
+   ! set unit vector
+   unit_vectors[i][1] = dx / vector_length
+   unit_vectors[i][2] = dy / vector_length
 NEXT i
 RETURN
 
-"calc_cut_line_distances":
-! interpolate from cut_line_start_pos to cut_line_end_pos
-! cut_line_distance = distance from base line to cut line
-delta = (cut_line_end_pos - cut_line_start_pos) / spaces
+"calc_placing_line_points":
+! calculate cutting points of rebar with the placing line
 FOR i = 1 TO rebar_count
-	cut_line_distances[i] = cut_line_start_pos + delta * (i - 1)
-NEXT i
-RETURN
-
-"calc_cut_points":
-! calculate cutting points of rebar with the cut line
-FOR i = 1 TO rebar_count
-	FOR axis = 1 TO 2
-		cut_points[i][axis] = base_points[i][axis] + cut_line_distances[i] * unit_vectors[i][axis]
-	NEXT axis
+   FOR axis = 1 TO 2
+      ! mid point between base point and target point
+      placing_line_points[i][axis] = (base_points[i][axis] + target_points[i][axis]) / 2      
+   NEXT axis
 NEXT i
 RETURN
 
 "calc_rebar_points":
 ! calculate start and end points of rebars
-! mid point of rebar = cutting point
+! mid point of rebar = placing line point
 FOR i = 1 TO rebar_count
-	FOR axis = 1 TO 2
-		half_rebar = unit_vectors[i][axis] * rebar_length / 2
-		cut_point = cut_points[i][axis]
-		rebar_start_points[i][axis] = cut_point - half_rebar
-		rebar_end_points[i][axis] = cut_point + half_rebar
-	NEXT axis
+   FOR axis = 1 TO 2
+      half_rebar = unit_vectors[i][axis] * rebar_length / 2
+      placing_line_point = placing_line_points[i][axis]
+      rebar_start_points[i][axis] = placing_line_point - half_rebar
+      rebar_end_points[i][axis] = placing_line_point + half_rebar
+   NEXT axis
 NEXT i
 RETURN
 
 HANDLE2 (defpoints[4][1]), (defpoints[4][2]), 4, defpoints[4][1], 2
 HANDLE2 (-1), (defpoints[4][2]), 4, defpoints[4][1], 3
 
-! cut_line_start_pos handle
-HANDLE2 (defpoints[1][1]), (defpoints[1][2]), 5, cut_line_start_pos, 1
-HANDLE2 (cut_points[1][1]), (cut_points[1][2]), 5, cut_line_start_pos, 2
-HANDLE2 (-unit_vectors[1][1]), (-unit_vectors[1][2]), 5, cut_line_start_pos, 3
 
-! cut_line_end_pos handle
-HANDLE2 (defpoints[2][1]), (defpoints[2][2]), 6, cut_line_end_pos, 1
-HANDLE2 (cut_points[rebar_count][1]), (cut_points[rebar_count][2]), 6, cut_line_end_pos, 2
-HANDLE2 (-unit_vectors[rebar_count][1]), (-unit_vectors[rebar_count][2]), 6, cut_line_end_pos, 3
+IF show_table THEN
+! table location handle
+HANDLE2 (table_pos_x), (0), 5, table_pos_y, 1
+HANDLE2 (table_pos_x), (table_pos_y), 5, table_pos_y, 2
+HANDLE2 (table_pos_x), (-1), 5, table_pos_y, 3
+HANDLE2 (0), (table_pos_y), 5, table_pos_x, 1
+HANDLE2 (table_pos_x), (table_pos_y), 5, table_pos_x, 2
+HANDLE2 (-1), (table_pos_y), 5, table_pos_x, 3
+ENDIF
+
 RETURN
 
 
+
+
 ]]></Text>
 </Part2D>
 <Part3D>
 </Part3D>
 <PartDialog>
 <Enable>1</Enable>
-<Text><![CDATA[]]></Text>
+<Text><![CDATA[! gef�cherte St�be
+! (c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
+! License: GPLv3, www.fsf.org
+
+I_PALETTE `gef�cherte St�be`, 1, 
+"(c) 2012 Manfred Moitzi", "link=http://smartparts.tzb-moitzi.at TZBM", 
+"General Public License v3 (GPLv3)", "link=http://www.gnu.org/licenses/ Lizenz"
+
+I_SECTION `Eigenschaften`
+I_INFIELD "rebar_count", 0,0,1,1
+I_INFIELD "rebar_length", 0,0,1,1
+I_INFIELD "show_construction_lines", 0,0,1,1
+I_INFIELD "show_table", 0,0,1,1
+I_INFIELD "table_char_height", 0,0,1,1
+I_SECTION_END
+
+I_SECTION `Format`
+I_INFIELD "rebar_pen", 0,0,1,1
+I_INFIELD "rebar_stroke", 0,0,1,1
+I_INFIELD "rebar_color", 0,0,1,1
+I_INFIELD "layer0", 0,0,1,1
+I_SECTION_END
+]]></Text>
 </PartDialog>
 </Script>
 <Drawing2D>
 <Pictures>
 <ImportBitmaps>0</ImportBitmaps>
 <ManageInList>1</ManageInList>
-<Picture Name="0" Type="png" Width="146" Height="159"><![CDATA[89504E470D0A1A0A0000000D49484452000000920000009F080600000012E58050000000017352474200AECE1CE90000000467414D410000B18F0BFC6105000000097048597300000EC300000EC301C76FA864000002C849444154785EEDD2310D00000CC3B0F127DD91C8E902E811F9660A04052EF870A1C040822029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A80946474021203490190928C4E40622029005292D109480C2405404A323A018981A40048494627203190140029C9E804240692022025199D80C4405200A424A3139018480A3C6FCC6270DCC766460000000049454E44AE426082]]></Picture>
+<Picture Name="0" Type="png" Width="146" Height="159"><![CDATA[89504E470D0A1A0A0000000D49484452000000920000009F080600000012E58050000000017352474200AECE1CE90000000467414D410000B18F0BFC6105000000097048597300000EC300000EC301C76FA8640000096F49444154785EED9DEB72143B0C8479FF97E6102A0BCB9C99E996D4F265A7A9CA0F625B965B9F257953811F3FFDC70A0814F821B0611356E0A741320412050C9244461B31486640A2804192C8682306C90C4814304812196DC42099018902064922A38D1824332051C0204964B411836406240A1824898C366290CC804401832491D1460C9219902860902432DA8841320312050C9244461B31486640A2804192C8682306C90C4814304812196DC42099018902064922A38D1824332051C0204964B411836406240A1824898C366290CC804401832491D1460C9219902860902432DAC8FF40FAF1EB3BEA2FCBFCF90A9C82743C7604ACB3B59F2FA34F383C237D41F9FEE7F8F7AF31C59C8CDDCC1AC6DF27D86DEF9110142B89BC922FBB01DA0E524610045FC666D79A4FB39BBE4C23AA3B0223E3FC089B0C24CC9CCCF9147633FB66D6FCF6755790324277C097F18359C3CCE9388F41229AF40EE1330167D61CE720DF3336556B1E9791B60BCE5BBD3048DFB5F35D88554549A775F09146C62ED2286393C940C8EED9F8B08C94390012326333B3E693FC40E747109DAD7FF5D8439A6D74802B07EFB298C266C646466CB4068D337E66E6282EC976203142298441363A82DE6173945E06E9A477CB889F598360CDD8440F0985CD254A1B3A68E65676D84441CEF839C226D24201D255A33DB4D94607C904A8C3E688A0A33DD0B932E399358C9FC34B5BD741D061ABE31D371DF93443ABEC453648648FF4A92029607E41B45469BB6AE4D41F012001D1CD44E38A6C826C647C4017226B734A46EA384C148CE87CE4330A7A661CED99097AC7B9A7652424EA08813A048DDA44F3570089F171599010688AF15D827457D2D18543E32A1D0D92F8A7EAE8F646C7ABB047418ACE7F0768891E49753394B737236A141434BF1BA4E8FE570FA1AD32121215C11805233A1FEDBFC238D2109DF96CFC989586FDF4FF1F7A0BA5051D1A8986021BB58FECAD308E344167DE022474C8D18140A28EF667C5FD96E891561406F50C1E3F43E7DFEF4D2F6D060BFF66F1DD63A2AA5F26033B237D2BB0738641818F8E47E75FE5A6291909F5453B07BA9A21D0FA4CE0951F8F2C0D1202AB3A3E13CC15021F010969B51548EA5B89C4E91C3748B8512FCDE80C1ECA6033F746BEA1F1D9BE7F544642190B05038D2B83D59D912ABE667C5B0EA4958359090E3A57757CB66FCB838404560A3872AFCCAD5736C74A5B77BDCCB4E73F2A4F9DE0CC04099DABE25B145AE4CB99BDED32D24CD0A202DFCD57DA8A6AA28672CB8C3452B48AE0513F2B6045334EE55C916CF47B9FD21B5EB05859C355B62AC1AE042F0A6565AF0C94CB66A48A1051D1237044E676FA81F441E391928B6CA19CB154464287A90438B23632772648113F2373CFCE6490BE1588081999DB09D22C3FA2FDD1723D120A4A25635582B2E35AA556281B2D0192F2C0919E200247646EE53C95B5D1E639A29541BAF9474247C1316B9F3B28A3D06D0992F2564682B8C2DC51678F9C958168C9D25611B3B236226ED7DC2EFF2BFE7E0C485DE2AE68B7CBA7C7801411B0224AA4C19C3157D9D7BCFB5FD16CAB8C1401A96B6E45EC2C7491A637E29F52A3AD418A081111381BF0883F91B933408AE8C542B44CB37D14BF128C11B0448231C39F4889BC2B81C340FA7242F9F5EEB8AAC63FDD4E05FA6D41BA0AFA0BD6D7C1B2B7BC22EA68209567667D3F2BB52C4CD37FFAFF0E870A24959D9919D220B1089FCC8B001099CBC03AA32F4399359349EE003C1B7BED711C8B8671998CD4D570A36065B2CE881299CD480824F6BCC3415236DBA383DEB19F2AB33D12A423BD2C5CD975AC7DCF8BBDAAA359E89FEC5659FCBA7DEA809DBDCEB237549921EECAC255AF11E973EEFA3EB6241D6D44F6AFB0B0548F843E48CB8A32629D41AA60D8B0F6EA463923FD153BFB6265B35A26AC4B67A46C59422F97CE1282F666CA63D7B9970749DD2375049A11B1F28A5BA1B45520CE642169B37DF6F94FB4093F7BBD451BEE0A04677B45B38212A46C19FF0890D4594911DCA88D2C8CEFD075DB400F12E6CCE89264B2D3723D123A64E605960D2EBB9702A4917BDDF99B81E8B7BDECC2CE756CE0D5F3D8DB7E56CEDF4B1BD38F8DDC8BD5A912D3AD41CA0683BDFDECBC4C468A04B7FAF888EC9585694990560164059022105481CB42B46C69CBF6496CE0D5F33A339241AAE0FDD5BC91FFA75B751E1BA8BB79AB8194F5B512B22D4A9BBAD465E0C906A75A6ED4BEDE5D3C83F4A68032706C1057C848D57357205ABA4762B3101BECCC3C76CD0C9058DFD8798F042903192B68755E753DFBD050EF63906E1AF36A23CE02ABCC48A37AB1E33E8F01890D6A159EEA4DDF75BD41223352064476CDA88CC45C922CC81F0D121BC82BF132A266D6CC0669F68B6DF9575B15A4CCFA9540CAF8C264ADA32ED56CB4354855483282336B94C157DABACB9A06E9E2C7284CAA67A06061654A5B150A668FEC47078F03890D2C03523530D1BE6C0448993D14106D51DA94F04483CFEECD40990972D4DFCC1E06897CF62B4B18632B1AFC2E5859A80CD20D484C866003A82A936C6099FDA273BA1BEDED4B1B03CC8800AEE24726633E3623293349F4664703C5D86720EC3AB30AA26D325297904CA09939573054D68E38B3416AF8FC8809FA0A19A9D2CC1FD71AA407801405260AB912A28F286D95B2C26421C63E33271A6883A446FDDB1EF3FA62C49F35A70324E622DCEDAB0CD5B2BF4572764824DC2C48666524A4C75DC3AE8468ABD25679C554B219030933A71274C5DACE46FB3120311046618B663F050C57E788FAAECE4606E99702AF204483B12A488C5F0689F835EE956EBEDA170612668E4122FEFB7575F0AEFA1FA6CCA87D612061F67C3C48955E871118CDA994BF956C1BA4B79E86814AFD9A1A05922AF35CF57F06C920FD6120FB48E88068BB571BFA80ED4CDCBBEFBD44457350595264BEAB3D90EDE83A83F4AD40B6BC64D78D2AA11158115CE8C275C0B4D58F488E1944FD72CA06B312D86A36443E1F2F5007445B963626432071D500229014D930DB801BA49BAB834051888EF688C0A80629E29B412A80140932CA264C064436A20DF1D97CF43DE6CC5D65ED234A1B2320DB878C08B8325B4632532744DB82C464097483D17804D06C468A8080FC45E306E942011404242C5A6F9062E86DF9FCEFCA4859BBD58C942DA9E8328C6AB41F57DABA40E90229020ACAC0B1FC129FFDB11949599A1028685C09C4D9C381396B1C8DD88A6D41CA66978EA0CE06697636DABAB419A4BF19E391207D1D5AF9F592138959FD2CA9B2BE230B466CC68A546EF6F0D2A68468E4AB2427EF73560D07E939D23EEBA406E959F16E3BAD416A93F659860DD2B3E2DD76DAFF0045EBE555C8C4A2DD0000000049454E44AE426082]]></Picture>
 </Pictures>
 </ScriptObject>

lib/vectors2.mako

 % if DEBUG:
 ! calc distance from point1 to point2
 % endif
-${result} = SQR( (${point1}[1]-${point2}[1])^2 + (${point1}[2]-${point2}[2])^2 )
+${result} = SQR( (${point1}[1] - ${point2}[1])^2 + (${point1}[2] - ${point2}[2])^2 )
 </%def>
 
 <%def name="midpoint(result, point1, point2)" filter="trim">
 % if DEBUG:
 ! calc midpoint from point1 and point2
 % endif
-${result}[1] = (${point1}[1]+${point2}[1]) / 2
-${result}[2] = (${point1}[2]+${point2}[2]) / 2
+${result}[1] = (${point1}[1] + ${point2}[1]) / 2
+${result}[2] = (${point1}[2] + ${point2}[2]) / 2
 </%def>
 
 

scripts/RangingRebars.Part2D.mako

 ! (c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
 ! License: GPLv3, www.fsf.org
 <%namespace file="vectors2.mako" import="*" />
+<%namespace file="math.mako" import="atan2" />
 <%namespace file="basic.mako" import="xy_handle2, bas_handle2, mov_handle2, ref_handle2" />
 
 !--- definitions
 spaces = rebar_count - 1
 ! base line = defpoints[1] -> defpoints[2]
-DIM base_points[rebar_count][2] ! coords of: base line divided into 'spaces' points 
+DIM base_points[rebar_count][2] ! coords of: base line divided into 'spaces' parts
 ! target line = defpoints[4] -> defpoints[3]
-DIM target_points[rebar_count][2] ! coords of: target line divided into 'spaces' points 
-DIM unit_vectors[rebar_count][2] ! unit vectors for lines from base line to target line
-DIM cut_line_distances[rebar_count] ! distance from base line to cut line
-DIM cut_points[rebar_count][2] ! coords of the cutting points = interscetion of rebar with cut line
+DIM target_points[rebar_count][2] ! coords of: target line divided into 'spaces' parts 
+DIM unit_vectors[rebar_count][2] ! unit vectors for rebar direction lines from base line to target line
+DIM placing_line_points[rebar_count][2] ! coords of: interscetion of rebar with placing line
 DIM rebar_start_points[rebar_count][2] ! coords
 DIM rebar_end_points[rebar_count][2] ! coords
+DIM rebar_length[rebar_count] ! rebar lenght by polygonal placing
+DEFINE STYLE "pitch" "Arial", 1.5, 6, 0
+DEFINE STYLE "table" "Arial", table_char_height, 7, 0
+LAYER layer0
 
 !--- calculations
-GOSUB "set_base_line"
-GOSUB "set_target_line"
-GOSUB "calc_unit_vectors"
-GOSUB "calc_cut_line_distances"
-GOSUB "calc_cut_points"
+GOSUB "setup_base_line"
+GOSUB "setup_target_line"
+GOSUB "calc_rebar_length_and_unit_vectors"
+GOSUB "calc_placing_line_points"
 GOSUB "calc_rebar_points"
 
 !--- graphics
-GOSUB "set_properties"
-IF PREV_MODE GOSUB "draw_preview"
+IF PREV_MODE OR (show_construction_lines) GOSUB "draw_construction_lines"
+GOSUB "set_rebar_styles"
 FOR counter = 1 to rebar_count
 	GOSUB "draw_rebar"
 NEXT counter
+IF show_table THEN GOSUB "draw_table"
 
 !--- interactive part
 GOSUB "place_handles"
 END
 
-!--- subroutines
-"draw_preview":
+!--- SUBROUTINES ------------------------------------------
+"draw_construction_lines":
+! enter construction line mode
 AUX_MODE 1
-LINE2 cut_points[1][1], cut_points[1][2], cut_points[rebar_count][1], cut_points[rebar_count][2]
+
+! draw rebar direction lines
 FOR i = 1 to rebar_count
-	LINE2 base_points[i][1], base_points[i][2],
-	target_points[i][1], target_points[i][2]
+	LINE2 base_points[i][1], base_points[i][2],	target_points[i][1], target_points[i][2]
 NEXT i
+
+! draw placing line
+LINE2 placing_line_points[1][1], placing_line_points[1][2],	placing_line_points[rebar_count][1], placing_line_points[rebar_count][2]
+
+! write rebar pitches
+STYLE "pitch"
+
+! base line pitch
+PUT defpoints[1][1], defpoints[1][2], 
+    defpoints[2][1], defpoints[2][2]
+GOSUB "draw_rebar_pitch_text"
+
+! rebar start line pitch
+PUT rebar_start_points[1][1], rebar_start_points[1][2], 
+    rebar_start_points[rebar_count][1], rebar_start_points[rebar_count][2]
+GOSUB "draw_rebar_pitch_text"
+
+! placing line pitch
+PUT placing_line_points[1][1], placing_line_points[1][2], 
+    placing_line_points[rebar_count][1], placing_line_points[rebar_count][2]
+GOSUB "draw_rebar_pitch_text"
+
+! rebar end line pitch
+PUT rebar_end_points[1][1], rebar_end_points[1][2], 
+    rebar_end_points[rebar_count][1], rebar_end_points[rebar_count][2]
+GOSUB "draw_rebar_pitch_text"
+
+! target line pitch
+PUT defpoints[4][1], defpoints[4][2], 
+    defpoints[3][1], defpoints[3][2] 
+GOSUB "draw_rebar_pitch_text"
+
+! exit construction line mode
 AUX_MODE 0
+
+RETURN
+
+"draw_table":
+PEN 1
+COLOR 1
+STROKE 1
+STYLE "table"
+! setup table data
+! row[1] = table header
+DIM length_table[rebar_count + 1][3]
+
+! first row = table header
+length_table[1][1] = `UPos.`
+length_table[1][2] = `Länge [m]`
+length_table[1][3] = `Delta [cm]`
+
+FOR rebar_num = 1 TO rebar_count
+	! calculate delta length to previouse rebar
+	IF rebar_num = 1 THEN
+		delta = 0
+	ELSE
+		delta = ABS(rebar_length[rebar_num] - rebar_length[rebar_num-1])
+	ENDIF
+	table_row = INT(rebar_num + 1)
+	length_table[table_row][1] = STR ( rebar_num, 3, 0 )
+    length_table[table_row][2] = STR ( "%5.2m" , rebar_length [ rebar_num ] )
+    length_table[table_row][3] = STR ( "%5.2cm" , delta )
+NEXT rebar_num
+GOSUB "table_writer"
+RETURN
+
+"table_writer":
+${table_writer("length_table", "table_pos_x", "table_pos_y", "table_char_height", line_factor=2)}
 RETURN
 
 "draw_rebar":
 rebar_end_points[counter][1], rebar_end_points[counter][2]
 RETURN
 
-"set_properties":
-LAYER layer0
+"draw_rebar_pitch_text":!(x1, y1, x2, y2)
+x1 = GET(1)
+y1 = GET(1)
+x2 = GET(1)
+y2 = GET(1)
+dx = x2-x1
+dy = y2-y1
+placing_length = SQR(dx^2 + dy^2)
+pitch = placing_length / spaces
+pitch_text = "e= " + STR("%.1cm", pitch) + " cm "
+${atan2("placing_angle", "dx", "dy")}
+TRANS2 x1, y1
+ROT2 placing_angle
+TEXT2 0, 0, pitch_text
+RESTORE 2
+RETURN
+
+"set_rebar_styles":
 COLOR rebar_color
-PEN rebar_color
+PEN rebar_pen
 STROKE rebar_stroke
 RETURN
 
-"set_base_line": ! divide base line = defpoints[1] -> defpoints[2]
+"setup_base_line": ! divide base line = defpoints[1] -> defpoints[2]
 ${divide_line("base_points", 1, 2)}
 RETURN
 
-"set_target_line": ! divide target line = defpoints[4] -> defpoints[3]
+"setup_target_line": ! divide target line = defpoints[4] -> defpoints[3]
 ${divide_line("target_points", 4, 3)}
 RETURN
 
-"calc_unit_vectors":
+"calc_rebar_length_and_unit_vectors":
 FOR i = 1 TO rebar_count
 	dx = target_points[i][1] - base_points[i][1]
-	dy = target_points[i][2] - base_points[i][2]
+	dy = target_points[i][2] - base_points[i][2]	
 	vector_length = SQR(dx^2 + dy^2)
+	! set rebar length by polygonal placing
+	rebar_length[i] = vector_length
+	! set unit vector
 	unit_vectors[i][1] = dx / vector_length
 	unit_vectors[i][2] = dy / vector_length
 NEXT i
 RETURN
 
-"calc_cut_line_distances":
-! interpolate from cut_line_start_pos to cut_line_end_pos
-! cut_line_distance = distance from base line to cut line
-delta = (cut_line_end_pos - cut_line_start_pos) / spaces
-FOR i = 1 TO rebar_count
-	cut_line_distances[i] = cut_line_start_pos + delta * (i - 1)
-NEXT i
-RETURN
-
-"calc_cut_points":
-! calculate cutting points of rebar with the cut line
+"calc_placing_line_points":
+! calculate cutting points of rebar with the placing line
 FOR i = 1 TO rebar_count
 	FOR axis = 1 TO 2
-		cut_points[i][axis] = base_points[i][axis] + cut_line_distances[i] * unit_vectors[i][axis]
+		! mid point between base point and target point
+		placing_line_points[i][axis] = (base_points[i][axis] + target_points[i][axis]) / 2		
 	NEXT axis
 NEXT i
 RETURN
 
 "calc_rebar_points":
 ! calculate start and end points of rebars
-! mid point of rebar = cutting point
+! mid point of rebar = placing line point
 FOR i = 1 TO rebar_count
 	FOR axis = 1 TO 2
 		half_rebar = unit_vectors[i][axis] * rebar_length / 2
-		cut_point = cut_points[i][axis]
-		rebar_start_points[i][axis] = cut_point - half_rebar
-		rebar_end_points[i][axis] = cut_point + half_rebar
+		placing_line_point = placing_line_points[i][axis]
+		rebar_start_points[i][axis] = placing_line_point - half_rebar
+		rebar_end_points[i][axis] = placing_line_point + half_rebar
 	NEXT axis
 NEXT i
 RETURN
 ! defpoint[4] handle
 ${xy_handle2("defpoints[4][1]", "defpoints[4][2]", 4)}
 
-! cut_line_start_pos handle
-${bas_handle2("defpoints[1][1]", "defpoints[1][2]", "cut_line_start_pos", 5)}
-${mov_handle2("cut_points[1][1]", "cut_points[1][2]", "cut_line_start_pos", 5)}
-${ref_handle2("-unit_vectors[1][1]", "-unit_vectors[1][2]", "cut_line_start_pos", 5)}
 
-! cut_line_end_pos handle
-${bas_handle2("defpoints[2][1]", "defpoints[2][2]", "cut_line_end_pos", 6)}
-${mov_handle2("cut_points[rebar_count][1]", "cut_points[rebar_count][2]", "cut_line_end_pos", 6)}
-${ref_handle2("-unit_vectors[rebar_count][1]", "-unit_vectors[rebar_count][2]", "cut_line_end_pos", 6)}
+IF show_table THEN
+! table location handle
+${xy_handle2("table_pos_x", "table_pos_y", 5)}
+ENDIF
+
 RETURN
 
 ############################################################################
 	${result}[i][2] = defpoints[${from_}][2] + delta_y * (i - 1)
 NEXT i
 </%def>
+
+############################################################################
+## table_name: 2-dimensional String Array; 1. row = table header
+## !!! all cells have to contain printable strings !!!
+## x: x location of top left table corner
+## y: y location of top left table corner
+## char_height: font size as defined by DEFINE STYLE
+## line_factor: vertical distance of two rows as factor of "char_height"
+## designed for reusing in other scripts
+<%def name="table_writer(table_name, x, y, char_height, line_factor=2)">
+__nrows__ = VARDIM1(${table_name})
+__ncolumns__ = VARDIM2(${table_name})
+DIM __column_width__[__ncolumns__]
+
+__text_x_offset__ = 0.05
+
+! setup  row height and table height
+__row_height__ = ${char_height} / 1000 * GLOB_SCALE * ${line_factor}
+__table_height__ = (__nrows__ + 0.5) * __row_height__ 
+
+! calc column widths and table width
+! first row = table header
+__table_width__ = 0
+FOR i = 1 TO __ncolumns__
+	__text_width__ = STW(${table_name}[1][i]) / 1000 * GLOB_SCALE
+	__column_width__[i] = __text_width__
+	__table_width__ = __table_width__ + __text_width__
+NEXT i
+
+! draw table borders
+RECT2 ${x}, ${y}, (${x} + __table_width__), (${y} - __table_height__)
+
+! setup first row writing location
+TRANS2 (${x} + __text_x_offset__), (${y} - __row_height__)
+
+! write table rows
+FOR __current_row__ = 1 TO __nrows__
+	GOSUB "__write_table_row__"
+	TRANS2 0, -__row_height__
+NEXT __current_row__
+
+RESTORE __nrows__ +  1
+GOTO "__end_of__table_writer__":
+
+!--- local subroutine
+"__write_table_row__":
+__xpos__ = 0 ! column x position
+FOR __col__ = 1 to __ncolumns__
+	TEXT2 __xpos__, 0, ${table_name}[__current_row__][__col__]
+	__xpos__ = __xpos__ + __column_width__[__col__]
+NEXT __col__
+RETURN
+"__end_of__table_writer__":
+</%def>

scripts/RangingRebars.PartDialog.mako

+! gefächerte Stäbe
+! (c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
+! License: GPLv3, www.fsf.org
+
+I_PALETTE `gefächerte Stäbe`, 1, 
+"(c) 2012 Manfred Moitzi", "link=http://smartparts.tzb-moitzi.at TZBM", 
+"General Public License v3 (GPLv3)", "link=http://www.gnu.org/licenses/ Lizenz"
+
+I_SECTION `Eigenschaften`
+I_INFIELD "rebar_count", 0,0,1,1
+I_INFIELD "rebar_length", 0,0,1,1
+I_INFIELD "show_construction_lines", 0,0,1,1
+I_INFIELD "show_table", 0,0,1,1
+I_INFIELD "table_char_height", 0,0,1,1
+I_SECTION_END
+
+I_SECTION `Format`
+I_INFIELD "rebar_pen", 0,0,1,1
+I_INFIELD "rebar_stroke", 0,0,1,1
+I_INFIELD "rebar_color", 0,0,1,1
+I_INFIELD "layer0", 0,0,1,1
+I_SECTION_END

scripts/RangingRebars.PartParameter.mako

 ! (c) 2012, Manfred Moitzi, smartparts.tzb-moitzi.at
 ! License: GPLv3, www.fsf.org
 
-<%namespace file="vectors2.mako" import="*" />
-
-${distance('start_length', 'defpoints[1]', 'defpoints[4]')}
-${distance('end_length', 'defpoints[2]', 'defpoints[3]')}
-
 VALUES "rebar_count" RANGE [2, ) STEP 2, 1
-VALUES "cut_line_start_pos" RANGE [0, start_length]
-VALUES "cut_line_end_pos" RANGE [0, end_length]