🎉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

Using *createentitypanel for single entity selection

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

I need to ask the user to specify one and only one line. From what I understand (according to this help document: https://www.sharcnet.ca/Software/Hyperworks/help/hm/hmbat.htm?_createentitypanel.htm), the only way to accomplish that is by using *createentitypanel <entity_type> <message> followed by hm_info lastselectedentity <entity_type> to reference the selected entity.  However, when I use the code below, I always get the message 'No line selected'.

 *createentitypanel lines 'Select line' if {[hm_info lastselectedentity lines] == 0} {     hm_errormessage 'No line selected' }

What am I doing wrong?

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "vipin_22401"
    Altair Community Member
    Updated by vipin_22401

    Hi nothing wrong in the above code, it is working for me :huh:/emoticons/default_huh.png' title=':huh:' />

    if you need to get the line id, use hm_info command immediately after createenttitypanel.

     

    *createentitypanel lines 'Select line'
    set lineId [hm_info lastselectedentity lines]

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Well, that's strange. the exact thing I pasted into my post that wasn't working yesterday now works just fine.