Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: FaceCollector to Face

Pioneer
Pioneer

Thnx for the code. It actually seems to me that i am doing the same. It is pretty straight forward. but in my c++ code i still get an empty list of TaggedObjects

Re: FaceCollector to Face

Gears Phenom Gears Phenom
Gears Phenom

The only thing I can suggest is to create some C++ code that replicates exactly what I did in C# and see if it works.

I'd tag some others in, but I'm not sure of any names here that are C++ users.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Dell 7530 Precision, Win10, 32GB. Developing in: Java | C | KF
Production: [NX12.0.2 MP1]

Re: FaceCollector to Face

Pioneer
Pioneer
Actually the code seems like yours already but due to some complications, i can not post it now, i have to ask my supervisor, whether i can post some of the code here or not

Re: FaceCollector to Face

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

This might not be the cause of your issue, but is easy to check: NX can be fairly picky about the C++ compiler used. Check the release notes for the version of NX you are using to find the supported compiler version. Here is a link for NX 12, the information can be found in a similar location in other versions.

 

@Ken_A  might be able to help out with C++ issues.

Re: FaceCollector to Face

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

@med_Ayssar 

Try replicating JUST Graham's code in C++ (start a separate application using the NX project template)

You can use Graham's .DLX file.

 

Hopefully your boss would allow that to be posted, and it isn't doing anything "company specific"

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


Re: FaceCollector to Face

PLM World Member Legend PLM World Member Legend
PLM World Member Legend

Hi @med_Ayssar,

 

Use the below code in your program and try:

 

PropertyList *sol = face_select0->GetProperties();
vector<TaggedObject *> selobjs = sol->GetTaggedObjectVector("SelectedObjects");

Here is the sample solution to get the selected objects for C++ language.

https://solutions.industrysoftware.automation.siemens.com/view.php?sort=desc&dt=nx-api&q=blockstyler...

 

 

Re: FaceCollector to Face

Phenom
Phenom

Attached is a C++ project created using Visual Studio 2015.  The program names selected faces.  It uses face collector.  I have elaborated the program to show converting tagged object vector to face vector.

 

Hope this helps.

 

Suresh
Technisites Australia
Production: NX10.0.3 Developing: NX11.0.2.7, NX12.0.2, NX1847,
Development: C++, C# .Net, VB .Net, Python, KF

Re: FaceCollector to Face

Pioneer
Pioneer

I just attached my code here, may you would like to take a look at eh apply function

 

https://community.plm.automation.siemens.com/t5/NX-Programming-Customization-Forum/Block-Styler-Face...

Re: FaceCollector to Face

Pioneer
Pioneer

i also attached some photos of the received fatal errors

Re: FaceCollector to Face

Pioneer
Pioneer
the function update_cb(), at which point will be it called ?