About "hm_getvalue" to get "Metadata"
I have a quiestion about "hm_getvalue" to get metadata-value. (using HyperMesh 2019.1)
I want to get metadataValue "Number of sheets welded" in point metadata.
At first. I cannot get the data.
But after doing "reference" point component in model-view and "select point" in reference-view, I can get Value.
If you know, tell me why such a things happen. or better way to get metadata value.
tcl Program for test is below.
*createmarkpanel points 1 set pointID [hm_getmark points 1 id] foreach poID $pointID { if {[catch {set weld [hm_getvalue points id=$poID dataname={Number of sheets welded}]}]} { set weld 0 } puts "$poID $weld" }
Thanks for reading.
Best Answer
-
Seems very strange that you would get the value after doing reference.
You can try using metadata_value=<metadata_name> instead of dataname=<data name or attribute name/ID>.
Like this.
*createmarkpanel points 1 set pointID [hm_getmark points 1 id] foreach poID $pointID { if {[catch {set weld [hm_getvalue points id=$poID metadata_value={Number of sheets welded}]}]} { set weld 0 } puts "$poID $weld" }
1
Answers
-
Hi, Mai Moritaka
I'm willing to help you ,but I'm not sure what do you mean by "dataname={Number of sheets welded}".
As far as I know, there is no dataname "{Number of sheets welded}" for points entity.
Please provide more information.
0 -
Nagahashi Kouta said:
Hi, Mai Moritaka
I'm willing to help you ,but I'm not sure what do you mean by "dataname={Number of sheets welded}".
As far as I know, there is no dataname "{Number of sheets welded}" for points entity.
Please provide more information.
Thank you for reply, Kouta Nagahashi.
I'm glad to hear you are willing to help me.
and I'm sorry, not enough explanation for my question.
I'm writing a script to create HyperMesh Tags with metadata value.
and this time (only in my data), there are point-data with "Number of sheets welded" in metadata.
So metadata name ("Number of sheets welded") is not important.(sorry make you confuse...)
I want to get some metadata in point by hm_getvalue command, but I couldn't.
(with error there is no that dataname)
But after doing
1. "reference" (by mouse right crick action) Comps belong points
2. "Mouse Click" points in reference browser (point metadata can check by this action)
hm_getvalue command worked.
If you need more information, please re-comment what you need.
But I'm not in office today, so cannot share error screen-shot...
0 -
Seems very strange that you would get the value after doing reference.
You can try using metadata_value=<metadata_name> instead of dataname=<data name or attribute name/ID>.
Like this.
*createmarkpanel points 1 set pointID [hm_getmark points 1 id] foreach poID $pointID { if {[catch {set weld [hm_getvalue points id=$poID metadata_value={Number of sheets welded}]}]} { set weld 0 } puts "$poID $weld" }
1 -
Ben Buchanan said:
Seems very strange that you would get the value after doing reference.
You can try using metadata_value=<metadata_name> instead of dataname=<data name or attribute name/ID>.
Like this.
*createmarkpanel points 1 set pointID [hm_getmark points 1 id] foreach poID $pointID { if {[catch {set weld [hm_getvalue points id=$poID metadata_value={Number of sheets welded}]}]} { set weld 0 } puts "$poID $weld" }
Thank you, Ben Buchanan.
Your answer is very helpful.
Command worked well, by changing to metadata_value=<metadata_name> .
I understand to get metadata, dataname=<data name or attribute name/ID> is not recommended.
I appreciate it! Thank you very much!
0