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: 

Tapered section properties with API

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
pnacht
1970 Views, 15 Replies

Tapered section properties with API

I can't figure out how to get section properties for tapered beams via API. The beam exists, so it is not an issue of creating the section, but of getting its properties.

 

The beam may be a concrete tapered beam (which only has variable height) or a steel tapered beam (where any dimension may vary).

 

In the case of concrete beams, I'm assuming one needs to use IRobotBarSectionConcreteData, but while one can get and set the tapered value (h2), I can't see how one is meant to get the intermediate section results. Is this even possible?

 

In the case of steel beams, I'd assume one has to use IRobotBarSectionNonstdData, but the IRobotBarSectionNonstdDataValue enum only contains the dimensions, not the properties*. Do I need to get these dimensions and calculate the properties myself? 

 

Also, does Robot internally adopt a linear variation of the properties or does it actually calculate the properties wherever it is necessary?

 

as oposed to IRobotBarSectionDataValue, which contains enumerations such as I_BSDV_AX, which is the area of the section (which, by the way, the Robot API documentation in the SDK folder does not list!)

Tags (2)
15 REPLIES 15
Message 2 of 16
Rafal.Gaweda
in reply to: pnacht
Message 3 of 16
pnacht
in reply to: Rafal.Gaweda

I'd already found that link, but it deals with the setting of dimensions, not the getting of them. It specifically does not deal with the getting of sections in between the start and end nodes. As well, since it deals with setting, rather than getting, it does not answer my main question of whether it is possible to get properties (area, moment of inertia, etc) for sections other than start and end points or whether I must get the dimensions and then calculate the properties myself.

As well, does Robot internally precisely calculate these properties (area, moment of inertia, etc) for every intermediate section that is necessary or does it simply consider a linear variation of the properties? After all, when dimensions change linearly, properties change polynomialy (for instance cubic, in the case of moment of inertia).

Message 4 of 16
Rafal.Gaweda
in reply to: pnacht

 whether it is possible to get properties (area, moment of inertia, etc) for sections other than start and end points 

 

Not possible in easy way.

Workaround (you can adjust table = turn off some columns before):

RobotTable t  =  r.Project.ViewMngr.CreateTable(IRobotTableType.I_TT_PROPERTIES, IRobotTableDataType.I_TDT_VALUES);  

          t.Configuration.SetFlag(IRobotTableConfigFlag.I_TCF_PROP_STD_TAPERED_SECTION, 1); 
          t.Configuration.SetValue(IRobotTableConfigValue.I_TCV_PROP_TAPERED_SECTION_COORDINATE, .4); 

          RobotTableScreenCaptureParams scp = r.CmpntFactory.Create(IRobotComponentType.I_CT_TABLE_SCREEN_CAPTURE_PARAMS);

          scp.Name = "Props"; 

          t.MakeScreenCapture(scp); 

          r.Project.PrintEngine.AddScToReport("Props");
r.Project.PrintEngine.SaveReportToOrganizer r.Project.PrintEngine.SaveReportToFile(@"c:\x.txt", IRobotOutputFileFormat.I_OFF_TEXT);

 



As well, does Robot internally precisely calculate these properties (area, moment of inertia, etc) for every intermediate section that is necessary 

 

Precise calculations.

 



Rafal Gaweda
Message 5 of 16
pnacht
in reply to: Rafal.Gaweda

Thanks Rafal, this looks promising, but the .SaveReportToFile() function is failing (returning false), regardless of the given path. I've tried using the given path (my C: drive has space), I've tried changing it to "C:\x.txt" and "x.txt" (which doesn't create it in either the program's or the model's folder), but to no avail. I don't know if this is related, but the table which appears in Robot shows all of the sections used in the model, including the properties (area, etc) at the start and end points (which are obviously different in the tapered sections), but not at the coordinate requested (0.4).

 

Also, skipping ahead a bit, would this work for tapered concrete sections (with h2)?

Message 6 of 16
Rafal.Gaweda
in reply to: pnacht

Example, corrected VBA code:

 

Private Sub CommandButton1_Click()

 

Dim RobApp As RobotApplication
Set RobApp = New RobotApplication

Dim t As RobotTable

Set t = RobApp.Project.ViewMngr.CreateTable(I_TT_PROPERTIES, I_TDT_VALUES)

t.Configuration.SetFlag I_TCF_PROP_STD_TAPERED_SECTION, 1
t.Configuration.SetValue I_TCV_POSITION_OF_DIVISION_POINT, 0.4

t.Printable.SaveToFile "c:\x.txt", I_OFF_TEXT


Set RobApp = Nothing
End Sub

 



Rafal Gaweda
Message 7 of 16
Rafal.Gaweda
in reply to: pnacht

 

Also, skipping ahead a bit, would this work for tapered concrete sections (with h2)?


Yes, the code above works fine with concrete beam tapered sections.



Rafal Gaweda
Message 8 of 16
pnacht
in reply to: Rafal.Gaweda

Thanks Rafal, I now have the file with the intermediate value at 0.40 Smiley Happy

 

 

In your first post you said I could configure the RobotTable, adding and removing columns. However, I can't figure out how to do so.

 

RobotTable has the method .AddColumn(), but that takes an int. The documentation states it is actually an IRobotTableDataType enumeration, but I don't understand how to use this to define which columns I want to add. For instance, how can I get the centroid positions (VZ and VPZ) of the beams at intermediate points? I've tried a few things and am actually thinking the documentation is wrong. For instance, I tried (on a whim) .AddColumn((int)IRobotTableDataType.I_TDT_PARA) and the column which appeared was that of Supports. I've also seen this question where you use .AddColumn() with a "magic number" int and this question where you say there is no manual for these magic numbers! Smiley Surprised Since that was last year, I am surely hoping that is no longer the case!

 

As well, I see no method to remove columns, either in RobotTable or .Configuration. Is there a hack with .AddColumn() which actually makes it remove a column or something?

Message 9 of 16
Romanich
in reply to: pnacht

Hi, your post is close to my ( is still waiting an answer Smiley Happy )

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.

Roman Zhelezniak

Robot Evangelist & Passionate Civil Structural Engineer

LinkedIn | Robot & Хобот | App Store for Robot
EESignature


Message 10 of 16
Rafal.Gaweda
in reply to: pnacht

I was too fast. You can not remove columns, columns can be added only

 

To know column number :

- manually open table , add columns you want to see

- use the code below to dump columns numbers of opened table

 

Dim RT As RobotTable
Dim RTF As RobotTableFrame
Set RTF = Robapp.Project.ViewMngr.GetTable(1)

Set RT = RTF.Get(1)
For I = 1 To RT.ColCount
   Cells(1, I) = RT.GetDataType(I)
Next I

 - use correct number(s) in RT.AddColumn in your code

 

 



Rafal Gaweda
Message 11 of 16
pnacht
in reply to: Rafal.Gaweda

Well, I just took five minutes out of my day and here's the list of every possible column for Bar Sections. Use these with RobotTable.AddColumn() and be merry.

 

23 Bar List
24 Section Name
27 AX
28 AY
29 AZ
30 IX
31 IY
32 IZ
33 HY
34 HZ
35 VY
36 VZ
37 VPY
38 VPZ
39 WX
40 WY
41 WZ
42 Surface
43 Weight/m
BOX
50 HT
51 BF
52 TF
53 TW
symmetric I-beam
54 HT
55 BF
56 TF
57 TW
asymmetrical I-beam
58 HT
59 TW
60 TF
61 TF2
62 BF
63 BF2
Tube
64 DI
65 TH
Rect
66 TH
67 BF
68 HT
DRect
913 B
914 H
915 D
---
1108 P1_L
1109 P1_T
1110 P2_L
1111 P2_T
1112 P3_L
1113 P3_T
1114 P4_L
1115 P4_T
1584 Red. IX
1510 Red. IY
1511 Red. IZ
1549 Poly_D
1550 Poly_T
1551 Poly_N

Message 12 of 16
pnacht
in reply to: Rafal.Gaweda

Also, if anyone wants to get more than one intermediate value for a beam, this method won't work, since it only allows for one value at a time.

Calling:

RobotTable.Configuration.SetValue I_TCV_POSITION_OF_DIVISION_POINT, 0.4

RobotTable.Configuration.SetValue I_TCV_POSITION_OF_DIVISION_POINT, 0.5

will only show the results for 0.5, which means that, as the function name states, this sets a single value, and doesn't add values onto a list. And given how this procedure (of creating the table, filling it up and, especially, saving the file) takes easily half a second, if you need to get values for more than one point in the bar, this function quickly becomes very expensive (I may very well need to get up to 9-10 intermediate sections, for example).

 

---

 

So I went back to trying to use the IRobotBarSectionNonstdData class and calculating the properties by hand. After a few iterations, I thought I'd figured out how to do it:

 

var b = iapp.Project.Structure.Bars.Get(8) as IRobotBar; //get the bar
var d = b.GetLabel(IRobotLabelType.I_LT_BAR_SECTION).Data as IRobotBarSectionData; //get its section data
IRobotBarSectionNonstdData non = d.CreateNonstd(0.5d); //name the point you want to find (as described below, it is seemingly useless to store the return of this function)
d.CalcNonstdGeometry(); //calculate the geometry at the named points
non = d.GetNonstd(1); //get the data post calculation
double p = non.GetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_I_B);

 Doing this, I actually got a result for p. I was thrilled. I noticed it was from the start point, but that's okay. It's because I used .GetNonstd(1) and since Robot works on 1-based indexes (why?), that's what I'd asked for. So I changed it to .GetNonstd(2), but no cigar. I got p = 0. Also, please note how to get this I had to use non = d.GetNonstd(), even though I'd already received an IRobotBarSectionNonstdData from .CreateNonstd(). That object, however, is useless and the return type of .CreateNonstd() should be void (meaning there is no need to store the data coming out of .CreateNonstd() as I did above), since .CreateNonstd() needs to be called before .CalcNonstdGeometry() but the IRobotBarSectionNonstdData only has actual data after .CalcNonstdGeometry() and is not automatically updated.

 

That being said, I'm clearly still doing something wrong, since for .GetNonstd(i) for i!=1 is giving me p = 0.

 

So how is this supposed to work? I've tried just about every combination of functions I can think of, but can't figure it out.

Message 13 of 16
Rafal.Gaweda
in reply to: pnacht

example code

 

    Dim RLabel As RobotLabel
        
    Dim RLabelData As RobotBarSectionData
    Dim RLabelNSData As RobotBarSectionNonstdData

    Set RLabel = RobApp.Project.Structure.Labels.Create(I_LT_BAR_SECTION, "my_section")
    Set RLabelData = RLabel.Data
    Set RLabelNSData = RLabelData.CreateNonstd(0)
    
    RLabelData.Type = I_BST_NS_I
    RLabelData.ShapeType = I_BSST_USER_I_BISYM
    RLabelNSData.SetValue I_BSNDV_I_B, 0.2
    RLabelNSData.SetValue I_BSNDV_I_H, 0.4
    RLabelNSData.SetValue I_BSNDV_I_TF, 0.01
    RLabelNSData.SetValue I_BSNDV_I_TW, 0.01
    
    Set RLabelNSData = RLabelData.CreateNonstd(1)
    RLabelNSData.SetValue I_BSNDV_I_B, 0.2
    RLabelNSData.SetValue I_BSNDV_I_H, 1
    RLabelNSData.SetValue I_BSNDV_I_TF, 0.01
    RLabelNSData.SetValue I_BSNDV_I_TW, 0.01
    
    RLabelData.CalcNonstdGeometry
    
    RobApp.Project.Structure.Labels.Store RLabel
    
    '''''''''''''get intermediate values
    ip = 0.4
    
    Set RLabel = RobApp.Project.Structure.Labels.Get(I_LT_BAR_SECTION, "my_section")
    Set RLabelNSData = RLabel.Data.GetNonstd(1)
    
    B1 = RLabelNSData.GetValue(I_BSNDV_I_B)
    H1 = RLabelNSData.GetValue(I_BSNDV_I_H)
    tf1 = RLabelNSData.GetValue(I_BSNDV_I_TF)
    tw1 = RLabelNSData.GetValue(I_BSNDV_I_TW)
    
    Set RLabelNSData = RLabelData.GetNonstd(2)
    
    B2 = RLabelNSData.GetValue(I_BSNDV_I_B)
    H2 = RLabelNSData.GetValue(I_BSNDV_I_H)
    tf2 = RLabelNSData.GetValue(I_BSNDV_I_TF)
    tw2 = RLabelNSData.GetValue(I_BSNDV_I_TW)
    
    bi = B1 + (B2 - B1) * ip
    hi = H1 + (H2 - H1) * ip
    tfi = tf1 + (tf2 - tf1) * ip
    twi = tw1 + (tw2 - tw1) * ip
    
    '''''''''''''new section with intermediate data
    Dim RLabelN As RobotLabel
        
    Dim RLabelDataN As RobotBarSectionData
    Dim RLabelNSDataN As RobotBarSectionNonstdData

    Set RLabelN = RobApp.Project.Structure.Labels.Create(I_LT_BAR_SECTION, "my_section_N")
    Set RLabelDataN = RLabelN.Data
    Set RLabelNSDataN = RLabelDataN.CreateNonstd(0)
    
    RLabelDataN.Type = I_BST_NS_I
    RLabelDataN.ShapeType = I_BSST_USER_I_BISYM
    RLabelNSDataN.SetValue I_BSNDV_I_B, bi
    RLabelNSDataN.SetValue I_BSNDV_I_H, hi
    RLabelNSDataN.SetValue I_BSNDV_I_TF, tfi
    RLabelNSDataN.SetValue I_BSNDV_I_TW, twi
    RLabelDataN.CalcNonstdGeometry
    
    RobApp.Project.Structure.Labels.Store RLabelN
    
    Set RLabelN = RobApp.Project.Structure.Labels.Get(I_LT_BAR_SECTION, "my_section_N")
    Set RLabelDataN = RLabelN.Data
    
    Ix = RLabelDataN.GetValue(I_BSDV_IX)
    Iy = RLabelDataN.GetValue(I_BSDV_IY)
    Iz = RLabelDataN.GetValue(I_BSDV_IZ)

 



Rafal Gaweda
Message 14 of 16
pnacht
in reply to: Rafal.Gaweda

OK Rafal, I've confirmed that using .GetNonstd(1) returns the values for the start node and (if there are no .CreateNonstd() calls) .GetNonstd(2) returns the values for the end node. Should I take your code to mean then that, indeed, one cannot get the intermediate section dimensions from Robot, having to do the interpolation oneself?

Message 15 of 16
Rafal.Gaweda
in reply to: pnacht

Use my code.


Rafal Gaweda
Message 16 of 16
boriss.cerkasins
in reply to: pnacht

Hello,
Trying to get section dimensions in dynamo. Code is failing when it reaches the highlighted line. I am getting System.ComObject just can't figure out how to query it to get the dims. Which command should I use to get standard ones?
Thanks!

borisscerkasins_0-1623772064587.png

 

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

Post to forums  

Autodesk Design & Make Report