cancel
Showing results for 
Search instead for 
Did you mean: 

Query in dbc_tool_ascii.def

Valued Contributor
Valued Contributor

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:

 

2015-12-02 08_48_03-UltraEdit-32 - [C__Ugs_NX10_MACH_resource_library_tool_ascii_dbc_tool_ascii.def].png

 

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

Siemens Genius Siemens Genius
Siemens Genius

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

Esteemed Contributor
Esteemed Contributor

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

Valued Contributor
Valued Contributor

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

Siemens Genius Siemens Genius
Siemens Genius

Hi Werner,

 

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

 

Query 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

Valued Contributor
Valued Contributor

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:

2015-12-03 07_44_15-Library Class Selection.png

 

 

It does not work:

2015-12-03 07_45_13-Library Class Selection.png

 

Is that logical?

 

Thanks for help.

 

Werner

Re: Query in dbc_tool_ascii.def

Esteemed Contributor
Esteemed Contributor

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

Valued Contributor
Valued Contributor

Hello Stefan,

 

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

 

2015-12-03 07_50_28-Error when retrieving tools.png

 

+++ 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

Siemens Genius Siemens Genius
Siemens Genius

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