Difficulty selecting by box in *createmark

etrud011
etrud011 Altair Community Member
edited October 2020 in Community Q&A

Hello,

 

I am trying to select elements and nodes by box, however the function does not return anything. My code to select elements is as follows;

 

set X0 -20
set Y0 -20
set Z0 -20
set X1 20
set Y1 20
set Z1 20
set syst 1
*createmark elems 1 {'by box'} $X0 $Y0 $Z0 $X1 $Y1 $Z1 $syst inside 0 1 0
set elem_ids [hm_getmark elems 1]

 

It works on some models, and does not work in others. I have also made sure that the limits of selection is within the models dimensions.

 

Thanks

 

Answers

  • tinh
    tinh Altair Community Member
    edited August 2018

    Hi

    Please show the models that above script does not work.

    why did you set syst equal 1?

  • Pandurang
    Pandurang Altair Community Member
    edited August 2018

    <?xml version="1.0" encoding="UTF-8"?>image.thumb.png.89bf88ad936f1f1483283b1c596c7924.png

     

    When i used your script by changing variable  values i got this error: unknown entity type found.

    so i wrote same code..it worked...

    So i compared both file...as you can see..in your code at beginning of elems .. unrecognisable error...

    please rectify this and try again...hope it will work:)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />

  • etrud011
    etrud011 Altair Community Member
    edited August 2018

    Hello,

     

    Thank you for the replies, it turns out that the problem was incorrectly specifying the coordinate system. 'syst' should have been set to zero in my case.

     

    Thanks again

  • tinh
    tinh Altair Community Member
    edited August 2018

    <?xml version="1.0" encoding="UTF-8"?>image.thumb.png.89bf88ad936f1f1483283b1c596c7924.png

     

    When i used your script by changing variable  values i got this error: unknown entity type found.

    so i wrote same code..it worked...

    So i compared both file...as you can see..in your code at beginning of elems .. unrecognisable error...

    please rectify this and try again...hope it will work:)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />

     

    just an encoding problem of some web browsers (you copied code from forum then pasted, didn't you?)

     

    and don't brace 'by box'

    {'by box'}  ==> type 'by box'  only