(API) Take forces with characteristic points

(API) Take forces with characteristic points

eng_leandromartins
Enthusiast Enthusiast
2,430 Views
28 Replies
Message 1 of 29

(API) Take forces with characteristic points

eng_leandromartins
Enthusiast
Enthusiast

Hello everyone,

I searched other topics but every time I found something similar the topic was closed because it was too old.

I would like to use API to automatically transfer the results in the image below to Excel.

Capturar.PNG

 

I thank you in advance! 

0 Likes
2,431 Views
28 Replies
Replies (28)
Message 21 of 29

HoshangMustafa
Advisor
Advisor

@Stephane.kapetanovic 

you stated:

hi @eng_leandromartins 

sometimes, column indexes are provided on the forum; other times, you may need to search for them yourself or develop a bot.

If you can't find them, it's best to ask here.

Best Regards

What do you mean by this phrase "bot"?

Best regards

 

0 Likes
Message 22 of 29

Stephane.kapetanovic
Mentor
Mentor

Hi @HoshangMustafa

I still don't see how I can help you. 

'bot' means a program that performs a search for you. In this case, look up the column indexes to make a dictionary. 

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 23 of 29

eng_leandromartins
Enthusiast
Enthusiast

Hi @Stephane.kapetanovic 
eng_leandromartins_0-1742246096638.png

Do you know why when I put "Combinations", where indicated it doesn't select any combination?

0 Likes
Message 24 of 29

hi @eng_leandromartins 

if you use a working and editing language in Brazilian, you can choose ‘TOD’ instead of ‘all’.

Key (Integer) Part 1 Part 2 Part 3 Country
1 ALL to By United States
33 TOU A P France
34 TOD A CA España (Spain)
39 TUT a P Italia (Italy)
40 ALL la By Romania (Romania)
44 ALL to By Great Britain
48 WSZ do K Polska (Poland)
49 ALL bis S Deutschland (Germany)
55 TOD para Por Brasil (Brazil)
70 все до Через Russia
81 ALL to By Japan
86 全部 BY China

 

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 25 of 29

eng_leandromartins
Enthusiast
Enthusiast

Sorry, @Stephane.kapetanovic I wasn't very clear.
I want to select Combinations only. When I put "Combinations", it doesn't select any Combinations.
I'm working with the English language.

eng_leandromartins_0-1742300362673.png

 

0 Likes
Message 26 of 29

Accepted solution

hi @eng_leandromartins 

not knowing what type of combinations, you will have to adapt the code.

Sub SelectionAllCombinationsAPI()
  Dim RobApp As RobotApplication, Selections As RobotSelectionFactory
  Set RobApp = New RobotApplication
  
  Set Selections = RobApp.Project.Structure.Selections
  For Each Typ In Array(I_PS_CASE_COMBINATIONS, I_PS_CASE_CODE_COMBINATIONS)
    Txt = Txt & Selections.CreatePredefined(Typ).ToText & " "
  Next
  Debug.Print Trim(Txt)
  Set RobApp = Nothing
End Sub

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 27 of 29

eng_leandromartins
Enthusiast
Enthusiast
Accepted solution

Thank you,
It worked perfectly.
I'll leave the code in C# below for those interested.

IRobotApplication robotApp = new RobotApplication();
RobotSelectionFactory selections = robotApp.Project.Structure.Selections;
string txt = String.Empty;
foreach (var typ in new object[] {IRobotPredefinedSelection.I_PS_CASE_COMBINATIONS})
{
    txt += selections.CreatePredefined((IRobotPredefinedSelection)typ).ToText() + " ";
}
robotTable.Select(IRobotSelectionType.I_ST_BAR, "all");
robotTable.Select(IRobotSelectionType.I_ST_CASE, txt.Trim());
Message 28 of 29

Accepted solution
RobotSelectionFactory selections = robotApp.Project.Structure.Selections;
robotTable.Select(IRobotSelectionType.I_ST_BAR, "all");
robotTable.Select(IRobotSelectionType.I_ST_CASE,
    selections.CreatePredefined(IRobotPredefinedSelection.I_PS_CASE_COMBINATIONS).ToText());

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

Stephane.kapetanovic
Mentor
Mentor

a simpler solution to find column indexes for your programs.

Header Explorer - Stop searching for where to find column indexes in Robot Structural Analysis 

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