Using Python api to query the maximum node id

ThomasCook
ThomasCook Altair Community Member
edited September 11 in Community Q&A

I want to use hm_detitiymaxid to query the maximum node id in the model, but the following code cannot return an int value. Thanks for any help.

 

import hm import hm.entities as ent  model = hm.Model() N1 = ent.Node(model) N1.localcoordinates =[0,0,0]  maxid = model.hm_entitymaxid(ent.Node)

Answers

  • Michal Stefuca
    Michal Stefuca
    Altair Employee
    edited September 11

    Hi Meng,

    The hm_ (query) functions return the information via result objects. You will need to query the value from the result object:


    image

     

    Thanks,

    Michal Stefuca
    Automation & Customization

  • ThomasCook
    ThomasCook Altair Community Member
    edited September 11

    Hi Meng,

    The hm_ (query) functions return the information via result objects. You will need to query the value from the result object:


    image

     

    Thanks,

    Michal Stefuca
    Automation & Customization

    Thank you very mush.