hexagon logo

PCL; how to get reference csys id (CID) for CONM2 element?

Hello!
I created a group with CONM2 elements. I would like to printout CID for each EID. I cannot figure out how to go from region ID to specific property field.
 
This is piece of code I have:
 
db_get_current_group_id(group_id)
db_get_group_name( group_id,s_name )
   db_count_elems_in_group(group_id, num_elems)
SYS_ALLOCATE_ARRAY(elem_ids, 1, num_elems)
db_get_elem_ids_in_group(num_elems, group_id, elem_ids)
 
FOR (i=1 to num_elems)
eid(1) = elem_ids(i)
db_get_region_for_elements(1, eid, region_ids)
###get_CID
dump str_from_integer(eid(1)) // " - " // ###CID
 
END FOR 
 
Regards,
Adam
Parents
  • Hi Adam,
    I can't seem to see your reply on this thread (on word_id = 2069) though I was emailed it.
     
    in response to it have a look at this to get the mass data that you required.:
     
    INTEGER status, word_id, word_component, @
        search_element_count, search_element_id(1), @
        found_element_count, found_element_id(VIRTUAL), i_elem
    REAL found_element_value(VIRTUAL)
     
    word_id = 2069
    word_component = 1
    search_element_count = -1
    status = ep_word_val_at_el_cen(word_id, word_component, @
          search_element_count, search_element_id, @
          found_element_count, found_element_id, @
          found_element_value)
    IF (0 < status) THEN
      msg_to_form(status, 4, 0, 0, 0.0, "")
    ELSE
      IF (0 > status) THEN
    $ Error information already displayed 
      ELSE
       write_line("found_element_count =", found_element_count)
       FOR (i_elem = 1 TO found_element_count)
         write_line("found_element_id(", i_elem, ") =", @
              found_element_id(i_elem))
         write_line("found_element_value(", i_elem, ") =", @
              found_element_value(i_elem))
       END FOR
      END IF
    END IF  
Reply
  • Hi Adam,
    I can't seem to see your reply on this thread (on word_id = 2069) though I was emailed it.
     
    in response to it have a look at this to get the mass data that you required.:
     
    INTEGER status, word_id, word_component, @
        search_element_count, search_element_id(1), @
        found_element_count, found_element_id(VIRTUAL), i_elem
    REAL found_element_value(VIRTUAL)
     
    word_id = 2069
    word_component = 1
    search_element_count = -1
    status = ep_word_val_at_el_cen(word_id, word_component, @
          search_element_count, search_element_id, @
          found_element_count, found_element_id, @
          found_element_value)
    IF (0 < status) THEN
      msg_to_form(status, 4, 0, 0, 0.0, "")
    ELSE
      IF (0 > status) THEN
    $ Error information already displayed 
      ELSE
       write_line("found_element_count =", found_element_count)
       FOR (i_elem = 1 TO found_element_count)
         write_line("found_element_id(", i_elem, ") =", @
              found_element_id(i_elem))
         write_line("found_element_value(", i_elem, ") =", @
              found_element_value(i_elem))
       END FOR
      END IF
    END IF  
Children
No Data