Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

save part components selectively using open api

Status
Not open for further replies.

lugan2

Mechanical
Apr 10, 2013
42
Hi all
How to use NX C++API to save part's components selectively. For example, I have components A, B, C created in one program routine. And I want to save A and C, but not B.

How to implement it? Can we use UF_PART_close/UF_PART_open to do it? When I want to save one component, do UF_PART_open, otherwise UF_PART_close. Is it the way to do it?

Thanks
 
Replies continue below

Recommended for you

also, is there a function can save a particular component based on its tag? for example, in the form of: UF_PART_save(&tag_t)? So it can chose which one to save?
 
Anyone knows the solution? How can we save the parts selectively?

Thanks
 
I have done somthing simular using C where I temporaily change the part I want to save to the work part then save work only and then switch back to original work part.

C:
static int save_one_file(tag_t part_to_save, tag_t org_wrk_part)
{
	int
		savrsult,
	tag_t
		prev_work_part;
	if (part_to_save != org_wrk_part)
	{
		create_backups(part_to_save);
		UF_CALL(UF_ASSEM_set_work_part_quietly(part_to_save, &prev_work_part));
		savrsult = UF_CALL(UF_PART_save_work_only());
		UF_CALL(UF_ASSEM_set_work_part_quietly(prev_work_part, &part_to_save));
	}
	else
	{
		savrsult = UF_CALL(UF_PART_save_work_only());
	}
	return(savrsult);
}

 
Thanks for your reply moudy1. Sorry I could reply you earlier.

The problem has been solved. Many thanks!
Gan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor