Find duplicates in geometry and delete them in HM using tcl commands

Hi there,
I'm trying to use tcl commands in HM2021 to find duplicates in geometry and then delete them.
It is to be implemented in HM model. In the HM model, I duplicate the solid component several times at the same location but with different component names and duplicate the surfaces of the solid component at the same location. That means, I have several components with different names, but the solids are all the same. And the duplicated surfaces component also has the same surfaces with the original solid component.
How to realize it? I've tried directly using HM operations and check the command file to see if it works. For example,
*createmark surfaces 1 "all"
*surfacemark_duplicate_check 1 1 518 0 1 0.1
*deletemark surfaces 1
But I still have 1 duplicate left even if the larger tolerance 0.5 was chosen.
And how to explain the parameter "518" in the code above? I read the menu, but not clear about that value.
Thanks for your insight.
Answers
-
hello @Alex_HM_user ,
may I ask you for a larger picture here, as I don't get (yet) the point of your automation. Especially, why duplicating a solid multiple times in different components, then later deleting duplicate surfaces?
Regarding your request about *surfacemark_duplicate_check, the help link describes it quickly, but generally you have to collect it from command.tcl based on an interactive duplicate search.
Best Regards,
Michael
0 -
Hi Michael, thanks for the direction. It could delete some duplicated surfaces. But it could not delete duplicate solids. Say, one guy mistakes duplicating solids during importing geometry models. Now I want to check and delete the duplicate solids. But the duplicate surfaces from checking are found to be associated with the solids so that they could not be deleted. I want to automatically check these duplicates and deleted them.
That's why my question is raised here. Any method to deal with this issue?
0 -
Hello @Alex_HM_user ,
duplicates in HyperMesh means you have two entities sharing similar attributes. Eg 2 elements are duplicates if they share the same connectivity (N1 N2 N3 N4).
If you import separately 2 solids, they cannot share common attributes, so they are not duplicate for HyperMesh.
I we stick with your scenario of importing twice the same CAD, resulting in redundant solids, then the check should be done on part or component name instead. Indeed, orinial solid will belong to componentname, while redundant solid will belong to componentname.1
Hope that helps,
Michael
0 -
Hi Michael,
Thanks a lot for your help! You answered my question. The duplicate naming logic is also applies to ANSA. We may just check *.1 to find the duplicates and remove it.
1