Basic usage
1. Start the macro
2.
Select
objects in the model with the Assembly selection
3.
Press
the button LCA in Cloud
Macro
writes the file OCL_Data.xlsx in the ReportOutput
folder under Tekla model folder.
User is asked
credentials to the One Click LCA service. With authorized login data, the excel
is pushed in the service.
Selecting
additional attributes
When the
macro dialog is opened, all available user defined attributes (UDA) are listed
on the left hand list. UDAs can be included in the export by moving them on the
right side list. Column definitions for selected UDAs are stored in the file OCL_ExportSettings.xml
under the Tekla model folder right when they are moved on the dialog.
Advanced
configuration
The exported
excel columns are defined in the file OCL_ExportSettings.xml under the model.
Additional user defined attributes (UDA) can be added or removed with the user
interface as described in the previous chapter. The file can be modified with a
text editor as well.
1 <?xml version="1.0" encoding="utf-8"?>
2 <ExportData xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3 <!--Columns of the excel file-->
4 <!--PCS column (number of similar parts) is added always as the last
column-->
5 <!--All consequent Property names of the matching ObjectType are
concatenated to the column cell-->
6 <!--Part types: part_m2, part_m3, reinforcement-->
7 <!--Property names are written as is except keys are replaced with
their return values-->
8 <!--Property name keys: [RPT:<report property>], [UDA:<user
defined attribute>],
9 [HARDCODED:OBJECT_TYPE], [HARDCODED:FATHER_TYPE] (from the application,
defined by GetPartType
code)
10 [CUSTOM:<custom property name> (defined in this
file with C# code)-->
11 <Column header="CLASS">
12 <ObjectType types="part_m2 part_m3">
13 <Property name="[HARDCODED:OBJECT_TYPE]"
type="string" unit=""> </Property>
14 </ObjectType>
15 <ObjectType types="reinforcement">
16 <Property name="[HARDCODED:FATHER_TYPE]"
type="string" unit=""> </Property>
17 </ObjectType>
18 </Column>
19 <Column header="MATERIAL">
20 <ObjectType types="part_m2 part_m3">
21 <Property name="[RPT:MATERIAL_TYPE]
" type="string" unit=""> </Property>
22 <Property name="[RPT:MATERIAL]"
type="string" unit=""> </Property>
23 </ObjectType>
24 <ObjectType types="reinforcement">
25 <Property name="REBAR"
type="string" unit=""> </Property>
26 <Property name="[RPT:MATERIAL]"
type="string" unit=""> </Property>
27 </ObjectType>
28 </Column>
29 <Column header="QUANTITY">
30 <ObjectType types="part_m2">
31 <Property name="[RPT:AREA_PZ]"
type="double" unit="m2" precision="2">
</Property>
32 </ObjectType>
33 <ObjectType types="part_m3">
34 <Property name="[RPT:VOLUME_NET]"
type="double" unit="m3" precision="3">
</Property>
35 </ObjectType>
36 <ObjectType types="reinforcement">
37 <Property name="[RPT:WEIGHT_TOTAL]"
type="double" unit="kg" precision="1">
</Property>
38 </ObjectType>
39 </Column>
40 <Column header="QTY_TYPE">
41 <ObjectType types="part_m2">
42 <Property name="M2"
type="string"> </Property>
43 </ObjectType>
44 <ObjectType types="part_m3">
45 <Property name="M3"
type="string"> </Property>
46 </ObjectType>
47 <ObjectType types="reinforcement">
48 <Property name="KG"
type="string"> </Property>
49 </ObjectType>
50 </Column>
51 <Column header="VOLUME_M3">
52 <ObjectType types="part_m2 part_m3">
53 <Property name="[RPT:VOLUME_NET]"
type="double" unit="m3" precision="3">
</Property>
54 </ObjectType>
55 </Column>
56 <Column header="THICKNESS_IN">
57 <ObjectType types="part_m2 part_m3">
58 <Property name="[CUSTOM:THICKNESS]"
type="double" unit="in" precision="2">
</Property>
59 </ObjectType>
60 <ObjectType types="reinforcement">
61 <Property name="[RPT:DIAMETER_NOMINAL]"
type="double" unit="in" precision="2">
</Property>
62 </ObjectType>
63 </Column>
64 <Column header="THICKNESS_MM">
65 <ObjectType types="part_m2 part_m3">
66 <Property name="[CUSTOM:THICKNESS]"
type="double" unit="mm" precision="1">
</Property>
67 </ObjectType>
68 <ObjectType types="reinforcement">
69 <Property name="[RPT:DIAMETER_NOMINAL]"
type="double" unit="mm" precision="1">
</Property>
70 </ObjectType>
71 </Column>
72 <Column header="STRUCTURAL">
73 <ObjectType types="">
74 <Property name="FALSE"> </Property>
75 </ObjectType>
76 </Column>
77 <Column header="COMPOSITE">
78 <ObjectType types="">
79 <Property name="FALSE"> </Property>
80 </ObjectType>
81 </Column>
82 <Column header="LENGTH_M">
83 <ObjectType types="part_m2 part_m3">
84 <Property name="[RPT:LENGTH]"
type="double" unit="m" precision="1">
</Property>
85 </ObjectType>
86 <ObjectType types="reinforcement">
87 <Property name="[RPT:LENGTH]"
type="double" unit="m" precision="1">
</Property>
88 </ObjectType>
89 </Column>
90 <Column header="LENGTH_FT">
91 <ObjectType types="part_m2 part_m3">
92 <Property name="[RPT:LENGTH]"
type="double" unit="ft" precision="1">
</Property>
93 </ObjectType>
94 <ObjectType types="reinforcement">
95 <Property name="[RPT:LENGTH]"
type="double" unit="ft" precision="0">
</Property>
96 </ObjectType>
97 </Column>
98 <Column header="AREA_M2">
99 <ObjectType types="part_m2">
100 <Property name="[RPT:AREA_PZ]"
type="double" unit="m2" precision="2">
</Property>
101 </ObjectType>
102 </Column>
103 <Column header="AREA_SQ_FT">
104 <ObjectType types="part_m2">
105 <Property name="[RPT:AREA_PZ]"
type="double" unit="sq_ft" precision="2">
</Property>
106 </ObjectType>
107 </Column>
108 <Column header="VOLUME_M3">
109 <ObjectType types="part_m2 part_m3">
110 <Property name="[RPT:VOLUME_NET]"
type="double" unit="m3" precision="3">
</Property>
111 </ObjectType>
112 </Column>
113 <Column header="VOLUME_CU_FT">
114 <ObjectType types="part_m2 part_m3">
115 <Property name="[RPT:VOLUME_NET]"
type="double" unit="cu_ft" precision="3">
</Property>
116 </ObjectType>
117 </Column>
118 <Column header="VOLUME_CU_YD">
119 <ObjectType types="part_m2 part_m3">
120 <Property name="[RPT:VOLUME_NET]"
type="double" unit="cu_yd" precision="3">
</Property>
121 </ObjectType>
122 </Column>
123 <Column header="COMMENT">
124 <ObjectType types="">
125 <Property name=""> </Property>
126 </ObjectType>
127 </Column>
128 <Column header="TYPE">
129 <ObjectType types="">
130 <Property name="[RPT:MATERIAL]"> </Property>
131 </ObjectType>
132 </Column>
133 <Column header="MATERIAL_GROUP">
134 <ObjectType types="part_m2 part_m3">
135 <Property name="[RPT:MATERIAL_TYPE]"> </Property>
136 </ObjectType>
137 <ObjectType types="reinforcement">
138 <Property name="[RPT:GRADE]"> </Property>
139 </ObjectType>
140 </Column>
141 <!--GetPartType for part type recognition, written
in C#-->
142 <!--Return value of type string-->
143 <!--Input parameter: ModelObject mObject-->
144 <GetPartType>if (mObject == null)
145 return "NULL";
146
147 string result = "OTHER";
148 var partType = "";
149
150 if (mObject.GetType() == typeof(Beam))
151 partType = (mObject as Beam).Type.ToString();
152 else if (mObject.GetType() == typeof(ContourPlate))
153 partType = (mObject as ContourPlate).Type.ToString();
154 else if (mObject.GetType() == typeof(PolyBeam))
155 partType = (mObject as PolyBeam).Type.ToString();
156 else if (mObject.GetType() == typeof(BentPlate))
157 partType = "BENTPLATE";
158 //else if (modelObject.GetType() ==
typeof(LoftedPlate))
159 // partType = "LOFTEDPLATE";
160 else if (mObject is Reinforcement)
161 partType = "REINFORCEMENT";
162
163 var castUnitName = "";
164 mObject.GetReportProperty("CAST_UNIT_NAME",
ref castUnitName);
165
166 if (partType == "REINFORCEMENT" || partType
== "BEAM" || partType == "COLUMN")
167 {
168 result = partType;
169 }
170 else if (partType == "PANEL")
171 {
172 if (castUnitName.Contains("INTERN"))
173 result = "INTERNAL WALL";
174 else
175 result = "EXTERNAL WALL";
176 }
177 else if (partType == "STRIP_FOOTING" || partType
== "PAD_FOOTING")
178 {
179 result = "FOUNDATION";
180 }
181 else if (partType == "SLAB")
182 {
183 if (castUnitName.Contains("ROOF"))
184 result = "ROOF";
185 else
186 result = "SLAB";
187 }
188 else
189 {
190 result = "OTHER";
191 }
192
193 return result;
194 </GetPartType>
195 <!--Custom properties written in C#-->
196 <!--propertyName can be selected freely, type must
be string, double or int and return value must match with type-->
197 <!--Input parameter: ModelObject mObject-->
198 <CustomProperty propertyName="THICKNESS" type="double">
199 <Code> double width = 0.0, height = 0.0, length = 0.0;
200 mObject.GetReportProperty("WIDTH", ref
width);
201 mObject.GetReportProperty("HEIGHT", ref
height);
202 mObject.GetReportProperty("LENGTH", ref
length);
203 return Math.Min(width, Math.Min(height, length));
204 </Code>
205 </CustomProperty>
206 </ExportData>