- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have developed the following code which generates a cladding in vba
Option Explicit
Sub DrawCladdings_Skeleton()
Dim RobApp As New RobotApplication
'Check if Robot is running
If RobApp.Visible = False Then '
MsgBox ("OPEN ROBOT FIRST!")
Exit Sub
End If
RobApp.Project.New I_PT_SHELL
RobApp.Interactive = False
'Draw the claddings
Dim monobjet As RobotObjObject
Dim moncontour As New RobotGeoContour
Dim monsegment() As New RobotGeoSegmentLine
'Start of loop
ReDim monsegment(1 To 4)
monsegment(1).P1.Set 0, 0, 0
moncontour.Add monsegment(1)
monsegment(2).P1.Set 1, 0, 0
moncontour.Add monsegment(2)
monsegment(3).P1.Set 1, 1, 0
moncontour.Add monsegment(3)
monsegment(4).P1.Set 0, 1, 0
moncontour.Add monsegment(4)
moncontour.Initialize
Set monobjet = RobApp.Project.Structure.Objects.Create(1)
monobjet.Main.Geometry = moncontour
monobjet.Main.Attribs.Meshed = False
monobjet.Main.Attribs.DirZ = 0 ' axe local
monobjet.Main.Attribs.SetDirX I_OLXDDT_CARTESIAN, 1, 0, 0
monobjet.Initialize
monobjet.Update
Dim rbar As Variant
Set rbar = RobApp.Project.Structure.Bars.Get(1)
rbar.SetLabel RobotOM.IRobotLabelType.I_LT_CLADDING, "Two-way"
moncontour.Clear
Set monobjet = Nothing
Set moncontour = Nothing
ReDim monsegment(1 To 1)
Set monsegment(1) = Nothing
'End of loop
RobApp.Interactive = True
End Sub
I want to apply a uniform load, but I couldn't find something similar. Any help would be greatly appreciated. Thanks in advance.
Solved! Go to Solution.