Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Links to UF_xxx methods not working in net_ref_uf.chm

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

I have a problem to follow any link in the "NX11 NXOpen .Net API User Function Reference" which leads to the UF_xxx functions.

As the documentation normally is stored together with the C user functions and not with the .Net wrapper function, it's hard to know how to use the different user functions from .NET.

 

Is there any fixed CHM help file for that problem or do I need to set some configuration to get it work?

 

When I try to follow the link, my Window OS is telling me that I "need a new app to open this ms-its".

Any other links to the wrapper functions or namespaces work fine!

 

NX 11.0.1.1 + NX 10.0.3.5, Windows 10 Pro (x64)

6 REPLIES

Re: Links to UF_xxx methods not working in net_ref_uf.chm

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Martin,

 

It is working OK for me, except of course that it always goes to the very beginning of the relevant chapter of the Open C Reference, and then I have to search within that page for the function.  Where did you put your .chm file?  We have had some problems reported when they are on mapped drives.  (I keep mine on the desktop.)

 

Did you download your copy recently from the documentation page?

 

Steve

 

Re: Links to UF_xxx methods not working in net_ref_uf.chm

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

As I did not install any local documentation (I use the online help), I created the UGDOC folder under "C:\Program Files\Siemens\NX 11.0" and copied the net_ref.chm and net_ref_uf.chm into it.

I also verified that both files are unblocked after downloading!

 

I just copied the file to the desktop and opened the help from there with the same problem.

Re: Links to UF_xxx methods not working in net_ref_uf.chm

Siemens Phenom Siemens Phenom
Siemens Phenom

Please log an IR with GTAC.  Based on what you are describing, I don't know why it would not work.  Thanks!

 

Re: Links to UF_xxx methods not working in net_ref_uf.chm

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

I filed an incident report and got the following answer today:

"Thanks for reporting this issue to GTAC.

After checking it, there might be not much we can do to solve it and actually it never had been reported yet to us.

...(more explanations follow)..."

 

Finally, after more testing, I found the following and little bit tedious work-around:

1) If the link fails, move back in the history and copy the URL from the link's properties.

2) Open the "Jump to URL..." command and paste the URL

=> this will open the page correctly and even at the right position on that page ;-)HtmlHelp_JumpToURL.png

 

 

 PS: The .NET help will no longer be delivered in CHM format in NX 12.0, but in standard HTML files, so that this problem will disappear!

 

Re: Links to UF_xxx methods not working in net_ref_uf.chm

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Good information; thanks for posting the follow up.

Re: Links to UF_xxx methods not working in net_ref_uf.chm

Pioneer
Pioneer

Not sure if I can find  the attached code in VB net language  on Siemense document website instead of C  language. I found out this code in most of the NX programming languages except Vb.net . Thanks

 

UF_ASSEM_count_objs_in_comp

 

https://docs.plm.automation.siemens.com/data_services/resources/nx/11/nx_api/custom/en_US/ugopen_doc...

 

 /*
 The code in the following example cycles the occurrenced members of
the displayed part. It does some checking on the data and prints out
the results of the checking.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <uf_defs.h>
#include <uf.h>
#include <uf_part.h>
#include <uf_assem.h>
static int cycle_components(
/* Component to cycle    I/O */
  tag_t component,
/* for formatting        I/O */
  char *indentation)
{
  int i;
  int ifail = 0;
  int component_count = 0;
  int check_number = 0;
  tag_t parent = NULL_TAG;
  tag_t member = NULL_TAG;
  tag_t *child_components = NULL;
  char p_name[MAX_FSPEC_SIZE];
  char r_name[MAX_ENTITY_NAME_SIZE];
  char c_name[MAX_ENTITY_NAME_SIZE];
  double origin[3];
  double csys_matrix[9];
  double transform[4][4];
  if (component == NULL_TAG) return 0;
  ifail = UF_ASSEM_ask_component_data( component,p_name,r_name,
                                       c_name,origin,csys_matrix,
                                       transform);
  if (ifail != 0)
  {
    return ifail;
  }
  printf("%s Part name %s component name %s reference set"
         " name %s with members ..\n",
         indentation, p_name,
         c_name == NULL ? "No component name" : c_name,
         r_name == NULL ? "No reference set name" : r_name);
  component_count = UF_ASSEM_ask_part_occ_children(component,
                                          &child_components);
  ifail = UF_ASSEM_count_objs_in_comp(component, &check_number);
  i = 0;
  printf("%s  ", indentation);
  ifail = UF_ASSEM_cycle_objs_in_comp(component, &member);
  if (ifail != 0)
  {
    return ifail;
  }
  while (member != NULL_TAG)
  {
    i++;
    /*
      Do a sanity check to make sure we get the correct parent back.
    */
    ifail = UF_ASSEM_ask_parent_component(member, &parent);
    if (ifail != 0 || parent != component)
    {
      printf("ERROR: got back the wrong parent %u for member %u\n",
             parent, member);
      return 11;
    }
    /* Print the tag of the member. */
    printf("%u, ", member);
    ifail = UF_ASSEM_cycle_objs_in_comp(component, &member);
    if (ifail != 0)
    {
      return ifail;
    }
  }
  printf("\n");
  if (i != check_number)
  {
    printf("ERROR: Got back the wrong number of members, expecting %d,"
           " got %d\n", check_number, i);
    return 12;
  }
  /* Now repeat for each child component, with an indentation
     for formatting.
  */
  strcat(indentation, "  ");
  for (i=0; i<component_count; i++)
  {
    ifail = cycle_components(child_components[i], indentation);
  }
  UF_free(child_components);
  return ifail;
}
/*ARGSUSED*/
extern void ufusr(char *name, int *rtcode, int rtlen)
{
  /*
    Short example of use of assemblies navigation routines to output an
    assemblies listing and the contents of each component.
  */
  tag_t root_part_occ = NULL_TAG;
  tag_t displayed_part = NULL_TAG;
  char indentation[256];
  UF_initialize();
  strcpy(name, "");
  displayed_part = UF_PART_ask_display_part();
  if (displayed_part != NULL_TAG)
  {
    root_part_occ = UF_ASSEM_ask_root_part_occ(displayed_part);
    if (root_part_occ != NULL_TAG)
    {
      strcpy(indentation, "  ");
      *rtcode = cycle_components(root_part_occ, indentation);
    }
  }
  if (*rtcode == 0)
  {
    /* This assumes we have successfully executed the program. */
    printf("The NX Open API program has succeeded\n Return code is %d"
,
           *rtcode);
  }
  else
  {
     /* This assumes we failed. */
    printf("The NX Open API program has failed\n Return code is %d",
           *rtcode);
  }
  UF_terminate();
}

{Raeed Kena}, {Mechanical / Civil Engineer}


Production: {NX11,CATIA,SOLIDWORK,ANSYS,AUTOCAD,TEAMCENTER}

Development: {Visual Basic Net} Testing: {NX12,ANSYS}