TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
All posts discussing pricing or where to buy TurboCAD will be deleted.

Application, Drawing and Graphic Properties
Read 10370 times
* December 04, 2009, 12:13:00 PM
Years ago Tom Snape provided us with a TurboCad Macro that would enumerate the properties of the current Application Object, the Current Drawing Object and the !st Grapic in a drawing.

As TurboCad no longer includes VBA, the newer users of TurboCad cannot run the macro.

I have taken the liberty of converting Toms' code to run in Excel VBA.  It is attached as ExtProps.xls.  It is in excel 97 format.

For forward compatabilty purposes, I use Excel 97 and TurboCad 10.2.  

Those of you that use something newer than Excel 97 and TurboCad 10.2 will need to change the references for the tool.  To change the tool references start the the  Excel Visual Basic Editor.  Once in the editor, under TOOLS- REFERENCES change the references to fit whats on your system.

The references needed for my system that runs EXCEL 97 and TCAD 10.2 are

1) Visual Basic for applications C:Program Files\common Files\Microsoft shared\VBA\VBA332.DLL
2) Microsoft Excel 8.0 Object Library C:Program Files\Microsoft Office\Office\Excel8.OLB
3) Microsoft Forms 2.0 Object Library C:WINNT\System32\FM20.DLL
4) TurboCAD v4.1 Programable Objects C:Program Files\IMSI\TCWP100\Program\IMSIGX10.dll

To use the tool, once you have the references correctly configured for your system, create a new drawing containing one graphic of the type you wish to investigate and click the "ExProps" button on the spreadsheet.  Once the tool starts, depending on what properties you are investigating,  click either the  "Application", "Drawing" or "Graphic(0)" button.  To copy the contents of the listbox to the clipbord click the "Copy" button.  The "Exit" button sets all objects to nothing and exits the tool.

Note the drawing must contain one graphic for the "Graphic" button to be enabled.

Enjoy,
CWC

[attachment deleted by admin]
« Last Edit: December 05, 2009, 07:45:28 AM by cwcookman »

Logged


December 04, 2009, 01:05:55 PM
#1
Many thanks CWC!!

Logged
Thanks,
Dave Taylor
TurboCAD Product Manager


* December 14, 2009, 06:24:01 PM
#2
I was wondering whether anyone was able to get the tool running in something other than Excel97 and TCad 10.2?

CWC

Logged


* December 24, 2009, 02:21:52 PM
#3
No one responded whether they were able to get the tool running in something other than Excel97 and TCad 10.2.

So lets try the converse.  Did anyone try an not have sucess?

CWC

Logged


* December 26, 2009, 05:34:38 PM
#4
Seems to work fine in Excel 2007 and Turbocad V15.2.  Checked the references but all the correct selections were already selected upon opening the Excel file.

Dennis

Logged


* December 31, 2009, 01:23:24 PM
#5
millerdlca, what references were selected in your Excel 2007 and Turbocad V15.2 system?

Now that I know it works with other versions of Excel and TCad,  I will consider posting some of the macros I downloaded previously in Excel enabled form, when it seems appropriate.

CWC

Logged


* December 31, 2009, 07:15:09 PM
#6
Here's a screen shot of the references. These are what come up automatically - I didn't have to  change anything.

Dennis

[attachment deleted by admin]

Logged


* January 01, 2010, 07:59:28 AM
#7
millerdlca,

Thank You for the screen shot.  We can see on the bottom of your screen shot that a reference to TurboCAD v4.1 Programable Objects IMSIGX15.dll was set, while my system required IMSIGX10.dll.  I assume the VBA and Excel references are different also.

I would like to hear if anyone has an idea what is going on in the background that correctly resets the references to match the system.

Thanks,
CWC

Logged


* January 01, 2010, 11:16:21 PM
#8
Pure speculation, but I would assume that the reference name is kept the same as long as a new dll is backward compatible.  That way any old macros would continue to work with new dlls, just as yours did.  There is a registry entry that provides a cross reference between the dll and the reference name so I assume that when newer software is installed it just uses the same reference name but puts in the new dll path.

Dennis

Logged


March 02, 2010, 10:12:43 PM
#9
I was wondering whether anyone was able to get the tool running in something other than Excel97 and TCad 10.2?

CWC

It works for me using Excel 2007 and TurboCAD v16.

Logged
BradE [ dean3Design ]
Core i7-3930K CPU @ 4.20GHz, 32GB 1333 DDR3, FirePro V5900
TC 21 Platinum (64-Bit) Running on Win7 Pro SP1


* March 06, 2010, 04:17:15 PM
#10
Brad,

Thanks for getting back.

I have a very small percentage of what was posted to the old forum; however, where I see a need and given the time, I will post other macro samples from the old forum.

This small example should show anyone interested that the VBA engine need not be installed in TurboCad to access the SDK.

I personally find VBA automation of TurboCad more efficient, but admittedly slower from Excel.  When I require more speed I will code a TurboCad tool using Visual Basic 6.  Even when I code a tool my initial devrelopment work is done in VBA as it is easier for me to do the debugging in VBA.

As I understand it, in the old TurboCad VBA all the functions we wanted to use in the macro needed to be packaged into the TCM macro file.

When we automate TurboCad using Excel VBA we can use a TurboCad specific VBA module (in Excel VBA) containing the commonly used functions related to TurboCad.  It avoids duplication and allows us to have one copy each of our core functions.  When we realize there a better/faster way to code our function we only need to recode one version and not edit each and every macro we created from day one.


CWC

Logged


* March 25, 2014, 04:50:01 AM
#11
Hi
the last days I did again some programming in TC and used this tool a lot. So I will share it.
It was an old vba-macro . Possibly it was created by Tom Snape, but I donīt know really.
regards
Bernd

Logged