select elements of different component enclosed within different component's CAD surfaces through script

ATLURI BHARATH KUMAR
ATLURI BHARATH KUMAR Altair Community Member
edited March 2024 in Community Q&A

I have (mid surface + elements) of CAD in one component and the CAD surfaces in other component. can anyone suggest a code to detect the elements within CAD surfaces with the condition (elements are independent i.e., not on surfaces)

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • AndreasAltmann
    AndreasAltmann Altair Community Member
    edited March 2024

    Hello @ATLURI BHARATH KUMAR ,

    I have created a script for our models, which will sort the FE-Components to a Part based if the FE-Mesh is within one solid (of one component) of the Part. 

    Procedure:
    Create a list with all components that contains solids
    Create a list with all components that contains mesh

    Loop through all components with the mesh and pick 50 random nodes (to increase speed) from the mesh. Check with every solid, if a certain percentage of nodes are within a solid (command  "set isInSolid [hm_ispointinsidesolid $x $y $z $solidId]"). If there are more then 30% of the nodes part of the solid I will organize the component to the part of the solid. 

    This takes quiet long to go through a bigger model, but I haven't found any other way so far.

    BR

    Andreas

  • ATLURI BHARATH KUMAR
    ATLURI BHARATH KUMAR Altair Community Member
    edited March 2024

    But here I have only surfaces not solids. Can you help in this scenario

  • AndreasAltmann
    AndreasAltmann Altair Community Member
    edited March 2024

    But here I have only surfaces not solids. Can you help in this scenario

    Haven't tried myself, but I think "hm_getcoordinatesfromnearestsurface" can help you in this case.

    https://help.altair.com/hwdesktop/hwd/topics/reference/hm/hm_getcoordinatesfromnearestsurface.htm

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.