cancel
Showing results for 
Search instead for 
Did you mean: 

Call NX/UGOpen from ITK (custom_handler)

Genius
Genius

Is it possible to call NXOpen program(code) from ITK code?

I want to call NXopen code from custom_handler in workflow process, make some chnges in CAD model and save results in CAD modelif it possible

8 REPLIES

Re: Call NX/UGOpen from ITK (custom_handler)

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
This used to be possible through the pdm server call. A single string is passed from ITK to UGO and a single string is received from UGO to ITK. It is up to you to parse the string correctly for your PDM functions.

I haven't written code in a while but now that NX comms support SOA, maybe its easier?

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11.0.1.mp01 | SW 2016 | TcUA 11.2.3
Evaluating:AW 3.2

Re: Call NX/UGOpen from ITK (custom_handler)

Genius
Genius
I know about invoke pdm server function,it works from nxopen to itk,but you say I can use it vice versa way?uf_ugmgr_invoke_pdm_server pass control from nx session to teamcenter,but I don't know about vice versa possibility,is there function to pass control from tc to nx?

Re: Call NX/UGOpen from ITK (custom_handler)

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
From my experience, its a two-way street, just a really skinny roadway. Have you thought about writing UGOpen as an external program and calling it from the Teamcenter handler?

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11.0.1.mp01 | SW 2016 | TcUA 11.2.3
Evaluating:AW 3.2

Re: Call NX/UGOpen from ITK (custom_handler)

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
Used to be USER_invoke_pdm_server. Don't know what it is today. Thank FermiLab for publishing Mark's presentation which can probably answer your questions better than I have...
http://www-cad.fnal.gov/PLMWorld2008/Automation/Hoover_PLMWorld2008.pdf


Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11.0.1.mp01 | SW 2016 | TcUA 11.2.3
Evaluating:AW 3.2

Re: Call NX/UGOpen from ITK (custom_handler)

Genius
Genius

UF_UGMR_invoke_pdm_server(int,char*,int*,char**) call USER_invoke_pdm_server while passing control to TC.

 

I've wrote email to Mark Hoover, hope he will help with that. But I think the only way to get solution is the external nxopen. But external nxopen program can take long time for launching cause nxmanager initialization require this time

Re: Call NX/UGOpen from ITK (custom_handler)

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
It seems we've moved beyond what's possible and are starting to match a solution to a problem. Do you want to describe the problem you're trying to solve? Why is a workflow handler required and what is the program expected to do? There may be another way...

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11.0.1.mp01 | SW 2016 | TcUA 11.2.3
Evaluating:AW 3.2

Re: Call NX/UGOpen from ITK (custom_handler)

Genius
Genius

RandyEllsworth wrote:
It seems we've moved beyond what's possible and are starting to match a solution to a problem. Do you want to describe the problem you're trying to solve? Why is a workflow handler required and what is the program expected to do? There may be another way...

I want to assert mass properties to assembly via final step of workflow process.

By default NX not asserting assembly mass after model have saved and there is no mass value in attribute saved in UGPART-MASSPROPS form. The only way to assert and save mass value for assembly is assert mass explicitly via extended mass properties menu in NX. From another side the users can do that manually but we preffer to automate this process - after completing all checks in WF the mass value must be asserted by custom handler

Re: Call NX/UGOpen from ITK (custom_handler)

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
When the engineer has the assembly loaded, on the screen in front of them, is the best time for this event to take place. Loading NX in the background leaves opportunities for the assembly to be wrong. Either through load options, components getting changed/released since the last assembly save, or many others.

You might want to validate mass-props at the root of the workflow and not allow it to be started if the form isn't populated? A nice way to do this is with Checkmate. The engineer runs Checkmate before closing the assembly in NX to validate that its ready for a workflow.

You can even have engineers perform checks in Teamcenter if you have the BCT CheckIt plugin. You can provide nice meaningful error messages.

By forcing the engineer to check their data, you will catch errors earlier in the process were they can be fixed fairly easily compared to at the end of the process where things get expensive. Validation often gets overlooked or deemed too expensive/too hard to implement yet is one of the most useful parts of change management. And with NX Checkmate freely available, BCT CheckIt reasonably priced, validating data is much easier these days (I used to have to write UFunc for this stuff). My two cents.

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11.0.1.mp01 | SW 2016 | TcUA 11.2.3
Evaluating:AW 3.2