- 积分
- 0
- 注册时间
- 2016-6-29
- 仿真币
-
- 最后登录
- 1970-1-1
|
import ansa
from ansa import base
from ansa import constants
@ansa.session.defbutton('Move_to_Include', 'current_include')
def current_include( ):
include= base.GetCurrentEntity(constants.LSDYNA, "INCLUDE")
elems=base.CollectEntities(constants.LSDYNA,None,"__ELEMENTS__",filter_visible=True)
nodes=base.CollectEntities(constants.LSDYNA,elems, "NODE")
base.AddToInclude(include,elems)
base.AddToInclude(include,nodes)
RBE2S=base.CollectEntities(constants.LSDYNA,None,"CONSTRAINED_NODAL_RIGID_BODY",filter_visible=True)
for RBE2 in RBE2S:
ent=base.GetEntityCardValues(constants.LSDYNA,RBE2,("NSID",))
SETS=ent["NSID"]
SET=base.Entity(constants.LSDYNA,SETS,"SET")
#print(SET)
base.AddToInclude(include,SET)
props=base.CollectEntities(constants.LSDYNA,None,"__PROPERTIES__",filter_visible=True)
for prop in props:
type = prop._ansaType(constants.LSDYNA)
if type=="SECTION_SHELL":
prop_shell=base.CollectEntities(constants.LSDYNA,elems, "SECTION_SHELL")
base.AddToInclude(include,prop_shell)
elif type=="SECTION_SOLID":
prop_solid=base.CollectEntities(constants.LSDYNA,elems, "SECTION_SOLID")
base.AddToInclude(include,prop_solid)
elif type=="SECTION_BEAM_ELFORM_1":
prop_beam1=base.CollectEntities(constants.LSDYNA,elems, "SECTION_BEAM_ELFORM_1")
base.AddToInclude(include,prop_beam1)
elif type=="SECTION_BEAM_ELFORM_2":
prop_beam2=base.CollectEntities(constants.LSDYNA,elems, "SECTION_BEAM_ELFORM_2")
base.AddToInclude(include,prop_beam2)
elif type=="SECTION_BEAM_ELFORM_6":
prop_beam6=base.CollectEntities(constants.LSDYNA,elems, "SECTION_BEAM_ELFORM_6")
base.AddToInclude(include,prop_beam6)
elif type=="SECTION_BEAM_ELFORM_9":
prop_beam9=base.CollectEntities(constants.LSDYNA,elems, "SECTION_BEAM_ELFORM_9")
base.AddToInclude(include,prop_beam9)
print("OK")
current_include() |
|