I have written a script to automatically generate PBUSH properties using some common aerospace methods for calculating fastener flexibility. Each time I run it, though, it seems to crash Femap. I've tried stepping through the script one line at a time, and everything seems to work as it's supposed to until it gets to the "End Sub" line. As soon as it passes over it, Femap goes unresponsive. Is there something I'm missing?
Solved! Go to Solution.
The orient_csys.ID is not getting set properly if you leave it as whatever the default would be.
orient_csys.ID = -1
With p_pbush .type = 6 ' spring/damper property .cbush = 1 .flag(0) = orient_csys.ID ' orient csys .refCS = orient_csys.ID .pval(36) = e_f * d^2 * pi / 4 ' k_x = (EA)_bolt .pval(37) = 1 / c ' k_y = 1/c .pval(38) = 1 / c ' k_z = 1/c .Put(.ID) End With
orient_csys.ID = -1 right at the line:
Set orient_csys = App.feCSys
It appears the objects are initialized to -1 until they are initialized in the API.