Cancel
Showing results for 
Search instead for 
Did you mean: 

MKE: support for block IF

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

We have found that MKE is supporting block IF statements starting with NX 10.0.3 MP16 by accident, after we have checked the reliability of pilot holes for gun drilling in NX 11.0.2 MP2.

In the rule "MillDrill => DRILLING => TwistDrill => Drill_in_center_S1P" in NX 11.0.2 MP2, we found the following condition:

REM New since 11.02
IF (is_defined(mwf.MACHINING_RULE) AND mwf.MACHINING_RULE = "Guidance_Hole" ) THEN (
oper.Predefined_Depth_Status ="true" AND
oper.Predefined_Depth_Type ="ToolDiameterPercentage" AND
oper.Predefined_Depth_Value = 150.0
)

Due to this we asked a technical question at GTAC if block IF statements are supported and what the initial release of this support is.

Until now, we only thought that the following syntax was supported:

IF {condition} THEN {expression}

REM or
IF {condition} THEN
    {expression}

REM or
IF {condition} THEN {expression} ELSE {expression}

REM or
IF {condition} THEN
    {expression}
ELSE
    {expression}

Which was resulting in multiple duplicate IF statements, if one had multiple expressions for the same condition.

Starting with NX 10.0.3 MP16 one can now create block IF statements in MKE:

IF {condition} THEN (
    {expression} AND
    {expression}
) ELSE (
    {expression} AND
    {expression}
)

An example for this syntax is below:

IF mwf.TILTED_TOP_DEPTH > 0.0 THEN (
    oper.Stock_Part = -0.1 AND
    oper.Top_Offset_Value = 3.0
) ELSE (
    oper.Stock_Part = 0.0 AND
    oper.Top_Offset_Value = 1.0
)

Happy coding Smiley Wink

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide
3 REPLIES

Re: MKE: support for block IF

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

In regard to this, would it be possible to use nested IF conditions now?

Something along the lines of:

IF {condition} THEN (
    IF {condition} THEN (
        {expression} AND
        {expression}
    ) ELSE (
        {expression} AND
        {expression}
    )
) ELSE (
    {expression} AND
    {expression}
)

Thanks in advance for any pointers about this ability.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: MKE: support for block IF

Genius
Genius

Hi Stephan, 

 

In NX 9, I had faced a few troubles with it, and I used Functions instead. Great to know the IF statement is now working better than before!

 

Thanks for sharing it!

 

 

 

Salvador Peregrina
Systems Engineer | NX 11.0.2.7

Re: MKE: support for block IF

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

To answer my own question, I have had a need for nested IF conditions, but MKE barked at me with a syntax error.

So nested IF conditions are not supported by MKE currently Smiley Sad

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Learn online





Solution Information