(API) Soil load and moving loads

(API) Soil load and moving loads

Stephane.kapetanovic
Mentor Mentor
179 Views
0 Replies
Message 1 of 1

(API) Soil load and moving loads

Stephane.kapetanovic
Mentor
Mentor

A copy of a popular discussion thread from 2014

2/25

Dim Cas As RobotMobileCase
Dim Route As RobotMobileCaseRoute
Dim VData As RobotVehicleData

Dim PlineGeometry As RobotGeoPolyline
Set PlineGeometry = Robapp.CmpntFactory.Create(I_CT_GEO_POLYLINE)
Dim Segment As New RobotGeoSegment
Dim Object As RobotObjObject

Set Segment = Robapp.CmpntFactory.Create(I_CT_GEO_SEGMENT_LINE)
Segment.P1.Set 0, 2, 0

PlineGeometry.Add Segment
PlineGeometry.Initialize

Set Segment = Robapp.CmpntFactory.Create(I_CT_GEO_SEGMENT_LINE)
Segment.P1.Set 10, 2, 0

PlineGeometry.Add Segment
PlineGeometry.Initialize

RouteNumber = 13

Set Object = Robapp.Project.Structure.Objects.Create(RouteNumber)
Object.Main.Geometry = PlineGeometry
Object.Initialize
Object.Update



Set Cas = Robapp.Project.Structure.Cases.CreateMobile(Robapp.Project.Structure.Cases.FreeNumber, "Moving PN", I_CN_PERMANENT)
Set Route = Cas.GetRoute
Route.Geometry = RouteNumber

Dim Fac As RobotMobileCaseSegmentFactors
Set Fac = Route.GetFactors(1)
Fac.VL = 1
Fac.VR = 1
Route.SetFactors 1, Fac

Route.LoadDirection.Set 0, 0, -1

Route.Step = 1
    
Cas.SetRoute Route
' przypadek z pojazdem  z bazy standardowej

Set VLabel = Robapp.Project.Structure.Labels.Create(I_LT_VEHICLE, "Pojazd S - klasa E")
Set VData = VLabel.Data
VData.LoadFromDBase "Pojazd S - klasa E", "PN1030"
Robapp.Project.Structure.Labels.Store VLabel
        
Cas.Vehicle = "Pojazd S - klasa E"

' przypadek z pojazdem  z bazy uzytkownika
Set Cas = Robapp.Project.Structure.Cases.CreateMobile(Robapp.Project.Structure.Cases.FreeNumber, "Moving RG", I_CN_PERMANENT)
Set Route = Cas.GetRoute

Route.Geometry = RouteNumber

Set Fac = Route.GetFactors(1)
Fac.VL = 1
Fac.VR = 1
Route.SetFactors 1, Fac

Route.LoadDirection.Set 0, 0, -1
Route.Step = 1
    
Cas.SetRoute Route

Set VLabel = Robapp.Project.Structure.Labels.Create(I_LT_VEHICLE, "RG")
Set VData = VLabel.Data
VData.LoadFromDBase "RG", "RG"
Robapp.Project.Structure.Labels.Store VLabel
        
Cas.Vehicle = "RG"

' przypadek z pojazdem nie z bazy
Set Cas = Robapp.Project.Structure.Cases.CreateMobile(Robapp.Project.Structure.Cases.FreeNumber, "Moving Load Case", I_CN_PERMANENT)
Set Route = Cas.GetRoute

Route.Geometry = RouteNumber

Set Fac = Route.GetFactors(1)
Fac.VL = 1
Fac.VR = 1
Route.SetFactors 1, Fac

Route.LoadDirection.Set 0, 0, -1
Route.Step = 1
    
Cas.SetRoute Route

Set VLabel = Robapp.Project.Structure.Labels.Create(I_LT_VEHICLE, "RG111")
Set VData = VLabel.Data
Robapp.Project.Structure.Labels.Store VLabel
        
Cas.Vehicle = "RG111"

22/25

 ' vmilRoute is already create
    
     iLC = iLC + 1
        Dim C1_SR As RobotMobileCase
        Set C1_SR = robapp.Project.Structure.Cases.CreateMobile(iLC, "C1 Semi Remorque", I_CN_EXPLOATATION)
        
        'creation des vehicules
            'C1_SR
        Dim C1_SRlab As RobotLabel
        Dim C1_SR_1data As RobotVehicleData
        Dim C1_SR_2data As RobotVehicleData
        Dim C1_SR_3data As RobotVehicleData
        Dim C1_SR_4data As RobotVehicleData
        Dim C1_SR_1 As RobotVehicleLoad
        Dim C1_SR_2 As RobotVehicleLoad
        Dim C1_SR_3 As RobotVehicleLoad
        Dim C1_SR_4 As RobotVehicleLoad
    
        Set C1_SRlab = robapp.Project.Structure.Labels.Create(I_LT_VEHICLE, "C1 SR")
    
             
        Set C1_SR_1data = C1_SRlab.Data
        Set C1_SR_1 = C1_SR_1data.Loads.New
        C1_SR_1.Type = I_VLT_SURFACE
        C1_SR_1.F = Val("48") / (3.2 * 5.44) * 1000
        C1_SR_1.X = 0
        C1_SR_1.S = 0
        C1_SR_1.DX = 5.44
        C1_SR_1.DY = 3.2

        Set C1_SR_2data = C1_SRlab.Data
        Set C1_SR_2 = C1_SR_2data.Loads.New
        C1_SR_2.Type = I_VLT_CONCENTRATED
        C1_SR_2.F = Val("45") * 1000
        C1_SR_2.X = 9.22
        C1_SR_2.S = 2

        Set C1_SR_3data = C1_SRlab.Data
        Set C1_SR_3 = C1_SR_3data.Loads.New
        C1_SR_3.Type = I_VLT_CONCENTRATED
        C1_SR_3.F = Val("45") * 1000
        C1_SR_3.X = 10.58
        C1_SR_3.S = 2
    
        Set C1_SR_4data = C1_SRlab.Data
        Set C1_SR_4 = C1_SR_4data.Loads.New
        C1_SR_4.Type = I_VLT_CONCENTRATED
        C1_SR_4.F = Val("30") * 1000
        C1_SR_4.X = 13.78
        C1_SR_4.S = 2
    
        robapp.Project.Structure.Labels.Store C1_SRlab
        
        
        
        'attribution des vehicules et chemin C1_SR
        
        Set vmilRoute = C1_SR.GetRoute
        vmilRoute.Geometry = RouteNumberVmil

        Dim FactSeg As RobotMobileCaseSegmentFactors
        Set FactSeg = vmilRoute.GetFactors(1)
        FactSeg.VL = 1
        FactSeg.VR = 1
        vmilRoute.SetFactors 1, FactSeg
        
        vmilRoute.Step = 1
        vmilRoute.LoadDirection.Set 0, 0, -1
         
        C1_SR.SetRoute vmilRoute
        
        C1_SR.Vehicle = "C1 SR"

23/25

Dim PlineGeometryV1 As RobotGeoPolyline
            Set PlineGeometryV1 = robapp.CmpntFactory.Create(I_CT_GEO_POLYLINE)
            Dim SegmentV1 As RobotGeoSegment
            Dim ObjectV1 As RobotObjObject
            Dim RouteNumberV1 As Long
            
            
            x0 = 0
            For i = 0 To UBound(ltrav, 1)
                Set SegmentV1 = robapp.CmpntFactory.Create(I_CT_GEO_SEGMENT_LINE)
                SegmentV1.P1.Set x0 - (yV1 + 1.5) * Tan((biais - 100) * WorksheetFunction.Pi / 200), y0 + yV1 + 1.5, z0
                
                PlineGeometryV1.Add SegmentV1
                PlineGeometryV1.Initialize
                x0 = x0 + ltrav(i)
            Next i
            
            RouteNumberV1 = tdc.Objects.FreeNumber
            
            Set ObjectV1 = robapp.Project.Structure.Objects.Create(RouteNumberV1)
            ObjectV1.Main.Geometry = PlineGeometryV1
            ObjectV1.Initialize
            ObjectV1.Update

---------------------------------------------------------------------

For k = 0 To PlineGeometryV1.Segments.Count - 1 'pour que le vehicule passe sur tous les segments du polyligne
            Dim FactSeg As RobotMobileCaseSegmentFactors
            Set FactSeg = v1Route.GetFactors(1)
            FactSeg.VL = 1
            FactSeg.VR = 1
            v1Route.SetFactors k + 1, FactSeg
            v1Route.Step = 1
            
        Next k
        
       
        v1Route.LoadDirection.Set 0, 0, -1
        
        LM1_TS1.SetRoute v1Route

        LM1_TS1.Vehicle = "LM1 TS1"

.25

Add this command : 

 

Set VData = VLabel.Data

x = VData.Loads.Count
While x <> 0
VData.Loads.Delete (x)
x = x - 1
Wend

 

After the line : 

 

If (Cells(Row, 3).Value = "Vehicle name") Then

Set VLabel = Robapp.Project.Structure.Labels.Create(I_LT_VEHICLE, Cells(Row, 4).Value)

...

 

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
180 Views
0 Replies
Replies (0)