731x
004585
2020-08-04

Pregunta

¿Cómo puedo leer la distribución de carga de una carga lineal desde un cuadro combinado en RF-COM?


Respuesta:

La distribución de carga de una carga lineal se define mediante el atributo "Distribución". El atributo "Distribución" es del tipo "LoadDistributionType" y las entradas de la lista del cuadro combinado son del tipo "Cadena", por lo que se requiere la conversión de tipo. La función "GetLoadDistributionType" convierte una entrada de lista del tipo String en LoadDistributionType.

' ----------------------------------------------- -------------------------------------------------- -
Función GetLoadDistributionType (sType As String) As LoadDistributionType
' ----------------------------------------------- -------------------------------------------------- -
    
Si sType = "Concentrated2x2QType" Entonces
GetLoadDistributionType = Concentrated2x2QType
ElseIf sType = "Concentrated2xQType" Entonces
GetLoadDistributionType = Concentrated2xQType
ElseIf sType = "ConcentratedNxQType" Entonces
GetLoadDistributionType = ConcentratedNxQType
ElseIf sType = "ConcentratedType" Entonces
GetLoadDistributionType = ConcentratedType
ElseIf sType = "ConcentratedUserDefinedType" Entonces
GetLoadDistributionType = "ConcentratedUserDefinedType"
ElseIf sType = "LinearType" Entonces
GetLoadDistributionType = LinearType
ElseIf sType = "LinearXType" Entonces
GetLoadDistributionType = LinearXType
ElseIf sType = "LinearYType" Entonces
GetLoadDistributionType = LinearYType
ElseIf sType = "LinearZType" Entonces
GetLoadDistributionType = LinearZType
ElseIf sType = "ParabolicType" Entonces
GetLoadDistributionType = ParabolicType
ElseIf sType = "RadialType" Entonces
GetLoadDistributionType = RadialType
ElseIf sType = "TaperedType" Entonces
GetLoadDistributionType = TaperedType
ElseIf sType = "TrapezoidalType" Entonces
GetLoadDistributionType = TrapezoidalType
ElseIf sType = "UniformType" Entonces
GetLoadDistributionType = UniformType
ElseIf sType = "VaryingType" Entonces
GetLoadDistributionType = VaryingType
End If

End Function

El procedimiento "SetLineLoad" crea una carga lineal en la línea 1. La distribución de carga se lee en el cuadro combinado "LoadDistribution" de la hoja de cálculo de Excel "LineLoad".

' ----------------------------------------------- -------------------------------------------------- -
Sub SetLineLoads ()
' ----------------------------------------------- -------------------------------------------------- -
Dim model As RFEM5.model
Carga atenuada como RFEM5.ILoadCase
Atenuar datos (0) Como RFEM5.LineLoad
' Obtener la interfaz para el modelo
Set model = GetObject(, "RFEM5.Model")
    
' Bloquear la licencia COM y el acceso al programa
model.GetApplication.LockLicense
On Error GoTo e
' Obtener interfaz para cargas
Establecer load = model.GetLoads.GetLoadCase (0, AtIndex)
' Establecer parámetros para carga de líneas
datos (0) .No = 1
datos (0) .LineList = "1"
datos (0) .Type = ForceType
' Distribución de carga desde el cuadro combinado
data (0) .Distribution = GetLoadDistributionType (Worksheets ("LineLoad"). DropDowns ("LoadDistribution"). List (Worksheets ("LineLoad"). DropDowns ("LoadDistribution"). ListIndex))
datos (0) .Direction = LocalZType
datos (0) .DistanceA = 11
datos (0) .DistanciaB = 22
data (0) .RelativeDistances = True
datos (0) .Magnitud1 = 4000
datos (0) .Magnitud2 = 5000
datos (0) .Magnitud3 = 6000
data (0) .OverTotalLength = False
data (0) .Comment = "carga lineal 1"
' Transferir carga lineal
load.PrepareModification
load.SetLineLoads datos
load.FinishModification
    
e: If Err.Number <> 0 Then MsgBox Err.description, , Err.Source
Establecer carga = nada
' La licencia COM está desbloqueada, es posible volver a acceder al programa
model.GetApplication.UnlockLicense
Set model = Nothing


End Sub

El código fuente se puede encontrar en Descargas.

Autor

Sra. von Bloh proporciona soporte técnico a nuestros clientes y es responsable del desarrollo del programa SHAPE-THIN, así como de las estructuras de acero y aluminio.