Convert Length To String¶
Convert Length To String¶
1distance = 100
2
3# Set the format of distances to mm
4impact.units.distance_format = ipDistanceFormat.dfMillimetres
5
6# Convert an arbitary value to a string
7distance_string = impact.system.convertor.length_as_string(distance)
8
9# Output the string
10impact.gui.output_toolbox.add(distance_string)
11
12# Set the format of distances to cm
13impact.units.distance_format = ipDistanceFormat.dfCentimetres
14
15# Convert an arbitary value to a string
16distance_string = impact.system.convertor.length_as_string(distance)
17
18# Output the string
19impact.gui.output_toolbox.add(distance_string)
20
21# Set the format of distances to metres
22impact.units.distance_format = ipDistanceFormat.df_metres
23
24# Convert an arbitary value to a string
25distance_string = impact.system.convertor.length_as_string(distance)
26
27# Output the string
28impact.gui.output_toolbox.add(distance_string)
29
30# Set the format of distances to inches
31impact.units.distance_format = ipDistanceFormat.dfInches
32
33# Convert an arbitary value to a string
34distance_string = impact.system.convertor.length_as_string(distance)
35
36# Output the string
37impact.gui.output_toolbox.add(distance_string)
38
39# Set the format of distances to feet
40impact.units.distance_format = ipDistanceFormat.dfFeet
41
42# Convert an arbitary value to a string
43distance_string = impact.system.convertor.length_as_string(distance)
44
45# Output the string
46impact.gui.output_toolbox.add(distance_string)
47
48# Set the format of distances to point
49impact.units.distance_format = ipDistanceFormat.dfPoint
50
51# Convert an arbitary value to a string
52distance_string = impact.system.convertor.length_as_string(distance)
53
54# Output the string
55impact.gui.output_toolbox.add(distance_string)