Line and surface numbering
Hello,
Thank you in advance for reading this and for your help.
I am currently working on a project where I create a geometry and eventually mesh this geometry in HyperMesh. The key here is, that I use Matlab to generate my TCL/HM code (since the working force here is more aquainted with Matlab than with the TCL code. This code uses certain input parameters and generate information that can be translated to HyperMesh.
Now I am at the point where the whole geometry creation using HM/TCL goes perfectly fine, even after some setbacks where I had to cleverly write the program due to the lack of control on the node, line and surface numbering. I'm stuck at the point where I create holes in my geometry, where certain other parts can connect to.
The geometry consists of several suppressed edges. These edges do not influence the shape of the geometry, like edges that will change the angle of the geometry will; these suppressed edges just lie in the same plane but are used to create the geometry. The surfaces are all numbered in the sequence of generation, so the first generated surface has ID 1, second has ID 2, etc. I create holes by creating a node at the location where the hole centre should be, create a circle with a given radius around it, trim the existing surface with the line and eventually deleting this circular surface, creating a hole. Note again, this is all done by programming, not by using the GUI. Whenever these circles, hence the trimming, do not intersect with a suppressed edge, everything goes fine. It creates a nice hole in my surface, which has that certain ID. Whenever said circle intersects with a suppressed edge, things go wrong.
Say there is a piece of the circle that crosses that suppressed edge. What I would want, is that the surface created by trimming would simply get the newest maximum surface ID. What happens instead, is that the surface gets the ID of the one it is partly intersecting. You must understand, that from a programming point of view, this gives me no control whatsoever of the surface IDs that come after, hence my program fails there.
Now, I have thought of ideas on how to counter this problem. For example, I could create a component for every generated surface, and assign it a name, giving me control of the names and not having to look at the IDs of the surfaces anymore. This is not such elegant solution. Instead, I'd like to use different means to solve the problem, for example, by using the ID of the last created surface, rather than the max surface ID.
My question to you is, what would you do to solve this problem? Would you go for the component solution? Are there query commands that I haven't looked at? Are there macros to solve this problem? Any help is appreciated.
I've added some screenshots that hopefully clarify my situation.
Thank you for any help that is supplied!
Jeffrey
This will yield no problems, there is no intersection:
<?xml version="1.0" encoding="UTF-8"?>
This will yield problems, as there is an intersection:
<?xml version="1.0" encoding="UTF-8"?>
Note that in both cases, these edges are suppressed!
Answers
-
Hi,
actually i cannot understand somehow you can generate 2 surfs that have same ID?
But one solution for this case is: Throw the hypermesh ID away and using geometry ID
Internal geomid of new surface is alway maximum and not repeat,
you can refer to a surf ID via geomid by this way (please try it in hm11):
*createmark surfs 1 'equal to value' geomid $geomid
set SurfID [hm_getmark surfs 1]
in my hm10 this option is not available with surfs
0 -
Hell Tinh,
Thank you for your response. To answer your question: I am not generating two surfs with the same ID. The small circular piece just takes the value of the next surf, renumbering the next surf to the max surf id. That's why things go bad.
I've tried your method to select surfs by geomid, but no surfs are selected no matter what I try.
Regards,
Jeffrey
0 -
Hello,
I have solved the problem by selecting multiple surfaces to trim.
Thanks,
Jeffrey
0