Robot Structural Analysis General Discussion

Robot Structural Analysis General Discussion

Reply
Advocate
120 Posts
Post 1 of 45
Accepted Solution

VBA loads - API

802 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

 


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

Set Recs = SimpleCase.Records

I = Recs.New(I_LRT_BAR_TRAPEZOIDALE)
Set Rec = Recs.Get(I)
Rec.Objects.FromText BarNumber


 Rec.SetValue I_BTRV_LOCAL, -1 ' or global


Rec.SetValue I_BTRV_RELATIVE, -1 ' or real

 

'Select Case Direction

'Case "fx"
Rec.SetValue I_BTRV_PX1, value_x1
Rec.SetValue I_BTRV_X1, pos_x1
Rec.SetValue I_BTRV_PX2, value_x2
Rec.SetValue I_BTRV_X2, pos_x2
'Case "fy"
Rec.SetValue I_BTRV_PY1, value_y1
Rec.SetValue I_BTRV_X1, pos_x1
Rec.SetValue I_BTRV_PY2, value_y2
Rec.SetValue I_BTRV_X2, pos_x2
'Case "fz"
Rec.SetValue I_BTRV_PZ1, value_z1
Rec.SetValue I_BTRV_X1, pos_x1
Rec.SetValue I_BTRV_PZ2, value_z2
Rec.SetValue I_BTRV_X2, pos_x2
'End Select

Take a look at reservior_test.xls example you have.

 

 Dim monobjet As RobotObjObject
Dim moncote As RobotObjEdge
Dim sup As IRobotLabel
Dim sup_data As IRobotNodeSupportData
Set sup = robapp.Project.Structure.Labels.Create(I_LT_SUPPORT, "mon_appuis_1")
Set sup_data = sup.Data
' definition des appuis
sup_data.SetFixed I_NSFD_UX, True
sup_data.SetFixed I_NSFD_UY, False
sup_data.SetFixed I_NSFD_UZ, False
sup_data.SetFixed I_NSFD_RX, False
sup_data.SetFixed I_NSFD_RY, True
sup_data.SetFixed I_NSFD_RZ, True
robapp.Project.Structure.Labels.Store sup
Set monobjet = robapp.Project.Structure.Objects.Get(2)
Set moncote = monobjet.Main.Edges.Get(4)
moncote.SetLabel I_LT_SUPPORT, "mon_appuis_1"
monobjet.Update

 

You have object 3 edge 17.

 

Object 17 , edge 3 - below

 

Set monobjet = RobApp.Project.Structure.Objects.Get(17)
Set moncote = monobjet.Main.Edges.Get(3)

Advocate
120 Posts
Post 2 of 45

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

Autodesk Support
6941 Posts
1487 Kudos
1301 Solutions
Post 3 of 45

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
Autodesk Support
6941 Posts
1487 Kudos
1301 Solutions
Post 4 of 45

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
Advocate
120 Posts
Post 5 of 45

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 ?

 

 

Advocate
120 Posts
Post 6 of 45

Re: VBA loads

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

up

Autodesk Support
6941 Posts
1487 Kudos
1301 Solutions
Post 7 of 45

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
Advocate
120 Posts
Post 8 of 45

Re: VBA loads

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

Display on map please

Autodesk Support
6941 Posts
1487 Kudos
1301 Solutions
Post 9 of 45

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
Advocate
120 Posts
Post 10 of 45

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 ?

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post