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: 

(API) IRobotDisplacementData

17 REPLIES 17
SOLVED
Reply
Message 1 of 18
jokiller70
369 Views, 17 Replies

(API) IRobotDisplacementData

I am trying to read back displacement data from robot to autocad via api. How do i use the UX, UY and UZ values correctly?

 

This is the code i use;

 

            For n = 1 To 10

                hej = fe_serv.Value(bar_num, cas_num, n / 10)

                värdet = 0

                value = deplace.Value(bar_num, n / 10 - 0.1, cas_num)

                value2 = deplace.Value(bar_num, n / 10, cas_num)

 

                For j = 0 To 2

                    startpoint(j) = aPoints(Bar.StartNode, j) + (aPoints(Bar.EndNode, j) - aPoints(Bar.StartNode, j)) * (n - 1) / 10

                    endpoint(j) = aPoints(Bar.StartNode, j) + (aPoints(Bar.EndNode, j) - aPoints(Bar.StartNode, j)) * n / 10

                    newvals(j) = value.UX * mtx(j, 0) + value.UY * mtx(j, 1) + value.UZ * mtx(j, 2)

                    newvals2(j) = value2.UX * mtx(j, 0) + value2.UY * mtx(j, 1) + value2.UZ * mtx(j, 2)

                    startpoint(j) = startpoint(j) - newvals(j) * 100000 / 4

                    endpoint(j) = endpoint(j) - newvals2(j) * 100000 / 4

                Next j

 

 

                oEnt = oExpDoc.ModelSpace.AddLine(startpoint, endpoint)

                aCol = oEnt.TrueColor

                aCol.ColorMethod = NtiMonzon.Interop.Acad.AcColorMethod.acColorMethodByRGB              

                hej = fe_serv.Value(bar_num, cas_num, n / 10)

 

                värdet = hej.Smax

                kolla = System.Math.Abs(värdet / mmmax)

                If kolla > -0.01 And kolla < 0.25 Then

                    R = 0

                    G = CInt(kolla * 4 * 255 / 4)

                    B = 255

                ElseIf kolla > 0.25 And kolla < 0.5 Then

                    R = 0

                    G = 255

                    B = CInt(255 - (kolla - 0.25) * 4 * 255 / 4)

                ElseIf kolla > 0.5 And kolla < 0.75 Then

                    R = CInt((kolla - 0.5) * 4 * 255 / 4)

                    G = 255

                    B = 0

                Else

                    R = 255

                    G = CInt(255 - (kolla - 0.75) * 4 * 255 / 4)

                    B = 0

                End If

                If Me.CheckBox1.Checked = True Then oExpDoc.SendCommand("_ZOOM" & vbLf & "_E" & vbLf)

 

                aCol.ColorIndex = 180 - CInt(kolla * 17) * 10

                oEnt.TrueColor = aCol

 

                data1 = Nothing

                cas = Nothing

            Next n

 

 

17 REPLIES 17
Message 2 of 18
Rafal.Gaweda
in reply to: jokiller70

See attached example macro



Rafal Gaweda
Message 3 of 18
jokiller70
in reply to: Rafal.Gaweda

Sorry, it is the bar displacements I want to get.

Message 4 of 18
Rafal.Gaweda
in reply to: jokiller70
Message 5 of 18
Rafal.Gaweda
in reply to: jokiller70

what is wrong with RobApp.Project.Structure.Results.Bars.Displacements.Value(....) ?


Rafal Gaweda
Message 6 of 18
jokiller70
in reply to: Rafal.Gaweda

Please look at the attached dwg. I can not figure out how to translate the values so they always comes as LCS.

 

Message 7 of 18
jokiller70
in reply to: Rafal.Gaweda

This is the model i try to calculate.

Message 8 of 18
Rafal.Gaweda
in reply to: jokiller70

Have you looked at macro I had showed you?
Look at Sub PrintDisp(.....)
It converts displacements from GCS to LCS of bar


Rafal Gaweda
Message 9 of 18
jokiller70
in reply to: Rafal.Gaweda

Nu such sub in there. I figured out that i had a bar.gamma causing values to come out rotated. Still not sure if i have to include the nodal displacements to show a correct graph.

Message 10 of 18
Rafal.Gaweda
in reply to: jokiller70

Message 4 link .....


Rafal Gaweda
Message 11 of 18
Rafal.Gaweda
in reply to: jokiller70

Why do not you want to draw lines in GCS ?


Rafal Gaweda
Message 12 of 18
jokiller70
in reply to: Rafal.Gaweda

I am already doing the transformation in that macro, but when i have bar.gamma other than 0 I get strange values.

Message 13 of 18
Rafal.Gaweda
in reply to: jokiller70

Gamma angle?
It rotates section around local X of bar.


Rafal Gaweda
Message 14 of 18
jokiller70
in reply to: Rafal.Gaweda

Yes so for gamma=90 I get value.UZ as value.UY

Message 15 of 18
Rafal.Gaweda
in reply to: jokiller70

Yes , in case of one bar
If there are two or more bars meeting in one node and they have different gamma angles, different LCSes this may not be that easy I think. Try.
I suggest to use transformation matrix approach.


Rafal Gaweda
Message 16 of 18
jokiller70
in reply to: Rafal.Gaweda

Bam! Se how beautifull it looks! Again thanks alot.

 

Screenshot 2014-04-25 12.54.06.png

Message 17 of 18
Rafal.Gaweda
in reply to: jokiller70

Johan,

Congrats!
If you did not use matrix approach - check yours on inclined members


Rafal Gaweda
Message 18 of 18
jokiller70
in reply to: Rafal.Gaweda

I did use matrix approach, but had to rewrite du to different bar.gamma:s

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

Post to forums  

Autodesk Design & Make Report