API Spectral Eccentricity Access

API Spectral Eccentricity Access

WALIDGIO
Advocate Advocate
393 Views
4 Replies
Message 1 of 5

API Spectral Eccentricity Access

WALIDGIO
Advocate
Advocate

Hi,
I'm working on automating spectrum entry in Robot Structural Analysis. Below is the complete code I’ve written to help our community in the future.
Recently, in the latest RSA version, a new feature was added to seismic cases (eccentricity, as shown in the image). However, I couldn’t find a way to access this feature via the API.
Does anyone know if it has been implemented in the API? If not, how can we contact the development team to request its implementation?
Thank you!


WALIDGIO_0-1737470048068.png

 

 

 

 

Sub GenerateSpectralCases2()
    ' Declare and initialize the Robot application variable
    Dim robApp As IRobotApplication
    Set robApp = New RobotApplication

    ' Declare variables for Robot case and parameters
    Dim RobotServerCas As RobotCaseServer
    Dim SpectralParams As RobotSpectralAnalysisParams
    Dim SpectralParamsSpectrum As RobotSpectralAnalysisSpectrum
    Dim SpectrumPoints As Collection
    ' Get the collection of load cases
    Dim SpectralCase As RobotSimpleCase
    Set RobotServerCas = robApp.Project.Structure.Cases
    ' Get the first free number for spectrum cases
    Dim SpectrumCaseFreeNumber As Long
    SpectrumCaseFreeNumber = RobotServerCas.FreeNumber

    'Amplification Factor
    Dim xFactor As Integer
    Dim yFactor As Integer
    Dim zFactor As Integer
     xFactor = 1
     yFactor = 1
     zFactor = 1

    ' Initialize the points collection
    Set SpectrumPoints = New Collection
    ' Populate the points collection (example: 10 points)
    SpectrumPoints.Add Array(0.1, 0.02)
    SpectrumPoints.Add Array(0.2, 0.04)
    SpectrumPoints.Add Array(0.3, 0.06)
    SpectrumPoints.Add Array(0.4, 0.08)
    SpectrumPoints.Add Array(0.5, 0.1)
    SpectrumPoints.Add Array(0.6, 0.18)
    SpectrumPoints.Add Array(0.7, 0.06)
    SpectrumPoints.Add Array(0.8, 0.04)
    SpectrumPoints.Add Array(0.9, 0.02)
    SpectrumPoints.Add Array(1#, 0.01)
    
    ' ---- Create Spectral Case for X Direction ----
    Set SpectralCase = RobotServerCas.CreateSimple(SpectrumCaseFreeNumber, "Spectrale Dir. masses X", I_CN_SEISMIC, I_CAT_DYNAMIC_SPECTRAL)
    Set SpectralParams = SpectralCase.GetAnalysisParams
    Set SpectralParamsSpectrum = SpectralParams.Spectrum
    ' Clear existing points and add new points from the collection
    Call AddPointsToSpectrum(SpectralParamsSpectrum, SpectrumPoints)
    ' Set additional spectrum parameters
    SpectralParams.Spectrum.name = "SpectrumRPA24-X" 'Name the case "we could do it in the creation"
    SpectralParams.Spectrum.Damping = 0.1 'Apply Dumping "l'Amortissement"
    SpectralParams.Spectrum.AbscissaXAxis = I_SAAXAT_PERIOD ' Set X-axis type (Period)
    SpectralParams.Spectrum.OrdinateYAxis = I_SAOYAT_ACCELERATION ' Set Y-axis type (Acceleration)
    SpectralParams.ExcitationDir.X = 9.81 * xFactor ' Apply the direction of the force
    SpectralParams.ExcitationDir.Y = 0
    SpectralParams.ExcitationDir.Z = 0
    ' Apply the Spectrale Parameters to the case
    SpectralCase.SetAnalysisParams SpectralParams
    
    ' ---- Create Spectral Case for Z Direction ----
    Set SpectralCase = RobotServerCas.CreateSimple(SpectrumCaseFreeNumber + 1, "Spectrale Dir. masses Y", I_CN_SEISMIC, I_CAT_DYNAMIC_SPECTRAL)
    Set SpectralParams = SpectralCase.GetAnalysisParams
    Set SpectralParamsSpectrum = SpectralParams.Spectrum
    ' Clear existing points and add new points from the collection
    Call AddPointsToSpectrum(SpectralParamsSpectrum, SpectrumPoints)
    ' Set additional spectrum parameters
    SpectralParamsSpectrum.name = "SpectrumRPA24-Y"
    SpectralParams.ExcitationDir.X = 0
    SpectralParams.ExcitationDir.Y = 9.81 * yFactor '
    SpectralParams.ExcitationDir.Z = 0
    ' Apply the Spectrale Parameters to the case
    SpectralCase.SetAnalysisParams SpectralParams
    
    ' ---- Create Spectral Case for Z Direction ---- "If needed"
    Set SpectralCase = RobotServerCas.CreateSimple(SpectrumCaseFreeNumber + 2, "Spectrale Dir. masses Z", I_CN_SEISMIC, I_CAT_DYNAMIC_SPECTRAL)
    Set SpectralParams = SpectralCase.GetAnalysisParams
    Set SpectralParamsSpectrum = SpectralParams.Spectrum
    ' Clear existing points and add new points from the collection
    Call AddPointsToSpectrum(SpectralParamsSpectrum, SpectrumPoints)
    ' Set additional spectrum parameters
    SpectralParamsSpectrum.name = "SpectrumRPA24-Z"
    SpectralParams.ExcitationDir.X = 0
    SpectralParams.ExcitationDir.Y = 0
    SpectralParams.ExcitationDir.Z = 9.81 * zFactor
    ' Apply the Spectrale Parameters to the case
    SpectralCase.SetAnalysisParams SpectralParams

    ' ---- Notify the user ----
    MsgBox "Spectral cases created successfully!", vbInformation, "Success"
End Sub

 

0 Likes
394 Views
4 Replies
  • API
Replies (4)
Message 2 of 5

Stephane.kapetanovic
Mentor
Mentor

See the full thread here.

https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-accessing-spectrum-points-keeps-s...

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

Stephane.kapetanovic
Mentor
Mentor

....

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

WALIDGIO
Advocate
Advocate

hi @Stephane.kapetanovic 
in this thread i want to know if there's a way to access the eccentricity by API, i did accessed to all the other parameter but for the eccentricity i can't find it

0 Likes
Message 5 of 5

Stephane.kapetanovic
Mentor
Mentor

Never tried.

Let's wait for an update to the API's case and spectrum definition classes to align with the new seismic codes using spectral calculations.

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