How to use query commands

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hello, 

 

I was wondering how the query commands are used in Hypermesh. For example, if I wanted to use the query command hm_getnodessharedbyothercomps, where would I apply this command in Hypermesh and how could I see the resulting node IDs?

 

Thank you in advance, 

Alex

Answers

  • vipin_22401
    vipin_22401 Altair Community Member
    edited July 2018

    Hi alex,

     

    open command window from menu.  View -> Command window

    And there you can write the commands, for example paste these lines in command window and you will get output.

     

    *createmark comps 1 109
    hm_getnodessharedbyothercomps 1 1 0
    hm_getmark nodes 1

     

    Change component id as per your model.

     

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

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2018

    Hi Vipin, 

     

    Thank you for the reply. I tried using this code in my model with the appropriate component ID but i'm still not getting any outputs. I attached an image of my model with the two solid meshed components connected at the bottom. 

    Also, how do you get multiple lines in one document? I've tried hitting enter but it starts a new document line, or does this not matter? 

     

    Thanks again,

    Alex

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

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2018

    Nevermind I got it to work. Thank you!

    But one more side question, is there any query command that can grab shared elements from two components? Or is it just nodes?

     

    Thanks for everything!

  • vipin_22401
    vipin_22401 Altair Community Member
    edited July 2018

    Not sure about any direct command for shared elements.

    But you can use  *findmark  to find elements attached to nodes(since you already have nodes from previous command). 

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2018

    Does this *findmark command make a new mark containing the elements it gathered? I tried *findmark nodes 1 1 1 surfs 0 1 so it should be making an output mark named surfs 1 right? Every time I try to call on it I get an error. For example, after using *findmark I try to apply a pressure onto the surface using *pressuresonentity surfs 1 1 0 0 10 10 30 1 but no pressure is applied to the surface.

  • vipin_22401
    vipin_22401 Altair Community Member
    edited July 2018

    Hi @alexdonner

    Sorry for late reply, yes you are right about the output mark.

    It should be working if surfs ids present in the mark. Can you share the code?