@@ -13,7 +13,12 @@ def __init__(self):
1313 'GetSectionPropertyValues' ,
1414 'GetAlphaAngleForSection' ,
1515 'GetMemberReleaseSpecEx' ,
16- 'GetMemberSpecCode'
16+ 'GetMemberSpecCode' ,
17+ 'CreateBeamPropertyFromTable' ,
18+ 'CreateMemberReleaseSpec' ,
19+ 'AssignMemberSpecToBeam' ,
20+ 'AssignBeamProperty' ,
21+ 'AssignMaterialToMember'
1722 ]
1823
1924 for function_name in self ._functions :
@@ -164,4 +169,115 @@ def GetMemberSpecCode(self, memb):
164169 make_safe_array_int = make_safe_array_long (1 )
165170 spe = make_variant_vt_ref (make_safe_array_int , automation .VT_ARRAY | automation .VT_I4 )
166171 # print(Warning('GetMemberSpecCode output could be wrong'))
167- return int (self ._property .GetMemberSpecCode (memb ,spe ))
172+ return int (self ._property .GetMemberSpecCode (memb ,spe ))
173+
174+
175+
176+ def CreateBeamPropertyFromTable (self ,Country_code :int ,profile_name :str ,type_spec :int = 0 ,spec_1 :float = 0.0 ,spec_2 :float = 0.0 ):
177+
178+ """
179+ COUNTRY CODE
180+ 1-> American
181+ 2-> Australian
182+ 3-> British
183+ 4-> Canadian
184+ 5-> Chinese
185+ 6-> Dutch
186+ 7-> European
187+ 8-> French
188+ 9-> German
189+ 10-> Indian
190+ 11-> Japanese
191+ 12-> Russian
192+ 13-> Southafrican
193+ 14-> Spanish
194+ 15-> Venezuelan
195+ 16-> Korean
196+ 17-> Aluminum
197+ 18-> American cold formed
198+ 19-> Indian cold formed
199+ 20-> Mexican
200+ 21-> American Steel Joist
201+ 22-> AITCTimber
202+ 23-> Lysaght cold formed
203+ 24-> British cold formed
204+ 25-> Canadian Timber
205+ 26-> Butler cold formed
206+ 27-> Kingspan cold formed
207+ 28-> RCeco cold formed
208+ 29-> Japanese cold formed
209+ 30-> Australian cold formed
210+ """
211+ propertyNo = self ._property .CreateBeamPropertyFromTable (Country_code ,profile_name ,type_spec ,spec_1 ,spec_2 )
212+
213+ def CreateMemberReleaseSpec (self , location : int , release : list [int ], spring_const : list [float ]):
214+ """
215+ LOCATION
216+ 0 -> Start
217+ 1 -> End
218+ RELEASE
219+ [FX, FY, FZ, MX, MY, MZ]
220+ SPRINGCONST
221+ [KFX, KFY, KFZ, KMX, KMY, KMZ]
222+ """
223+
224+ def make_safe_array_long (array ):
225+ size = len (array )
226+ return automation ._midlSAFEARRAY (ctypes .c_long ).create (array )
227+
228+ def make_safe_array_double (array ):
229+ size = len (array )
230+ return automation ._midlSAFEARRAY (ctypes .c_double ).create (array )
231+
232+ # Crear SAFEARRAY para 'release'
233+ safe_list_release = make_safe_array_long (release )
234+ release_variant = make_variant_vt_ref (safe_list_release , automation .VT_ARRAY | automation .VT_I4 )
235+
236+ # Crear SAFEARRAY para 'spring_const'
237+ safe_list_spring_const = make_safe_array_double (spring_const )
238+ spring_const_variant = make_variant_vt_ref (safe_list_spring_const , automation .VT_ARRAY | automation .VT_R8 )
239+
240+ # Llamar a la función con los parámetros correctos
241+ retval = self ._property .CreateMemberReleaseSpec (location , release_variant , spring_const_variant )
242+ return retval
243+
244+ def AssignMemberSpecToBeam (self , Beams : list [int ], specNo : int ):
245+ def make_safe_array_long (array ):
246+ size = len (array )
247+ return automation ._midlSAFEARRAY (ctypes .c_long ).create (array )
248+
249+ # Crear SAFEARRAY para 'release'
250+ safe_list_release = make_safe_array_long (Beams )
251+ Beams = make_variant_vt_ref (safe_list_release , automation .VT_ARRAY | automation .VT_I4 )
252+
253+ retval = self ._property .AssignMemberSpecToBeam (Beams , specNo )
254+
255+ return retval
256+
257+ def AssignBeamProperty (self , beams_list : list [int ], propertyNo : int ):
258+
259+ def make_safe_array_long (array ):
260+ size = len (array )
261+ return automation ._midlSAFEARRAY (ctypes .c_long ).create (array )
262+
263+ # Crear SAFEARRAY para 'beamNo'
264+ safe_list = make_safe_array_long (beams_list )
265+ beams_list = make_variant_vt_ref (safe_list , automation .VT_ARRAY | automation .VT_I4 )
266+
267+ retval = self ._property .AssignBeamProperty (beams_list , propertyNo )
268+
269+ return retval
270+
271+ def AssignMaterialToMember (self , material_name : str , beamNo : list [int ]):
272+
273+ def make_safe_array_long (array ):
274+ size = len (array )
275+ return automation ._midlSAFEARRAY (ctypes .c_long ).create (array )
276+
277+ # Crear SAFEARRAY para 'beamNo'
278+ safe_list = make_safe_array_long (beamNo )
279+ beamNo = make_variant_vt_ref (safe_list , automation .VT_ARRAY | automation .VT_I4 )
280+
281+ retval = self ._property .AssignMaterialToMember (material_name , beamNo )
282+
283+ return retval
0 commit comments