Discussion Groups

Robot Structural Analysis

Reply
Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011
Accepted Solution

VBA loads - API

769 Views, 44 Replies
11-18-2011 01:49 AM

I create a sub which define loads on a pannel but it's doesn't work.

 

Can you have a look ?

 

 

 

Public typecharge As String
Public casdecharge As String
Public valeurcharge As Double
Public x_1 As Double
Public y_1 As Double
Public z_1 As Double
Public x_2 As Double
Public y_2 As Double
Public z_2 As Double
Public x_3 As Double
Public y_3 As Double
Public z_3 As Double
Public x_4 As Double
Public y_4 As Double
Public z_4 As Double

 

 

 

Public Sub charges()
'trotoirs
typecharge = I_CN_PERMANENT
casdecharge = "Equipements"
valeurcharge = 5.5
x_1 = 0.000
y_1 = 0.000
z_1 = 0.000
x_2 = 75.480
y_2 = 0.000
z_2 = 0.000
x_3 = 76.143
y_3 = 1.600
z_3 = 0.000
x_4 = 0.663
y_4 = 1.600
z_4 = 0.000
Call chargement_panneau_contour

End Sub

 

 

Sub chargement_panneau_contour()

    Dim cas As RobotSimpleCase
    Dim recs As RobotLoadRecordMngr
    Dim rec_1 As RobotLoadRecordInContour
    Set cas = robapp.Project.Structure.Cases.CreateSimple(robapp.Project.Structure.Cases.FreeNumber, _
casdecharge, typecharge, I_CAT_STATIC_LINEAR)
    Set recs = cas.Records
    
' pression uniforme horizontale appliquée au contour
' définition des contours
    i = recs.New(I_LRT_IN_CONTOUR)
    
' création d'une nouvel enregistrement
    Set rec_1 = recs.Get(i)
    
' définition du plan de charge
    rec_1.Objects.FromText "1"
    rec_1.SetValue I_ICRV_PX1, 0
    rec_1.SetValue I_ICRV_PY1, 0
    rec_1.SetValue I_ICRV_PZ1, -valeurcharge
    rec_1.SetValue I_ICRV_PX2, 0#
    rec_1.SetValue I_ICRV_PY2, 0#
    rec_1.SetValue I_ICRV_PZ2, -valeurcharge
    rec_1.SetValue I_ICRV_PX3, 0#
    rec_1.SetValue I_ICRV_PY3, 0#
    rec_1.SetValue I_ICRV_PZ3, -valeurcharge
    
    ' sens de projection des efforts
    rec_1.SetValue I_ICRV_PROJECTION, 1

    ' nombre de points composant le contour
    rec_1.SetValue I_ICRV_NPOINTS, 4
    rec_1.SetValue I_ICRV_LOCAL, 0

    ' définition des points sur le panneau
    rec_1.SetPoint 1, 0, 0, 0
    rec_1.SetPoint 2, 1, 1, 0
    rec_1.SetPoint 3, 1, 0, 0

    rec_1.SetContourPoint 1, x_1, y_1, z_1
    rec_1.SetContourPoint 2, x_2, y_2, z_2
    rec_1.SetContourPoint 3, x_3, y_3, z_3
    rec_1.SetContourPoint 4, x_4, y_4, z_4
    
    rec_1.SetVector 0, 0, 1

    Set recs = Nothing
    Set rec_1 = Nothing
    Set cas = Nothing
  
End Sub

 

Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011

Re: VBA loads

11-18-2011 04:33 AM in reply to: mateaus

For the 

 rec_1.SetValue I_ICRV_PZ1, valeurcharge * 1000

Problem solved (it's because I had to multiply by 1000)

 

For the selection of panels

 

My problem is that it's not a selection automatic (of panels).

 

I think the command I need it's like 

 

rec_1.Objects.???? 'automatic

Product Support
5,704 Posts
1,303 Kudos
Registered: ‎04-26-2010

Re: VBA loads

11-18-2011 05:03 AM in reply to: mateaus

Some bugs should be corected as shown below :

 

Public typecharge As Integer

 

Sub chargement_panneau_contour()

Set RobApp = New RobotApplication    ' or activate somewhere else robotapplication

 

rec_1.Objects.FromText "30to36"



Rafal Gaweda
Product Support
5,704 Posts
1,303 Kudos
Registered: ‎04-26-2010

Re: VBA loads

11-18-2011 05:20 AM in reply to: mateaus

mateaus wrote:

For the 

 rec_1.SetValue I_ICRV_PZ1, valeurcharge * 1000

Problem solved (it's because I had to multiply by 1000)

 

Keep in mind - you are using SI units (N,m) in API dirrectly 


 

For the selection of panels

 

My problem is that it's not a selection automatic (of panels).

 

I think the command I need it's like 

 

rec_1.Objects.???? 'automatic

 

 

 only:  rec_1.Objects.FromText "all"       

/ if french  robot version used please use french text syntax:     rec_1.Objects.FromText "tous"

ALL selects all objects



Rafal Gaweda
Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011

Re: VBA loads

11-21-2011 01:24 AM in reply to: Rafal.Gaweda

Ok thank you,

 

I have 3 combinations number 20 21 22 and I want to have the max and the min of moments :

 

for example Mxx+ and Myy-

 

example

 

What is the code to display it ?

 

 

Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011

Re: VBA loads

11-22-2011 03:01 AM in reply to: mateaus

up

Product Support
5,704 Posts
1,303 Kudos
Registered: ‎04-26-2010

Re: VBA loads

11-22-2011 03:13 AM in reply to: mateaus

Display on Map or just find  to have it for further use?



Rafal Gaweda
Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011

Re: VBA loads

11-22-2011 04:14 AM in reply to: Rafal.Gaweda

Display on map please

Product Support
5,704 Posts
1,303 Kudos
Registered: ‎04-26-2010

Re: VBA loads

11-22-2011 06:37 AM in reply to: mateaus

Unfortunatelly it is not posible to dispplay only max \ min on map thru API

 

mavueRobot.ParamsFeMap.WithDescription = True  ' this is the only one settings for maps description



Rafal Gaweda
Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011

Re: VBA loads

11-22-2011 08:20 AM in reply to: Rafal.Gaweda

Can we select many combinations in the same time and ask for a display of Mxx+ for example ?

 

It will display the maximum normally ?