Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API - Create a Frame Knee

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
xblanchet
1623 Views, 14 Replies

API - Create a Frame Knee

Hi

 

 

I would like to create a Frame Knee.

 

I have set up a script for this, but it always creates a Column-Beam connection.

 

Can you tell me what it is wrong in my script ?

 

Thanks in advance for the help!

 Best regards,

 

Xavier

14 REPLIES 14
Message 2 of 15

Hi @xblanchet

 

At the first glance your code should work but it cannot be checked without the example.

 

Try this:

 

Sub Button1_Click()

 

  Dim RobotApp As RobotApplication

 

  Set RobotApp = CreateObject("Robot.Application")

 

  Dim WithAngle As IRJointConnection

 

  Dim JointServer As IRJointConnectionServer

 

  Set JointServer = RobotApp.Project.Connections

  Set WithAngle = JointServer.Create(I_JCT_KNEE_BOLTED)

 

  Dim JointInfo As IRJointConnectionInfo

 

  Set JointInfo = JointServer.CreateInfo

  JointInfo.DefType = I_JCDT_STANDALONE

 

  JointInfo.Type = I_JCT_KNEE_BOLTED

  JointInfo.Name = "First connection"

  JointInfo.Number = 1

 

  WithAngle.SetToRobot JointInfo

 

 

End Sub

 

If I managed to answer your question(s) press the Accept as Solution button please. This will help other users to find solution(s) much faster. Thank you.



Artur Kosakowski
Message 3 of 15

This script is exactly the same as me.

It creates a connection "Column-beam" whearas I want a Frame-Knee.

 

Do you have any solution ?Screen shot.jpg

 

 

Message 4 of 15

Hi @xblanchet

 

Try this:

 

Sub Button1_Click()

  Dim RobotApp As RobotApplication

 

  Set RobotApp = CreateObject("Robot.Application")

 

  Dim WithAngle As IRJointConnection

 

  Dim JointServer As IRJointConnectionServer

 

  Set JointServer = RobotApp.Project.Connections

  Set WithAngle = JointServer.Create(I_JCT_KNEE_BOLTED)

 

  Dim FrameKnee As IRJointKnee

 

  Set FrameKnee = WithAngle

 

  FrameKnee.KneeType = I_JKT_BEAM2COLUMN

 

 

///////////////////////////////////////////////////////////////////////

KneeType = I_JKT_BEAM2BEAM

  

   KneeType = I_JKT_BEAM2COLUMN

 

KneeType = I_JKT_BEAM2COLUMN_CONTINUE   ( default )

//////////////////////////////////////////////////////////////////

 

 

 

  Dim JointInfo As IRJointConnectionInfo

 

  Set JointInfo = JointServer.CreateInfo

  JointInfo.DefType = I_JCDT_STANDALONE

 

  JointInfo.Type = I_JCT_KNEE_BOLTED

  JointInfo.Name = "First connection"

  JointInfo.Number = 1

 

  WithAngle.SetToRobot JointInfo

 

End Sub

 

If I managed to answer your question(s) press the Accept as Solution button please. This will help other users to find solution(s) much faster. Thank you.



Artur Kosakowski
Message 5 of 15

Hi @Artur.Kosakowski  and @xblanchet ,

I try to copy/paste this code, without changing anything but i have an error on the line

 

Set JointServer = RobApp.Project.Connections

 

Error '13':  incompatibility of typ

 

I don't understand why.

I have to optimize connection and i'm not allowed to use maximale concomitants forces. Then, i try to write a code which calculate a connection for each combinations and give me the maximal ratio of the connection.

Thanks just to explain me if i'm wrong with my 1st copy/paste ?

Sub attache()

Dim RobApp As IRobotApplication
Set RobApp = New RobotApplication
If Not RobApp.Visible Then
    Set RobApp = Nothing
    MsgBox "Open Robot and load Model", vbOKOnly, "ERROR"
    Exit Sub
End If

Dim JointServer As IRJointConnectionServer
'Problem is on the following line
Set JointServer = RobApp.Project.Connections Dim WithAngle As IRJointConnection Set WithAngle = JointServer.Create(I_JCT_ANGLE) Dim JointInfo As RJointConnectionInfo Set JointInfo = JointServer.CreateInfo JointInfo.Name = "Poteaux HEA160" JointInfo.DefType = I_JCDT_STANDALONE JointInfo.Number = 1 JointInfo.Type = I_JCT_ANGLE WithAngle.SetToRobot JointInfo End Sub

 

 

 

Message 6 of 15

Sub attache1()
  Dim RobApp As IRobotApplication
  Set RobApp = New RobotApplication
  If Not RobApp.Visible Then
    Set RobApp = Nothing
    MsgBox "Open Robot and load Model", vbOKOnly, "ERROR"
    Exit Sub
  End If

  Dim JointServer As IRJointConnectionServer
  Set JointServer = RobApp.Project.Connections

  Dim WithAngle As IRJointConnection
  Set WithAngle = JointServer.Create(I_JCT_KNEE_BOLTED)

  Dim JointInfo As RJointConnectionInfo
  Set JointInfo = JointServer.CreateInfo

  JointInfo.Name = "Poteaux HEA160"
  JointInfo.DefType = I_JCDT_STANDALONE
  JointInfo.Number = 1
  JointInfo.Type = I_JCT_KNEE_BOLTED

  ' // à ajouter
  ' ------------>
  Dim FrameKnee As IRJointKnee
  Set FrameKnee = WithAngle
  FrameKnee.KneeType = I_JKT_BEAM2COLUMN

  ' // Exemples d'initialisation des parametres de l'attache
  ' ----------------------------------------------------------------------------------
  With FrameKnee
    '// Sections
    .Column.Section = "HEA 160"
      .Beam.Section = "IPE 200"

    '// Platine
    .PlatePosition = 0
    With .Plate
      .Length = 400: .Width = 160: .Thick = 12
    End With

    '// Jarret
    .BracketLow.Height = 200

    '// Boulons
    With .Bolts
               SpH = 90
      NbV = 4: SpV = 100: .Height1 = 50: .Rows = NbV
      For i = 1 To NbV - 1: Call .SpacingV.Set(i, SpV): Next i
      Call .SpacingH.Set(1, SpH)
      .ShearPortion = I_JBSP_THREADED
    End With
  End With
  ' ---------------------------------------------------------------------------------

  WithAngle.SetToRobot JointInfo

  ' // Exemple de calcul sous efforts manuels
  ' ----------------------------------------------------------------------------------
  Dim load As New RJointKneeLoad
  With load
    .N = 500: .M = 2000: .Q = 500
  End With
  Ratio = JointServer.Calculate(1, load)
  MsgBox "Ratio =" & Int(100 * Ratio) & "%"

 

End Sub

 

Message 7 of 15

Hello Stephane, can you please translate this code to C#? I have problem with this part.

  Dim FrameKnee As IRJointKnee
  Set FrameKnee = WithAngle

Message 8 of 15

Hello Anton,

You will find a complete example with loading translated in C#.

I do not have the opportunity and the time to give more details on the options available.

// --------------------------------------------------------
// ROBOT
// --------------------------------------------------------

// To Connect Robot Structural Analysis
RobotOM.IRobotApplication Robapp = new RobotOM.RobotApplication();
if (Robapp.Visible != 0)
{
// To init and give a first example of connection parameters
// ------------------------------------------------------------------------------------------------------
// Variables
string ColSec = "HEA 160"; string BeamSec = "IPE 200"; //............................... Profile Sections
string ColMat = "S 235"; string BeamMat = "S 235"; //................................... Profile Material
string ComponentMat = "S 235"; //..................................................... Component Material
double pp = 0; double hp = 400; double bp = 160; double tp = 15; //................................ Plate
double bl_l = 300; double bl_h = 200; double bl_b = 100; double bl_tf = 10; double bl_tw = 6; //.. Haunch
double SLtf = 8; double SUtf = 8; //.......................................................... Stiffeners
string BltClass = "4.6"; string BltSize = "12"; //................................................. Bolts
long SpH = 90; int NbH = 2; //...................................................................... Cols
long SpV = 100; int NbV = 4; int h1 = 50; //........................................................ Rows

 

// Robot Connection
IRJointConnectionServer JointServer = Robapp.Project.Connections;
IRJointConnection WithAngle = JointServer.Create(IRJointConnectionType.I_JCT_KNEE_BOLTED);
RJointConnectionInfo JointInfo = JointServer.CreateInfo();

 

int JointFreeNumber = JointServer.Count + 1;
JointInfo.Number = JointFreeNumber;
JointInfo.Name = "Connection " + ColSec + "/" + BeamSec;
JointInfo.Type = IRJointConnectionType.I_JCT_KNEE_BOLTED;
JointInfo.DefType = IRJointConnectionDefType.I_JCDT_STANDALONE;

 

IRJointKnee FrameKnee = (IRJointKnee)JointServer.Create(IRJointConnectionType.I_JCT_KNEE_BOLTED);

FrameKnee = (IRJointKnee)WithAngle;
// Type
FrameKnee.KneeType = IRJointKneeType.I_JKT_BEAM2COLUMN;
// Section, Material
FrameKnee.Column.Section = ColSec; FrameKnee.Column.Material = ColMat;
FrameKnee.Beam.Section = BeamSec; FrameKnee.Beam.Material = BeamMat;
FrameKnee.DefComponentMaterial = ComponentMat;

// Eurocode
FrameKnee.CodeParamsEC32.GloblalAnalysisType = IRJointGlobalAnalysisType.I_JGAT_ELASTIC;
FrameKnee.CodeParamsEC32.FrameType = IRJointFrameType.I_JFT_SWAY;

// Plate
FrameKnee.PlatePosition = pp;
var k_Pl = FrameKnee.Plate;
k_Pl.Exist = 1;
k_Pl.Length = hp; k_Pl.Width = bp; k_Pl.Thick = tp;

// Brackets
var k_BL = FrameKnee.BracketLow;
k_BL.Exist = 1;
k_BL.Length = bl_l; k_BL.Height = bl_h; k_BL.Width = bl_b; k_BL.ThickFlange = bl_tf; k_BL.ThickWeb = bl_tw;
var k_BU = FrameKnee.BracketUp;
k_BU.Exist = 0;

// Stiffeners
FrameKnee.StiffLow.Thick = SLtf;
FrameKnee.StiffUp.Thick = SUtf;

// Bolts
var k_Blt = FrameKnee.Bolts;
k_Blt.ClassName = BltClass;
k_Blt.DiameterName = BltSize;
k_Blt.Height1 = h1;
k_Blt.EqualSpac = 1;
k_Blt.Cols = NbH; k_Blt.SpacingH.Set(1, SpH);
k_Blt.Rows = NbV; for (int i = 1; i < NbV; i++) {k_Blt.SpacingV.Set(i, SpV); }
k_Blt.ShearPortion = IRJointBoltShearPortion.I_JBSP_THREADED;

WithAngle.SetToRobot(JointInfo);

// Loads
RJointKneeLoad load = new RJointKneeLoad();
load.M = 2000;
load.N = 500;
load.Q = 500;

JointServer.Calculate(JointFreeNumber, (RJointLoad)load);
}
else
{
MessageBox.Show("Start Robot first", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}

ex.jpg

Message 9 of 15

Perfect. Works great. Thank you very much Stephane.😊

Message 10 of 15

This part: 

k_Blt.Rows = NbV; for (int i = 1; i < NbV; i++) {k_Blt.SpacingV.Set(i, SpV); }

does not work if I set NbV to more than 5. If I set it to 6 this is what I get:

Tags (2)
Message 11 of 15
antonkralj95
in reply to: antonkralj95

I found solution to my question. 

As k_Blt.SpacingV is a array, first you must set size of that array with k_Blt.SpacingV.SetSize

Message 12 of 15

yes, my code limited to an example (see previous posts) .

k_Blt.SpacingV is a array, valid if k_Blt.Rows = NbV first, with an upper limit that could be set with .SetSize(NbV-1)

it is important to stay consistent between plate dimensions and the bolt spacing so that the assembly is taken into account.

best regards

Updated 28/05/2023

Message 13 of 15

Bonjour, merci pour ces informations. Je rencontre un problème. Quand je change le nombre de rangées de boulons (nv), il remplace bien la valeur, mais dans le dimensionnement, il ne le prend pas en compte. Je dois cliquer sur appliquer pour que cela fonctionne. Il y a une possibilité pour faire cela dans le programme ? 

 

Message 14 of 15

hi @ext_julien_lebertMYQZ9 

I don’t quite understand your request. It seems that you used one of the codes above to create a first fixing. When you interact with your project's dialog box, you can modify the values.

You would like to be able to modify all or part of the input data, particularly the number of bolts, and restart the calculation.

Please keep in mind that the codes provided in the forum are meant to assist and help you understand the concepts.

Best Regards

Message 15 of 15

J'ai résolu mon problème. Je n'avais pas intégré dans mon code .SetSize et la MAJ de la fiche de calcul se faisait mal. Merci de votre réactivité.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report