Using *createentitypanel for single entity selection
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?
Answers
-
Hi nothing wrong in the above code, it is working for me /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]0 -
Well, that's strange. the exact thing I pasted into my post that wasn't working yesterday now works just fine.
0