Reaction, Displacement, Beam Force 외에 판요소 결과와 전체 좌표계 변위를 가져오는 함수, 그리고 가져온 표에서 최대·최소를 찾는 함수를 살펴봅니다.
이 글에서 다루는 것
・ 판요소 국부 힘 표 가져오기
・ 전체 좌표계 변위 표 가져오기
・ 표에서 최대·최소 찾기
PlateForceLocalTable(loadCaseNames, startCell, [component], [elemIds], [tableName])
DisplacementGlobalTable(loadCaseNames, startCell, [component], [nodeIds], [tableName])
GetTableExtreme(resultJson, tableName, columnName, [findMax], [idColumn])
판요소 국부 힘 표 가져오기
판요소의 국부 좌표계 힘을 조회해 시트에 바로 씁니다. 절점 평균값을 사용합니다.
・ loadCaseNames: 하중 조건 이름 배열
・ startCell: 표를 쓰기 시작할 셀
・ component: 성분 (기본 "Mxx"). Mxx, Myy, Mxy, Fxx, Fyy, Fxy, Vxx, Vyy 등
・ elemIds: 대상 요소 번호. 생략하면 전체
・ tableName: 응답에서 찾을 표 이름 (기본 "PlateForce")
Sub PlateMoment()
PlateForceLocalTable Array("DL(ST)"), Sheets("결과").Range("A1"), _
component:="Mxx"
End Sub
' 일부 요소만
PlateForceLocalTable Array("DL(ST)"), Range("A1"), _
component:="Myy", elemIds:=Array(101, 102, 103)
전체 좌표계 변위 표 가져오기
절점 변위를 전체 좌표계 기준으로 조회해 시트에 씁니다.
・ loadCaseNames: 하중 조건 이름 배열
・ startCell: 표를 쓰기 시작할 셀
・ component: 성분 (기본 "DZ"). DX, DY, DZ, RX, RY, RZ
・ nodeIds: 대상 절점 번호. 생략하면 전체
・ tableName: 응답에서 찾을 표 이름 (기본 "Displacements(Global)")
DisplacementGlobalTable Array("DL(ST)"), Range("A1")
' 수평 변위만, 특정 절점만
DisplacementGlobalTable Array("WL(ST)"), Range("A1"), _
component:="DX", nodeIds:=Array(1, 2, 3)
표에서 최대·최소 찾기
표를 시트에 쓰는 것과 별개로, 조회한 결과에서 가장 큰 값이나 작은 값 하나만 필요할 때가 있습니다. GetTableExtreme 는 그 값과 해당 번호를 Dictionary로 돌려줍니다.
・ resultJson: /post/TABLE 응답 문자열
・ tableName: 응답 안의 표 이름
・ columnName: 최대·최소를 찾을 열 이름
・ findMax: True면 최대, False면 최소 (기본 True)
・ idColumn: 함께 돌려줄 번호 열 (기본 "Elem"). 절점 표라면 "Node"
Sub MaxMoment()
Dim resultJson As String
Dim best As Object
resultJson = BeamForceTable(Array(1, 2, 3), Array("DL(ST)"), Range("A1"))
Set best = GetTableExtreme(resultJson, "BeamForce", "Moment-y")
If best.Exists("Error") Then
Debug.Print best("Error")
Else
Debug.Print "최대 모멘트 " & best("Value") & _
" (요소 " & best("Id") & ")"
End If
End Sub
찾는 열 이름이 표에 없으면 Error 열쇠에 사유가 담겨 옵니다. 값을 쓰기 전에 best.Exists("Error") 로 먼저 확인하십시오.
💡 Tip
열 이름은 표마다 다릅니다. 무엇이 있는지 모를 때는 표를 시트에 한 번 써 보고 머리글을 읽는 것이 가장 확실합니다. 그 머리글 문자열을 그대로 columnName 에 넣으면 됩니다.