Eigenvectors to XLS (API)

Eigenvectors to XLS (API)

Anonymous
Not applicable
684 Views
4 Replies
Message 1 of 5

Eigenvectors to XLS (API)

Anonymous
Not applicable

Hi,

 

where i am doing mistake?image.png

0 Likes
Accepted solutions (1)
685 Views
4 Replies
Replies (4)
Message 2 of 5

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous

 

PLease try:

Dim RNDD As RobotNodeDisplacementData

then in loop
Set RNDD = Robapp.Project.Structure.Results.Nodes.Buckling.EigenVector(....


Rafal Gaweda
0 Likes
Message 3 of 5

marcinrakus
Autodesk
Autodesk
Accepted solution

Hi,

 

It seems that You do everything fine, and this may be a bug in RSA.

 

There is always a workaround - instead of EigenvectorServer You may use AnyResultServer:

 

    Dim NEWRES As RobotUniversalResultAccess
    Set NEWRES = Robapp.Project.Structure.Results.Any
    Dim ux As Double
    Dim uy As Double
    Dim uz As Double
    Dim ux2 As Double
    Dim uy2 As Double
    Dim uz2 As Double
             
    Set AllObjects = Robapp.Project.Structure.Nodes.GetAll
    
    Robapp.Project.Structure.ResultsFreeze = False
    Robapp.Project.CalcEngine.AutoFreezeResults = False
    
    For ii = 1 To AllObjects.Count
       
        Set Node = AllObjects.Get(ii)
            
        Cells(row, 2) = Node.Number
        Cells(row, 4) = Node.X
        Cells(row, 5) = Node.Y
        Cells(row, 6) = Node.Z
        
        NEWRES.Node = Node.Number
        NEWRES.LoadCase = 1
        NEWRES.Mode = mode1
        NEWRES.ResultId = 234
        ux = NEWRES.ResultValue
        NEWRES.ResultId = 235
        uy = NEWRES.ResultValue
        NEWRES.ResultId = 236
        uz = NEWRES.ResultValue
              
        Cells(row, 9) = ux
        Cells(row, 10) = uy
        Cells(row, 11) = uz
        
        NEWRES.Mode = mode2
        NEWRES.ResultId = 234
        ux2 = NEWRES.ResultValue
        NEWRES.ResultId = 235
        uy2 = NEWRES.ResultValue
        NEWRES.ResultId = 236
        uz2 = NEWRES.ResultValue
        
        Cells(row, 13) = sf * ux2 + ux
        Cells(row, 14) = sf * uy2 + uy
        Cells(row, 15) = sf * uz2 + uz
              
        row = row + 1
    Next ii

You may find refactored code in attachment.

 

Tip - be language independent:

 

            RSelection.FromText ALL
            'instead of above this should also work
            Set RSelection = Robapp.Project.Structure.Selections.CreateFull(I_OT_NODE)

Ask if any questions.

 

Regards,

Marcin

Message 4 of 5

Anonymous
Not applicable

Hi,

 

i tried that without any success, but Marcin solution works. Thank you both!

0 Likes
Message 5 of 5

Euge_I
Contributor
Contributor

So sorry, but I have tried this solution, and the results read by VBA are different  from the ones in Robot

Euge_I_0-1654763816398.png

On the other hand, the solution done by @marcinrakus does work.

 

Thanks!

 

0 Likes