Showing results for 
Search instead for 
Do you mean 
Reply

Query in dbc_tool_ascii.def

Hello!

 

I want to change the dbc_tool_ascii.def and I see that the following query does not work:

 

CLASS TOOL
{
TYPE QRY
QUERY "[DB(libref)] != [0]"
DIALOG libref
RSET libref Descr MaterialDes
UI_NAME "Tool"

CLASS DIFFERTOOLS
{
TYPE QRY
QUERY "[DB(Type)] == [02] || [DB(Type)] == [03]"
DIALOG libref Diameter TaperedSDia Descr
RSET libref Descr Diameter TaperedSDia MaterialDes
UI_NAME "Differ"

CLASS DIFFERENT
{
TYPE QRY
QUERY "[DB(Type)] == [02] && [DB(SubType)] == [01] || [DB(Type)] == [03] && [DB(SubType)] == [02]"
FILE "qry=shank_mill_schema;rset=shank_mill_schema;"
DIALOG libref Diameter FluteLength CorRadMill TaperAngleB TaperedSDia Material Holder Descr
RSET libref Descr Diameter Type SubType FluteLength CorRadMill TaperAngleB TaperedSDia MaterialDes HolderDes HolderRef
UI_NAME "Differ_Tools"
}

.

.

.

 

For better representation:

 

 

As result I get

 

Type 02 Subtype 01

Type 03 Subtype 01

Type 03 Subtype 02

Type 02 Subtype 03

Type 03 Subtype 06

Type 03 Subtype 07

 

Type 03 Subtype 21

Type 03 Subtype 22 ...

 

I only want to get

 

Type 02 Subtype 01

Type 03 Subtype 02

 

Any ideas what I do wrong?

Thank you all for your help.

 

Werner

8 REPLIES

Re: Query in dbc_tool_ascii.def

Hi Werner,

 

Probably solved when using a couple of parenthesis

 

([DB(Type)] == [02] && [DB(SubType)] == [01]) || ([DB(Type)] == [03] && [DB(SubType)] == [02])

 

Thanks,

 

Toon

Re: Query in dbc_tool_ascii.def

Make sure to use curly braces Smiley Wink

 

QUERY "{[DB(Type)] == [02] && [DB(SubType)] == [01]} || {[DB(Type)] == [03] && [DB(SubType)] == [02]}"
Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Query in dbc_tool_ascii.def

Hello!

 

Without any bracket I get result 1114

With round brackets I get result 0 tool

With curly brackets I get rersult 1114 tools

With square brackets I get rersult 1114 tools

 

You can try it on a OOTB-System with my changed queries.

The idea with the bracktes I already had.

 

The brackets do not help.

 

Werner

 

Re: Query in dbc_tool_ascii.def

[ Edited ]

Hi Werner,

 

Using your query on the ootb ascii library I do get differences

 

 

On the left

[DB(Type)] == [02] || [DB(Type)] == [03]

 

On the right

{[DB(Type)] == [02] && [DB(SubType)] == [01]} || {[DB(Type)] == [03] && [DB(SubType)] == [02]}

 

 But you're right, with or without brackets don't make a difference here ..

 

Thanks,

 

Toon

Re: Query in dbc_tool_ascii.def

[ Edited ]

Hello Toon,

 

if I enter the Query in the dialog it works with the brackets. But if I enter the Query in the DEF-File like I did it, it does not work. Please try it out.

 

BUT: If I enter the Query in the first Class-Level it works:

 

It works:

 

 

It does not work:

 

Is that logical?

 

Thanks for help.

 

Werner

Re: Query in dbc_tool_ascii.def

This might be a problem with the parser, try escaping the curly braces.

 

QUERY "\{[DB(Type)] == [02] && [DB(SubType)] == [01]\} || \{[DB(Type)] == [03] && [DB(SubType)] == [02]\}"
Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Query in dbc_tool_ascii.def

[ Edited ]

Hello Stefan,

 

if I do that then I get a parser-error:

 

 

+++ Query: Parsing failed on string \{[DB(Type)] == [02] && [DB(SubType)] == [01]\} || \{[DB(Type)] == [03] && [DB(SubType)] == [02]\} && [DB(Type)] == [02] || [DB(Type)] == [03] && [DB(libref)] != [0].

 

There I can see how the query works:

Obviously the Query goes from the lowest Class to the top class and adds them into one query. There I see that the logic can't work.

 

Werner

Re: Query in dbc_tool_ascii.def

Hi Werner,

 

You're right. The cumulative query adds the subqueries, connected by "&&".

 

You probably should put brackets around each sub-query

{[DB(Type)] == [02] || [DB(Type)] == [03]} having the resulting query as

 

{[DB(Type)] == [02] || [DB(Type)] == [03]} && 

{{[DB(Type)] == [02] && [DB(SubType)] == [01]} || {[DB(Type)] == [03] && [DB(SubType)] == [02]}}

 

Thanks,

 

Toon

Learn online





Solution Information