News:

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

Main Menu

Application, Drawing and Graphic Properties

Started by cwcookman, December 04, 2009, 12:13:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cwcookman

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]


cwcookman

I was wondering whether anyone was able to get the tool running in something other than Excel97 and TCad 10.2?

CWC

cwcookman

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

millerdlca

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

cwcookman

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

millerdlca

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]

cwcookman

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

millerdlca

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

Brad Easterday

Quote from: cwcookman on December 14, 2009, 06:24:01 PM
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.
Brad E.
TC 2022, 2023 Platinum
Windows 11 (64-Bit)

cwcookman

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

ibruethsch

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