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

11 REPLIES

Re: How to import a part file in C

Honored Contributor
Honored Contributor

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!

 

Re: How to import a part file in C

Creator
Creator

Hello,

 

From the UF_PART_ import(filename,&modes,dest_csys,dest_point,scale,&group), how can I delete the dest_csys that is displayed?

 

Thank you

Dora

Re: How to import a part file in C

Creator
Creator

Every time I import a part, the datum of the part is displayed. Is there any way of suppressing, hiding or deleting it?

 

Thank you

Dora

Re: How to import a part file in C

Esteemed Contributor
Esteemed Contributor

You can use the normal UF routines to hide it (as you already have the tag from "dest_csys").

If it is a different CSYS (e.g. from the part you import) you can set up the part to import with it on a different layer, and when you import the part, maintain the original layers?

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

Creator
Creator

Hello Ken,

 

Thanks for your help. I don't have the tag from the csys. Csys is double variable. Any ideas?

 

Dora