Connection

Connection

durducgeorge
Contributor Contributor
700 Views
6 Replies
Message 1 of 7

Connection

durducgeorge
Contributor
Contributor

Hello,

 

Somebody know if it is possible to create in VBA or C# a connection  with its characteristics?

 

Thanks

0 Likes
701 Views
6 Replies
Replies (6)
Message 2 of 7

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

hi @durducgeorge 

you should read this topic 

https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-create-a-frame-knee/m-p/8302913

RobotApplication RobApp = new RobotApplication();
IRJointConnectionServer JointServer = RobApp.Project.Connections;
RJointConnectionInfo JointInfo = JointServer.CreateInfo();
JointInfo.DefType = IRJointConnectionDefType.I_JCDT_STANDALONE;
IRJointConnection Connection = JointServer.Create(IRJointConnectionType.I_JCT_KNEE_WELDED);
IRJointKnee KneeWelded = (IRJointKnee)Connection;
KneeWelded.Beam.Section = "IPE 300";
KneeWelded.Column.Section = "IPE 300";
Connection.SetToRobot(JointInfo);

Best Regards

 

 

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
Message 3 of 7

durducgeorge
Contributor
Contributor
Snippet

Thanks! it works!

But I want to assign to a node this connection (for example node 5, baars 4
et 2).

I get an error with my code.

Do you know where is the problem?

[image: image.png]

RobotApplication RobApp = new RobotApplication();
IRJointConnectionServer JointServer = RobApp.Project.Connections;
RJointConnectionInfo JointInfo = JointServer.CreateInfo();
JointInfo.DefType = IRJointConnectionDefType.I_JCDT_IN_STRUCTURE;
JointInfo.Type = IRJointConnectionType.I_JCT_BEAM_COLUMN;
RobotSelection robSelbar;
RobotSelection robSelNode;



IRJointConnection Connection =
JointServer.Create(IRJointConnectionType.I_JCT_KNEE_BOLTED);


IRJointKnee KneeBolted = (IRJointKnee)Connection;
KneeBolted.Beam.BarNumber = 2;


KneeBolted.Column.BarNumber = 4;



Connection.SetToRobot(JointInfo);

0 Likes
Message 4 of 7

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

hi @durducgeorge 

you're wright, it seems that the barNumber parameters for the beam and column have get and set accessors.

Best Regards

 

updated

RobotApplication RobApp = new RobotApplication();
IRJointConnectionServer JointServer = RobApp.Project.Connections;
IRJointConnection Connection = JointServer.Create(IRJointConnectionType.I_JCT_KNEE_WELDED);
int num = 1;
RJointConnectionInfo Info = JointServer.CreateInfo();
                     Info.DefType = IRJointConnectionDefType.I_JCDT_IN_STRUCTURE;
                     Info.Name = $"Knee Welded {num}";
                     Info.Number = num; Info.Node = 2; Info.Elements.FromText("1 2");
IRJointKnee Knee = (IRJointKnee)Connection;
            Knee.KneeType = IRJointKneeType.I_JKT_BEAM2COLUMN;
            Knee.BracketLow.Exist = 1;
            Knee.BracketLow.Length = 1000;
Connection.SetToRobot(Info);

 

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
Message 5 of 7

durducgeorge
Contributor
Contributor
Accepted solution

Thank you @Stephane.kapetanovic ,

 

But I've tried many times and I don't understand why I have this error.

 

Do you have some solutions that I can fix it?

 

Best regards!

 

durducgeorge_0-1727007470472.png

durducgeorge_1-1727007755569.png

 

 

0 Likes
Message 6 of 7

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

hi @durducgeorge 

The API itself is not the issue; the problem lies in the availability of the connection server. A good practice is to first ensure the structure has been analyzed and to manually create a connection in standalone mode. This will activate the server. You can then run your script to generate the connections, making sure to handle the numbering carefully.

Best Regards

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
Message 7 of 7

durducgeorge
Contributor
Contributor
Accepted solution

You are right @Stephane.kapetanovic , it works that way!

Thanks a lot!

Best regards,