🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

TCL program for circle automatic selection

User: "mansin"
Altair Community Member
Updated by mansin

Hi, everyone.

I have a problem about the tcl programing of circles' automatic selection. In the attached picture, eight circles are in the plate (surface), but the IDs of these circles are uncertain. So, I want to select these circles by position and range (for example, in the displayed coordinate system, by range: 0<x<x1, 0<y<y1). The purpose of this operation is to obtain the respective IDs of these circles. Can anyone give me some advices? 

 

Thanks.

<?xml version="1.0" encoding="UTF-8"?>circle line.jpg

Find more posts tagged with

Sort by:
1 - 5 of 51
    User: "mansin"
    Altair Community Member
    OP
    Updated by mansin

    Can anyone give me some advices? 

    User: "vipin_22401"
    Altair Community Member
    Updated by vipin_22401

    Hi mansin,

     

    I think there are no ids specific to circles in hm, but you can find the line ids which forms the circle.

    try the following code 

     

    *createmark lines 1 displayed
    hm_markbyfeature 1 2 'feature_mode 1 min_radius 1.0 max_radius 15.0'
    set cicleLines [hm_getmark lines 2]
    hm_highlightmark lines 2 'high'

    User: "mansin"
    Altair Community Member
    OP
    Updated by mansin

    Hi, vipin,

    Thank you very much for the reply.

    I tried this method to get the circle line's IDs, but I cannot obtain any IDs of these circles. The diameter of the circles is about 20mm in the attached hm files. I don't know what the problem is?

    1.PNG.706f6ca73e9f8c841400e9a0b35fd0b0.PNG

    <?xml version="1.0" encoding="UTF-8"?>2.PNG

    Unable to find an attachment - read this blog

    User: "vipin_22401"
    Altair Community Member
    Updated by vipin_22401

    Hi mansin,

    I dont know why in your model it is not working, i tried in other models and it is giving output.

    Anyways you can try below method too.

    check the link to know about the parameters  https://altairhyperworks.com/hwhelp/Altair/2017/help/hm_ref_guide/topics/reference/hm/hm_holedetectionsetholeparams.htm?hl=hole

     

    hm_holedetectioninit
    *createmark surfs 1 all
    hm_holedetectionsetentities surfs 1
    hm_holedetectionsetholeparams hole_shape=7
    hm_holedetectionfindholes 1
    set n [hm_holedetectiongetnumberofholes]

    for {set i 0} {$i < $n} {incr i} {
    puts [lindex [hm_holedetectiongetholedetails $i] 5]
    }

    User: "mansin"
    Altair Community Member
    OP
    Updated by mansin

    Hi, vipin,

    The command of 'hm_holedetectiongetholedetails' works in my model.

    Thank you very much.