It seams for now pybar is the solution which is easier to get results with.
But one day if the fem wb is ready to use even with beams an shells we are capable of calculating everything what we could model directly from CAD.

bernd
It actually is very cool. Works even for double T crosssectionsrockn wrote:Look very cool !...
yorik wrote:Yes, we could upgrade the system... It could even be pretty simple, use the same Nodes property, since we only need 2 vectors to define a plane. Then, depending on the role of the element, we show a line/polyline or a plane.
...
I had a try on this. The code use simplest integration, so not very accurate. Also it would be better to go through every edge and discretize it instead of discretize the wire.A little question that annoys me, the pybar files needs the quadratic moments from the sections of the structural members.
Code: Select all
import Part
def Moment_2(sketch):
# 1 get inner and outer wire
wires = sketch.Shape.Wires
# check boundingbox diagonals to get outer shape
diagonals = [wire.BoundBox.DiagonalLength for wire in wires]
pos = diagonals.index(max(diagonals))
# reordering
outer_wire = wires[pos]
wires.pop(pos)
wires.insert(0, outer_wire)
Ix = 0
Iy = 0
for j, wire in enumerate(wires):
pts = wire.discretize(1000)
ix = 0
iy = 0
for i, pt in enumerate(pts[:-1]):
# one point integration
midpoint = (pts[i] + pts[i + 1]) * 0.5
diff = pts[i] - pts[i + 1]
ix += midpoint.y ** 3 * diff.x / 3.
iy += midpoint.x ** 3 * diff.y / 3.
Ix += ((j == 0)*2 - 1) * abs(ix)
Iy += ((j == 0)*2 - 1) * abs(iy)
return(Ix, Iy)
a = App.ActiveDocument.Sketch
print(Moment_2(a))