News:

When replying to a specific statement be sure to quote the previous post.

Main Menu

VBA - Room Name Macro

Started by enzof, November 10, 2009, 04:59:27 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

enzof

Here's a macro I created a while ago and use every day (and posted in the old forum a couple of years ago). Basically, it pastes room names at the cursor location from a list box. Obviously, you can use other text than room names. There are two files; the macro itself and the text file (room.txt). I have the macro and the text file in the default MACROS folder. You may have to change the path with in the macro as I have a ver 9 setup. Also, there are options for font and text height but, you have to change them from the VBA editor. Hope someone can get some use out of it.

Enzo

[attachment deleted by admin]

ibruethsch

#1
Hi Enzo
Many thanks fort his tool.
It will spare me a lot of typing.
In my case I had to change
AppActivate "TurboCAD"
to
AppActivate "TurboCAD Professional"

But then it works fine.

I tried to add a feature to choose the Text Style , but had no success.
I want to choose a text style which I created in the Style manager.
Does anybody know the right syntax for that?

Any help is appreciated

Bernd

KS

Hi

I download it and unzip it, and got two files, Labe.txt and roomname.tcm.

I tried to open the tcm file with the macro palet, but this is proberly wrong.

How shall I use them?

Kai Sannes
Kai Sannes, Former Norwegian TurboCAD salesperson and instructor.
Dell Precision 7740 laptop
Windows 11 Pro, www.kaisannes.com

mikek

Hi Kai,

you can't open the macro in the macrorecorder palette because this macro was written for the vba environment which was dropped by IMSI in TC 11. To rewrite the code for use with vbscript or in the
macro palette is not a trivial task- the original macro uses a listbox which is filled with the content of
label.txt where You can change the entries for Your drawing. List or Combo boxes are not supported by
the macro recorder or vbs. One possibility to run the code would be to rewrite the code for use with Visual Basic and get an exe or dll file or to use the scripting language together with a html document.

Attached is a pdf file with the original code of the tcm. macro

mike

ibruethsch

Hello
I use this tool often.
I made an .exe with VB6.
I use full path to the room.txt
D:\Program Files (x86)\IMSIDesign\TCWP18\Macros\meine\room.txt

You have to create the full path before using this .exe
Please have a try. If it do not run on your system, don´t blame me. Vb6 is very old.

best regards

Bernd

ibruethsch

Hi Kai
in case you use TC18pro you can have access to the rommname.exe in the menue using the rubyconsole.
in the roomname.rb I also use full path. (D:\Program Files (x86)\IMSIDesign\TCWP18\Macros\vb\roomname\roomname2011.exe)
Is easy to change in an texteditor.
unzip and copy to ...\tcwp18\progam\rubyscript
You need the win32ole in the same folder. It is included in the .zip-file.
best regrads

Bernd