TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

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

Insert object macro
Read 2264 times
* November 26, 2011, 07:55:33 AM
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

Logged


* November 26, 2011, 10:43:27 AM
#1
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

Logged


* November 26, 2011, 11:17:30 AM
#2
Thanks for your help but I get an error that says compilation error line 0 error:0

Logged


* November 26, 2011, 11:53:06 AM
#3
Hi Ben
you get the errormessage starting the .exe
or starting
.au3 from autoIT?

Bernd

Logged


* November 26, 2011, 12:08:49 PM
#4
I get an error message when I paste the code into turbocads macro recorder
Sorry I should of stated that before

Logged