Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

How to import a part file in C

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

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

Re: How to import a part file in C

Yes I did: Memory access violation.

Re: How to import a part file in C

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


Solution
Solution
Accepted by topic author Dora87
‎10-06-2016 07:35 AM

Re: How to import a part file in C

[ Edited ]

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

[ Edited ]

That helped a lot. Thank you!