How do I get the element types/material types of all the elements a node is shared by using DPF?
You can use the following code in Mechanical Scripting console, please change the node_id and GetDataSources index accordingly.
node_id
GetDataSources
NOTE - Works only from 2022R1 onwards
import mech_dpf import Ans.DataProcessing as dpf mech_dpf.setExtAPI(ExtAPI) model = dpf.Model(mech_dpf.GetDataSources(1)) node_id = 1300 mesh = model.Mesh field_nodal = mesh.NodalConnectivityPropertyField element_indices = field_nodal.GetEntityDataById(node_id) element_scope = mesh.ElementScoping all_elements = [element_scope.IdByIndex(index) for index in element_indices] e_prop = mesh.GetPropertyField("apdl_element_type") e_types = [e_prop.GetEntityDataById(index)[0] for index in all_elements] mat_prop = mesh.GetPropertyField("mat") mat_ids = [mat_prop.GetEntityDataById(index)[0] for index in all_elements] print e_types print mat_ids
Hello Ayush,
"apdl_element_type" and "mat" are two property names. How do I find all available property names?
Thanks