AM BC Command Snippet
Select 3 mesh nodes in the graphics, scope to your Static Structural analysis and run the script! This will automatically create suggested BCs for the Removal Step in the AM Process simulation.
structural_analysis = Tree.FirstActiveObject
command_snippet = structural_analysis.AddCommandSnippet()
command_snippet.StepSelectionMode = SequenceSelectionType.Identifier
for prop in command_snippet.VisibleProperties:
try:
if 'Build Step' in prop.StringValue:
continueIter = True
counter = 1
while continueIter:
prop.InternalValue = prop.InternalValue + 1
if 'Removal Step:' in prop.StringValue: continueIter = False
counter += 1
if counter > 10: continueIter = False
except: pass
nodes = ExtAPI.SelectionManager.CurrentSelection
node_one = nodes.Ids[0]
node_two = nodes.Ids[1]
node_three = nodes.Ids[2]
text = "NSEL,S,NODE,," + str(node_one) + "\n"
text += "D,ALL,UX,%_FIX%" + "\n"
text += "D,ALL,UY,%_FIX%" + "\n"
text += "D,ALL,UZ,%_FIX%" + "\n"
text += "NSEL,S,NODE,," + str(node_two) + "\n"
text += "D,ALL,UY,%_FIX%" + "\n"
text += "D,ALL,UZ,%_FIX%" + "\n"
text += "NSEL,S,NODE,," + str(node_three) + "\n"
text += "D,ALL,UZ,%_FIX%" + "\n"
text += "ALLSEL"
command_snippet.Input = text