cancel
Showing results for 
Search instead for 
Did you mean: 

How to import a part file in C

Creator
Creator

I am trying to import a .prt file and merge it into the current Work Part, using c.

The plan is to take the object features of this file and use them to the current work part.

Tried to use UF_PART_import but it doesn't work.

 

Thanks in advance

5 REPLIES

Re: How to import a part file in C

Phenom
Phenom

Did you get an error message; and if so, what did it say?

Re: How to import a part file in C

Creator
Creator

Yes I did: Memory access violation.

Re: How to import a part file in C

Esteemed Contributor
Esteemed Contributor

Can you "File -> Import" that same part interactively?

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: How to import a part file in C

Siemens Phenom Siemens Phenom
Siemens Phenom

This worked fine for me:

 

char
    *fName = {"D:\\_NX10\\_Parts\\PartToImport.prt"};
UF_import_part_modes_t
    modes = { 0, 0, 0, 0, 1, TRUE, FALSE };
double
    destCsys[6] = { 1., 0., 0., 0., 1., 0. },
    destPnt[3] = { 10., 10., 10. },
    scale = 1.0;
tag_t
    theGroup = NULL_TAG;

UF_CALL(UF_PART_import(fName, &modes,destCsys, destPnt, scale, &theGroup));

UF_CALL(UF_VIEW_fit_view(NULL_TAG, 0.9));

 

NOTE:  If you are trying to import into a drawing, change the fifth element of "modes" from 1 to zero.

Re: How to import a part file in C

Creator
Creator

That helped a lot. Thank you!