Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a question about VBA from excel to Robot structural.
How can I create an bar with an section 50x100 and timber material C18.
Below I post the code what I mean. Only the code is for concrete.
Thanks.
Public Sub CommandButton2_Click() Dim Robot As New RobotApplication Robot.Project.New I_PT_FRAME_2D Robot.Project.Structure.Nodes.Create 1, Range("A2"), 0, 0 Robot.Project.Structure.Nodes.Create 2, Range("B2"), 0, 0 Robot.Project.Structure.Bars.Create 1, 1, 2 Dim Label As RobotLabel Set Label = Robot.Project.Structure.Labels.Create(I_LT_SUPPORT, "Support") Dim SupportData As RobotNodeSupportData Set SupportData = Label.Data SupportData.UX = 1 SupportData.UY = 1 SupportData.UZ = 1 SupportData.RX = 0 SupportData.RY = 0 SupportData.RZ = 0 Robot.Project.Structure.Labels.Store Label Robot.Project.Structure.Nodes.Get(1).SetLabel I_LT_SUPPORT, "Support" Robot.Project.Structure.Nodes.Get(2).SetLabel I_LT_SUPPORT, "Support" Set Label = Robot.Project.Structure.Labels.Create(I_LT_BAR_SECTION, "Beam 50*50") Dim section As RobotBarSectionData Set section = Label.Data section.ShapeType = I_BSST_CONCR_BEAM_RECT Dim concrete As RobotBarSectionConcreteData Set concrete = section.concrete concrete.SetValue I_BSCDV_BEAM_B, 0.5 concrete.SetValue I_BSCDV_BEAM_H, 0.5 section.CalcNonstdGeometry Robot.Project.Structure.Labels.Store Label Robot.Project.Structure.Bars.Get(1).SetLabel I_LT_BAR_SECTION, "Beam 50*50" Dim caseSW As RobotSimpleCase Set caseSW = Robot.Project.Structure.Cases.CreateSimple(1, "SW", I_CN_PERMANENT, I_CAT_STATIC_LINEAR) caseSW.Records.New I_LRT_DEAD Dim LoadRec As RobotLoadRecord Set LoadRec = caseSW.Records.Get(1) LoadRec.SetValue I_DRV_Z, -1 LoadRec.SetValue I_DRV_ENTIRE_STRUCTURE, True If Robot.Project.CalcEngine.Calculate = True Then MsgBox Robot.Project.Structure.Results.Bars.Forces.Value(1, 1, 0.5).MY End If End Sub
Solved! Go to Solution.