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
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
Please look at the attached dwg. I can not figure out how to translate the values so they always comes as LCS.
This is the model i try to calculate.
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.
I am already doing the transformation in that macro, but when i have bar.gamma other than 0 I get strange values.
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.