Cancel
Showing results for 
Search instead for 
Did you mean: 

Tool Query in dbc_tool_ascii.def

Genius
Genius

Hi all,

 

I have a tool query that is too long for NX. NX says the query string should be smaller equal 133 characters.

 

QUERY "[DB(libref)] >= [F832140000000] && [DB(libref)] <= [F832149999999] || [DB(libref)] >= [F832010000000] && [DB(libref)] <= [F832039999999] || [DB(libref)] >= [F832060000000] && [DB(libref)] <= [F832069999999] || [DB(libref)] >= [F832090000000] && [DB(libref)] <= [F832099999999]"

 

When I use the query in interactive mode NX doesn´t complain about the length.

 

Is there a way to extend the accepted length of the query?

Could I use something like "search for F843214*"?

 

I am currently doing my tests with NX11.0.1 . The next version we use is NX11.0.2 .

 

Thanks for all of your responses.

Best wishes,
Joachim

In production NX 12.0.1.7 D2
In testing NX 12.0.1.7 MP4
9 REPLIES

Re: Tool Query in dbc_tool_ascii.def

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

The NXOpen API mostly has some restrictions about lengths.

Have you tried the following instead?

[DB(libref)] &= [F83214*]

If the query is very long it is also good to use curly braces ( { } ) to group the conditions logically to force the order of evaluation.

Excerpt of a query created through FBM and MKE listed in the information of an operation.

---------- Tool Query ----------
Query                {{{{{{{DB(SubType) == 71} && {DB(Type) == 03}} && {DB(libref) != 0}} && {DB(Pitch) > 3.4950}} && {DB(Pitch) < 3.5050}} && {DB(TapDia) > 29.9500}} && {DB(TapDia) < 30.0500}}

Hope this helps.

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: Tool Query in dbc_tool_ascii.def

Genius
Genius

Hi Stefan,

 

I read about the curly brackets in some other posts. When I initially tried to figure out a scheme of how to design the query I couldn‘t find anything in the NX online help. I am going to use these in some other contexts. In this particular case the statement would just have become much longer.

 

I am going to test the simpler query when I am back in the office. Also, when searching for valid tool queries for the end user the NX online help did not explain wildcards with asterisks. Thanks for that, too.

 

Best wishes,
Joachim

In production NX 12.0.1.7 D2
In testing NX 12.0.1.7 MP4

Re: Tool Query in dbc_tool_ascii.def

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

I think the information is spread across Tcl scripts and the NX documentation about how to use the &= operator for matching strings.

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: Tool Query in dbc_tool_ascii.def

Genius
Genius
I just tried

[DB(libref)] == [F83214*]

It works interactively, but not in an OR separated query with multiple entries.

I give up for today. Even with the strange {} brackets it doesn´t work.
Best wishes,
Joachim

In production NX 12.0.1.7 D2
In testing NX 12.0.1.7 MP4

Re: Tool Query in dbc_tool_ascii.def

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

You cannot use the double equal sign (==), you need to use the ampersand-equal sign (&=) to force a string matching.

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: Tool Query in dbc_tool_ascii.def

Genius
Genius
When writing
[DB(libref)] &= [F841*]

I get
F841...
F842...
F843...
F844...
...
tools listed as search result.

It looks to me as if this is not the supposed behaviour.

Best wishes,
Joachim

In production NX 12.0.1.7 D2
In testing NX 12.0.1.7 MP4

Re: Tool Query in dbc_tool_ascii.def

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

OK, I have checked the files where this is managed and found that they have changed in NX 11.

In file %UGII_BASE_DIR%\MACH\resource\ug_library\dbc_ascii_general.tcl in procedure ASC_create_criterion you can find how the query pairs are treated.

So if a query uses the == operator and the right-hand-side contains an asterisk a string match is performed.

If a query uses the &= operator a regular expression match is performed.

If you enter the string F841* in the tool search dialog in NX, do you get the correct result?

If you enter the query pair in the additional criteria in the NX dialog, do you get the correct result?

You may include a line with MOM_log_message in the Tcl script to output the resulting query string to the NX log file, which you can use to check the needed syntax for your query pair.

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: Tool Query in dbc_tool_ascii.def

Genius
Genius
Searching the libref for F841* includes everything with F84 as listed above. Searching for F841 gives the correct result (everything with F841 inside).

Additional Search Criteria
[DB(libref)] &= [F841*] and [DB(libref)] &= [F841] behave as stated above.

Best wishes,
Joachim

In production NX 12.0.1.7 D2
In testing NX 12.0.1.7 MP4

Re: Tool Query in dbc_tool_ascii.def

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

So you would have to use the following:

[DB(libref)] == [F841]

You can check this with the additional criteria.

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