Cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the distance the between shape shear center and reference point

Creator
Creator

I want or check the value of distance between the shear center and reference point for a FEMAP beam element standard shape using the following the API macro.

I assumed these values are given by .pval(52) and .pval(53)

No matter which location the reference point was set initially, the array value .pval(52) and (53) were always 0 and
CANNOT update the beam element offset to Reference point. It seems that the command ".ComputeStdShape"
always reset the reference point to location "1" before computation.

I have to define the reference point location after the ..ComputeStdShape command. But it still cannot move the
offset to the reference point unless the Properties/Shape/Change shape was manually updated again and then
.pval(52) and .pval(53) can show the value as expected.

Does anyone know what went wrong or how to modify the macro to make it work correctly?


Sub Main
'  Create beam element
'
    Dim App As femap.model
    Set App = feFemap()
    Dim material As femap.Matl
    Set material = App.feMatl
    Dim pr As Prop
    Set pr = App.feProp
    Dim nd As Node
    Set nd = App.feNode
    Dim el As Elem
    Set el = App.feElem
    Dim vw As femap.View
    Set vw = App.feView

' Set view setting
    With vw
        .Get(1)
        .Label(FVI_BEAM_ORIENT) = 3    ' "3" for draw shape.
        .Put(1)
    End With

' Create materials
    With material
        .ID = 1
        .title = "Steel"
        .type = 0                                    ' "0" for FMT_ISOTROPIC
        .mval(0) = 2.1e11        ' Young's modulus in material's X-axis, Ex (N/m2)
        .mval(6) = 0.3        ' Poisson ration in material's X-axis, Nux
        .mval(49) = 7850        ' Material density for steel (kg/m3)
        .mval(52) = 375e06        ' Limit of stress in tension (N/m2)
        .mval(54) = 375e06        ' Limit of stress in compression (N/m2)
        .mval(56) = .mval(54) / Sqr(3)    ' Limit of stress in shear (N/m2)
        .Put(.ID)                                        
    End With

' Create properties for beam element with standard shape
    Set pr = App.feProp
    With pr
        .ID = 1
        .title = "200mm x 200mm x 20mm(t) angle"
        .matlID = 1
        .type = 5            ' BEAM element type
        .flagI(1) = 11        ' Standard shape ID. "11" for L angle
        .flagI(2) = 1        ' Section Property Method for beam end A
        .pval(51) = 1        ' Standard shape reference point location
        .pval(40) = 0.2        ' DIM-1 for height (m)
        .pval(41) = 0.2        ' DIM-2 for top flange width (m)
        .pval(42) = 0        ' DIM-3 for bottom flange width (m)
        .pval(43) = 0        ' DIM-4 for top flange thickness (m)
        .pval(44) = 0.02        ' DIM-5 for bottom flange thickness (m)
        .pval(45) = 0.02        ' DIM-6 for web thickness (m)
        .pval(50) = 0        ' Cross section Y-axis's orientation
        .pval(70) = 0.3        ' Poisson ratio
        .ComputeStdShape(.flagI(1), Array(.pval(40), .pval(41), .pval(42), _
                .pval(43), .pval(44), .pval(45)), .pval(50), .flagI(2), True, True, True)
        .pval(51) = 6        ' Standard shape reference point location
        .Put(.ID)
    End With

' Create end nodes for beam element
    With nd                ' End A node
        .ID = 1            ' Point ID
        .layer = 0            ' Layer ID
        .type = 0            ' Point type
        .defCSys = 0        ' CSys ID
        .xyz = Array(0, 0, 0)        ' Coordinate vector
        .Put(.ID)
    End With
    With nd                ' End B node
        .ID = 2            ' Point ID
        .layer = 0            ' Layer ID
        .type = 0            ' Point type
        .defCSys = 0        ' CSys ID
        .xyz = Array(0, 0, 1)        ' Coordinate vector
        .Put(.ID)
    End With

' Create element for angle beam
    With el
        .ID = 1            ' ElementLine ID
        .layer = 1            ' Layer ID
        .type = 5            ' Element type, "5" for beam
        .propID = 1        ' Properties ID
        .Node(0) = 1        ' End A node ID
        .Node(1) = 2        ' End B node ID
        .orientID = 0        ' Orientation ID
        .vorient = Array(1, 0, 0)    ' Orientation vector
        .Put(.ID)
    End With

' Listing properties and element offset values
    pr.Get(1)
    App.feAppMessage(0, ".pval(16),  pval(17),  pval(52),  pval(53):  " _
        & pr.pval(16) & ",   " & pr.pval(17)  & ",       " & pr.pval(52) & ",   " & pr.pval(53) _
        & "      [ Reference point: " & pr.pval(51) & " ]")
    el.Get(1)
    App.feAppMessage(0,  "End A offset:    " & el.offset(0,0) & ",   " & el.offset(0,1) & ",   " &  el.offset(0,2))

End Sub


 

4 REPLIES

Re: How to check the distance the between shape shear center and reference point

Siemens Phenom Siemens Phenom
Siemens Phenom

Looks like you need to include a ".Put( .ID )" before ".ComputeStdShape(...) ".  Otherwise, everything you are setting with ".pval(..)" before is not updated ("put") in the FEMAP database.

 


Sub Main
'  Create beam element
'
    Dim App As femap.model
    Set App = feFemap()
    Dim material As femap.Matl
    Set material = App.feMatl
    Dim pr As Prop
    Set pr = App.feProp
    Dim nd As Node
    Set nd = App.feNode
    Dim el As Elem
    Set el = App.feElem
    Dim vw As femap.View
    Set vw = App.feView

' Set view setting
    With vw
        .Get(1)
        .Label(FVI_BEAM_ORIENT) = 3    ' "3" for draw shape.
        .Put(1)
    End With

' Create materials
    With material
        .ID = 1
        .title = "Steel"
        .type = 0                                    ' "0" for FMT_ISOTROPIC
        .mval(0) = 2.1e11        ' Young's modulus in material's X-axis, Ex (N/m2)
        .mval(6) = 0.3        ' Poisson ration in material's X-axis, Nux
        .mval(49) = 7850        ' Material density for steel (kg/m3)
        .mval(52) = 375e06        ' Limit of stress in tension (N/m2)
        .mval(54) = 375e06        ' Limit of stress in compression (N/m2)
        .mval(56) = .mval(54) / Sqr(3)    ' Limit of stress in shear (N/m2)
        .Put(.ID)
    End With

' Create properties for beam element with standard shape
    Set pr = App.feProp
    With pr
        .ID = 1
        .title = "200mm x 200mm x 20mm(t) angle"
        .matlID = 1
        .type = 5            ' BEAM element type
        .flagI(1) = 11        ' Standard shape ID. "11" for L angle
        .flagI(2) = 1        ' Section Property Method for beam end A
        .pval(51) = 1        ' Standard shape reference point location
        .pval(40) = 0.2        ' DIM-1 for height (m)
        .pval(41) = 0.2        ' DIM-2 for top flange width (m)
        .pval(42) = 0        ' DIM-3 for bottom flange width (m)
        .pval(43) = 0        ' DIM-4 for top flange thickness (m)
        .pval(44) = 0.02        ' DIM-5 for bottom flange thickness (m)
        .pval(45) = 0.02        ' DIM-6 for web thickness (m)
        .pval(50) = 0        ' Cross section Y-axis's orientation
        .pval(70) = 0.3        ' Poisson ratio
        .Put(.ID) 'Need to 'Put' to update the FEMAP data base
        rc = App.feAppUpdatePanes(True) 'Updates the Model Info Tree
        .Get(.ID)
        .ComputeStdShape(.flagI(1), Array(.pval(40), .pval(41), .pval(42), _
                .pval(43), .pval(44), .pval(45)), .pval(50), .flagI(2), True, True, True)
        .pval(51) = 6        ' Standard shape reference point location
        .Put(.ID)
    End With

' Create end nodes for beam element
    With nd                ' End A node
        .ID = 1            ' Point ID
        .layer = 0            ' Layer ID
        .type = 0            ' Point type
        .defCSys = 0        ' CSys ID
        .xyz = Array(0, 0, 0)        ' Coordinate vector
        .Put(.ID)
    End With
    With nd                ' End B node
        .ID = 2            ' Point ID
        .layer = 0            ' Layer ID
        .type = 0            ' Point type
        .defCSys = 0        ' CSys ID
        .xyz = Array(0, 0, 1)        ' Coordinate vector
        .Put(.ID)
    End With

' Create element for angle beam
    With el
        .ID = 1            ' ElementLine ID
        .layer = 1            ' Layer ID
        .type = 5            ' Element type, "5" for beam
        .propID = 1        ' Properties ID
        .Node(0) = 1        ' End A node ID
        .Node(1) = 2        ' End B node ID
        .orientID = 0        ' Orientation ID
        .vorient = Array(1, 0, 0)    ' Orientation vector
        .Put(.ID)
    End With

' Listing properties and element offset values
    pr.Get(1)
    App.feAppMessage(0, ".pval(16),  pval(17),  pval(52),  pval(53):  " _
        & pr.pval(16) & ",   " & pr.pval(17)  & ",       " & pr.pval(52) & ",   " & pr.pval(53) _
        & "      [ Reference point: " & pr.pval(51) & " ]")
    el.Get(1)
    App.feAppMessage(0,  "End A offset:    " & el.offset(0,0) & ",   " & el.offset(0,1) & ",   " &  el.offset(0,2))

End Sub

Re: How to check the distance the between shape shear center and reference point

Creator
Creator

I did try adding .put() before the .ComputeStdShape but still got the same result.

 

Also, .ComputeStdShape works without adding a.put() before it, but just keep resetting the reference point to default position "1" and disable it, but the Properties dialogue box still show Reference Point is enabled.

 

I am using version 10.3.1. Is it a known bug?

 

 

Highlighted

Re: How to check the distance the between shape shear center and reference point

Siemens Phenom Siemens Phenom
Siemens Phenom

I see the issue now.  The Cross Section Definition dialog requires manual confirmation in the GUI in order to update the reference point information.  FEMAP development is investigating this behavior.

 

Meanwhile, if you feel comfortable using a program file I may have a work-around.  Note, program files are not the best solution and requires careful execution of each command in sequence to work properly.  The API below will run a program to manually confirm the necessary dialogs.

 

(view in My Videos)

 

Here is the API:

 

Sub Main
'  Create beam element
'
    Dim App As femap.model
    Set App = feFemap()
    Dim material As femap.Matl
    Set material = App.feMatl
    Dim pr As Prop
    Set pr = App.feProp
    Dim nd As Node
    Set nd = App.feNode
    Dim el As Elem
    Set el = App.feElem
    Dim vw As femap.View
    Set vw = App.feView

' Set view setting
    With vw
        .Get(1)
        .Label(FVI_BEAM_ORIENT) = 3    ' "3" for draw shape.
        .Put(1)
    End With

' Create materials
    With material
        .ID = 1
        .title = "Steel"
        .type = 0                                    ' "0" for FMT_ISOTROPIC
        .mval(0) = 2.1e11        ' Young's modulus in material's X-axis, Ex (N/m2)
        .mval(6) = 0.3        ' Poisson ration in material's X-axis, Nux
        .mval(49) = 7850        ' Material density for steel (kg/m3)
        .mval(52) = 375e06        ' Limit of stress in tension (N/m2)
        .mval(54) = 375e06        ' Limit of stress in compression (N/m2)
        .mval(56) = .mval(54) / Sqr(3)    ' Limit of stress in shear (N/m2)
        .Put(.ID)
    End With

' Create properties for beam element with standard shape
    Set pr = App.feProp
    With pr
        .ID = 1
        .title = "200mm x 200mm x 20mm(t) angle"
        .matlID = 1
        .type = 5            ' BEAM element type
        .flagI(1) = 11        ' Standard shape ID. "11" for L angle
        .flagI(2) = 1        ' Section Property Method for beam end A
        .pval(51) = 1        ' Standard shape reference point location
        .pval(40) = 0.2        ' DIM-1 for height (m)
        .pval(41) = 0.2        ' DIM-2 for top flange width (m)
        .pval(42) = 0        ' DIM-3 for bottom flange width (m)
        .pval(43) = 0        ' DIM-4 for top flange thickness (m)
        .pval(44) = 0.02        ' DIM-5 for bottom flange thickness (m)
        .pval(45) = 0.02        ' DIM-6 for web thickness (m)
        .pval(50) = 0        ' Cross section Y-axis's orientation
        .pval(70) = 0.3        ' Poisson ratio

        .ComputeStdShape(.flagI(1), Array(.pval(40), .pval(41), .pval(42), _
                .pval(43), .pval(44), .pval(45)), .pval(50), .flagI(2), True, True, True)
        .pval(51) = 6        ' Standard shape reference point location
        .Put(.ID)
    End With

' Create end nodes for beam element
    With nd                ' End A node
        .ID = 1            ' Point ID
        .layer = 0            ' Layer ID
        .type = 0            ' Point type
        .defCSys = 0        ' CSys ID
        .xyz = Array(0, 0, 0)        ' Coordinate vector
        .Put(.ID)
    End With
    With nd                ' End B node
        .ID = 2            ' Point ID
        .layer = 0            ' Layer ID
        .type = 0            ' Point type
        .defCSys = 0        ' CSys ID
        .xyz = Array(0, 0, 1)        ' Coordinate vector
        .Put(.ID)
    End With

' Create element for angle beam
    With el
        .ID = 1            ' ElementLine ID
        .layer = 1            ' Layer ID
        .type = 5            ' Element type, "5" for beam
        .propID = 1        ' Properties ID
        .Node(0) = 1        ' End A node ID
        .Node(1) = 2        ' End B node ID
        .orientID = 0        ' Orientation ID
        .vorient = Array(1, 0, 0)    ' Orientation vector
        .Put(.ID)
    End With

        ' Use program file within API to update reference point
        prg =       "{~1458}<@11701>"+Format$( pr.ID)+"<A-M><OK><@12524><PUSH><@13006><PUSH><@12006><PUSH><OK><OK>"

        App.feFileProgramRun(False, True, False, prg)

        'Wait for program to finish running
        While App.feFileProgramRunning = FE_OK
        Wend

' Listing properties and element offset values
    pr.Get(1)
    App.feAppMessage(0, ".pval(16),  pval(17),  pval(52),  pval(53):  " _
        & pr.pval(16) & ",   " & pr.pval(17)  & ",       " & pr.pval(52) & ",   " & pr.pval(53) _
        & "      [ Reference point: " & pr.pval(51) & " ]")
    el.Get(1)
    App.feAppMessage(0,  "End A offset:    " & el.offset(0,0) & ",   " & el.offset(0,1) & ",   " &  el.offset(0,2))

End Sub

Re: How to check the distance the between shape shear center and reference point

Creator
Creator

Thanks a lot. It works as expected.