API: NON LINEAR HINGE DEFINITION

API: NON LINEAR HINGE DEFINITION

StefanoPasquini6790
Advisor Advisor
439 Views
2 Replies
Message 1 of 3

API: NON LINEAR HINGE DEFINITION

StefanoPasquini6790
Advisor
Advisor

Good Morning Artur and Rafal,

it exist the possibility to definine properties of non linear hinge in excel and assign it to a bar in Robot via API?

 

Thanks to the lockdown, I'm back to work over PushOver in Robot, and I'm studying a fast way to set up the process.

 

Thanks in advance, and have a safe and good day.

 


PasProStudio

www.pasquiniprogetti.eu

Structural + Detailing engineers
440 Views
2 Replies
Replies (2)
Message 2 of 3

rsousa_
Advocate
Advocate

Good morning, 

 

The question is not for me, but i think the answer is yes. 

I have a similar spreadsheet for non-linear supports and the workflow is basicly the same. 

rsousa__0-1604399359154.png

I have non-linear functions for UX, UY, UZ and so on and i've tested the following code:

 

 

Private Sub CommandButton1_Click()
Dim RobApp As RobotApplication
Set RobApp = New RobotApplication
RobApp.Interactive = False

Dim i As Integer, j As Integer, k As Integer
i = 1
j = 0
Dim aux As Double
Dim myBarRD As RobotBarReleaseData
Dim mylabel As RobotLabel
    Dim mynlm2positive As RobotNonlinearLinkParamsCustom
    Dim mynlm2negative As RobotNonlinearLinkParamsCustom
    Dim mynlmCS As RobotNonlinearLinkParamsCustomSegment
    Dim myNLM As RobotNonlinearLink

Do While Cells(9 * i - 6, 1) <> ""
Set mylabel = RobApp.Project.Structure.Labels.Create(I_LT_BAR_RELEASE, "apoio_no_" + CStr(Cells(9 * i - 6, 1)))
Set myBarRD = mylabel.Data

' Direction UX
If Cells(9 * i - 6, 3) + Cells(9 * i - 5, 3) + Cells(9 * i - 4, 3) + Cells(9 * i - 3, 3) + Cells(9 * i - 1, 3) + Cells(9 * i, 3) + Cells(9 * i + 1, 3) + Cells(9 * i + 2, 3) <> 0 Then

    
    Set myNLM = RobApp.Project.Structure.Nodes.NonlinearLinks.Create(CStr(Cells(9 * i - 6, 1)) + "_UX")
    myNLM.SetCurveType I_NLCT_CUSTOM
    Set mynlm2negative = myNLM.GetParams(2)
    Set mynlm2positive = myNLM.GetParams(1)
    myNLM.SetParams mynlm2negative, 2 'in order to set symetry to false
'    MsgBox myNLM.Symetry

' Define positive values of non-linear diagram
j = 1
For k = 9 * i - 2 To 9 * i + 2
If Cells(k, 3) = "" Then Exit For
    Set mynlmCS = mynlm2positive.New()
    aux = Cells(k, 4).Value * 1000
    mynlmCS.OriginPoint = Cells(k, 3).Value / 100#
    mynlmCS.Expression = aux
    mynlmCS.Constant = False
    mynlm2positive.Set j, mynlmCS
    j = j + 1
Next

myNLM.SetParams mynlm2positive, 1

' Define negative values of non-linear diagram
j = 1
For k = 9 * i - 2 To 9 * i - 6 Step -1
If Cells(k, 3) = "" Then Exit For
    Set mynlmCS = mynlm2negative.New()
    aux = Cells(k, 4).Value * 1000
    mynlmCS.OriginPoint = Cells(k, 3).Value / 100#
    mynlmCS.Expression = aux
    mynlmCS.Constant = False
    mynlm2negative.Set j, mynlmCS
    j = j + 1
Next

myNLM.SetParams mynlm2negative, 2

' assign non linear model to support
myBarRD.EndNode.NonlinearModel.Set I_DOF_UX, CStr(Cells(9 * i - 6, 1)) + "_UX"
RobApp.Project.Structure.Labels.Store mylabel
Else

End If


Dim selectionBars As RobotSelection
Set selectionBars = RobApp.Project.Structure.Selections.Get(I_OT_BAR)
selectionBars.FromText CStr(Cells(9 * i - 6, 2))
RobApp.Project.Structure.Labels.Store mylabel
RobApp.Project.Structure.Bars.SetLabel selectionBars, I_LT_BAR_RELEASE, mylabel.Name

i = i + 1
Loop

RobApp.Interactive = True
Set RobApp = Nothing
MsgBox ("The End!")
End Sub

 

 

In the example it is applying the non-linear model only at end-node and non-linear function for UX but i think you can get the picture. Sorry for the lazzy code...

The result of this code is something like this:

rsousa__0-1604400522365.png

 

 

Kind regards

Message 3 of 3

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @StefanoPasquini6790 

 

According to documentation it should be possible

 

hinges.jpg

 

Good Luck !



Rafal Gaweda
0 Likes