Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: FaceCollector to Face

Gears Phenom Gears Phenom
Gears Phenom

The update_cb() is called anytime a block is changed (a Button pressed, a Text String changed etc.).

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
and logically it is called before apply right ?

Re: FaceCollector to Face

Pioneer
Pioneer
Even my putting my code in the update function i still get the same error. do you thing it is a problem of my VS configuration

Re: FaceCollector to Face

Gears Phenom Gears Phenom
Gears Phenom

@med_Ayssar wrote:
and logically it is called before apply right ?

Actually update_cb() is NOT called when you press the Apply button (or the OK or Cancel buttons). All of these have their own callbacks (ok(), apply() and cancel()).

As for the exception you are getting I'm not sure, but to me it looks like a memory/pointer error (but its been a loooong time since I did any serious C coding and I've only ever 'dabbled' with C++).

Did you take a look at the example code linked to by @Manikandan_R ? The apply() callback looks like this:

int gtacColorTool::apply_cb()
{
    try
    {
        //aiw begin
        PropertyList *cpl = colorPicker0->GetProperties();
        vector<int> new_colors = cpl->GetIntegerVector("Value");
        delete cpl;

        PropertyList *sol = selection0->GetProperties();
        vector<TaggedObject *> selobjs = sol->GetTaggedObjectVector("SelectedObjects");
        for (unsigned int ii = 0; ii < selobjs.size(); ii++)
        {
            DisplayableObject *myDo = dynamic_cast<DisplayableObject *>(selobjs[ii]);
            myDo->SetColor(new_colors[0]);
            myDo->RedisplayObject();
        }
        delete sol;
        //aiw end
    }
    catch(exception& ex)
    {
        gtacColorTool::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
    }
    return 0;
}

None of the iterators you are using in sight.

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
Thnx for your Zip file, actually your code worked perfectually for me, but i somehow still don t know the reason, why my code is not returning any objecet

Re: FaceCollector to Face

Pioneer
Pioneer
For what is exactly the seperator

Re: FaceCollector to Face

Gears Phenom Gears Phenom
Gears Phenom

@med_Ayssar wrote:
For what is exactly the seperator

seperator? Not sure what you mean...

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

Phenom
Phenom

If you mean seperator in the dialog, it is just to add a seperator line between two dialog options.

 

Did you try compiling the code I sent?  If that works may be your project configuration is wrong.  Always use the NX project wizard to create the project.  Especially for C++.

 

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
How can i in that case compare the configuration and find the one causing the trouble, is there like a XML file that i can attach here and maybe get checked by, if you don t mind for sure ?

Re: FaceCollector to Face

Phenom
Phenom

I would suggest to create a new project using the NX project wizard and add your source files to it.

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