TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
The purpose of these forums is to discuss TurboCAD.  Please keep the discussion of other products to compatibility issues or how the other software’s can be used with TurboCAD.


Graphics.QuerySet in different language versions
Read 4023 times
* September 22, 2010, 04:38:14 AM
Hello,
is there a language independent form of selection queries? My code debugged in English TurboCAD versions doesn't work in German one. I use QuerySet to get GraphicSet of all graphics and all selected graphics, the queries are "ALL" and "SELECTION", but in German version it is ALLE and AUSWAHL .

In the English version, I tried . and _ prefixes as in Autocad, but the syntax parser fails (I use Edit/Select by/Query to test it).

. Are there international query statements in TurboCAD?
. If no, how to get language version of the active TurboCAD or even better the ALL and SELECTION strings in the current TuboCAD language?
. If none of the above is possible, could someone give me complete list of these two keywords in all TurboCAD languages (above are English and German).
. Another way to get GraphicSet of all or currently selected items?
. Is there a completedefinition of query language?

I'm using COM interface.

Thank you for any help or suggestions.

Logged


* September 23, 2010, 10:57:31 AM
#1
Hello mh
I tried „Select by query“ via SDK, but had no success either.
I tried it from VB, but in the “TurboCAD v4.1 Programmable Objects” it is not implemented.
I did a vague attempt using the “Tcapi17.dll” but no success either.

Now I would gave AutoIT a try. The sendkeys are reliable and to manage the different windows is easy in AutoIT.

Best regards
Bernd

Logged


* September 27, 2010, 08:16:21 AM
#2
I use COM interface and the function is available from Graphics collection as QuerySet.

I use C++ (VS2008) and it's declared in Imsigx.h

During development I used VB6. I don't remember which reference it was, but it should work. Only problem I have is with language versions (didn't solve it).

Logged


* September 29, 2010, 03:47:19 AM
#3
I use COM interface and the function is available from Graphics collection as QuerySet.

I use C++ (VS2008) and it's declared in Imsigx.h

During development I used VB6. I don't remember which reference it was, but it should work. Only problem I have is with language versions (didn't solve it).
Hi mh
it would be nice if you remember. Do you have any sourcecode VB6 using the QuerySet?

best regards
Bernd

Logged


* September 29, 2010, 05:06:57 AM
#4
I don't have access to the development environment at this moment, but I found the sources for my VB6 tests.

These are the references from .vbp file:
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\WINDOWS\system32\stdole2.tlb#OLE Automation
Reference=*\G{6A481400-E531-11CF-A115-00A024158DAF}#4.0#0#..\..\..\..\CAD\TurboCad17Prof\Program\imsigx17.dll#TurboCAD v4.1 Programmable Objects.
Reference=*\G{61613A24-D03A-47F9-91FA-090AEF97BC9F}#1.0#0#..\..\..\..\CAD\TurboCad17Prof\Program\Draggers\TCFile.dll#TurboCAD's file converter
Reference=*\G{6A481405-E531-11CF-A115-00A024158DAF}#8.0#0#..\..\..\..\CAD\TurboCad17Prof\Program\imsigxext\GXMPS17.dll#GXMPS 8.0 Type Library

I suppose the Draggers\TCFile.dll is not necessary. I have TCad Professional.

In the VB6 test I didn't use the QuerySet function, but some other functions of the Graphics class. If you can see the class, but not the method, let me know .. if I would find some time, I will try it (but I don't promise that ... tight deadlines)

Have a nice day,
Milan

Logged


* September 29, 2010, 11:52:46 AM
#5
Hi Milan

the queryset is in IMSIGX Type library
maybe I had the wrong syntax in the past.

Dim gset As GraphicSet
'Set gset = ActiveDrawing.Graphics.QuerySet("PenColor=255") Syntax example in TurboCAD SDK Documentation, July 29, 2002 Edition don´t work
'Set gset = ActiveDrawing.Graphics.QuerySet("'Line Color'='Red'") work
Set gset = ActiveDrawing.Graphics.QuerySet("ALL AND 'Object type'='Line' ") 'work
Debug.Print gset.Count
Set gset = Nothing

To come back to your initial question: I think you have to use the english language for the query.

best regards
Bernd

Logged


* September 29, 2010, 09:43:37 PM
#6
Hello,
the Query language is undocumented, at least in the help. I think I saw a BNF definition at some point somewhere, but it was that of English version.

In German version of TurboCad it's translated and the Query "ALL" working in English version doesn't help, you have to use the German word "ALLE". More to it, although you go over API, on failure you get user dialogs from TurboCad (at least two), which the user has to manually close, before you get back to your code.

I tried to find in the API some way how to get the language of the TurboCad, but wasn't successful, Application.Version, Application.Build, Application.Properties ... nothing helped. I don't know what is Application.Environment, I couldn't iterate it (I didn't try VB6 when thinking of it now). Closest were Application.Properties, there are multiple language relevant strings, but they all are user definable, so it's imprecise to use.

Unfortunately, my project is already over it's deadline and we ended up in not supporting other languages.

Wish you all happy development and if anybody would have an answer, post it in.
Yours
Milan

Logged


* September 29, 2010, 11:46:57 PM
#7
Hi milan
>>the Query language is undocumented ..<<
is slightly incorrect. There exist a code example in the  tcwapi10.h
It is rare documented and much the worse, it is incorrect!!


'//Coding Example
'//   'select all graphics with type = circle
'//    g = TCWSelectByQuery("Type = Circle/Ellipse")
'//    result = TCWClearSelection()
'//   ...
'//
'//Declaration
Declare Function TCWClearSelection lib "TCAPI11" () As Long


I remember that I tried this code
Declare Function TCWClearSelection lib "TCAPI17" () As Long
with no success.

best regards
Bernd

« Last Edit: September 30, 2010, 10:12:03 AM by ibruethsch »

Logged