News:

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

Main Menu

Insert object macro

Started by Ben Morris, November 26, 2011, 07:55:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ben Morris

Hello
I use excel for my material lists in turbo-cad,and was wondering if it was possible to make a macro that would insert file into my paper-space drawing with a macro.I am using version 15 and the steps I use to insert file  are insert/object/create from file/link and then I browse for my file.What i was hoping was that I could build a macro with a shortcut key that would take me to a specific folder then I could find the file and insert it.I am not very good with macros so any help would be appreciated.
Thanks in advance
Ben

ibruethsch

Hi Ben
I recommend autoIT

its easy and its free.

I attached code and .exe

;AutoItSetOption("WinTitleMatchMode","2")
;WinActivate("TurboCAD Professional", "")
sleep(500)
$l = WinExists("TurboCAD Professional")
If $l = 0 Then
MsgBox(4096,"", "Turbocad läuft nicht",10)
Exit
EndIf
;Global $Paused
$i=1



WinActivate("TurboCAD Professional", "")
sleep(500)
$l1 = 0
;send("{ALT}")
send("!ib")
sleep(500)
send("!u")
;send("!ils")
sleep(250)
send("{TAB}")
sleep(500)
;choose the location you want to start with e.g. e:\temp
$l1 = "e:\temp"
send($l1)
sleep(250)
send("{TAB}")
sleep(250)
send("{ENTER}")

best regards
Bernd

Ben Morris

Thanks for your help but I get an error that says compilation error line 0 error:0

ibruethsch

Hi Ben
you get the errormessage starting the .exe
or starting
.au3 from autoIT?

Bernd

Ben Morris

I get an error message when I paste the code into turbocads macro recorder
Sorry I should of stated that before