Jump to content

Autocad Lisp and Autoit


RussMuss
 Share

Recommended Posts

Gidday!

We use Autocad in our office and have third party software to capture the job number when we print. However this can be annoying to click okay onto a dialog box everytime we print a drawing. I would like Autolisp (which is a built in programming language within Autocad) to be linked to Autoit. I can write a batch print script in Autolisp but I would like it linked to Autoit to automatically click on to the dialog box to make it 'disappear'. Is there any way to make this work?.

Please note I don't know very much about Autoit, so don't go over my head!

Many thanks if someone could solve our annoying problem

cheers Russ

Link to comment
Share on other sites

Thanks for the reply. I can't figure out how to combine the 2 functions that you have mentioned and make a *.au3 file. Can you give me an idea

I am running Autocad 2007. What is a COM interface?

thanks Russ

Edited by RussMuss
Link to comment
Share on other sites

I have put together the below code. Is this correct? I have tried to run the below script when I am in Autocad and print the dialog box pops up with "Equitrac Office" but the box okay button is not clicked. What am I doing wrong?

If WinExists("Untitled -") Then

MsgBox(0, "Equitrac Office", "Window exists")

EndIf

ControlClick("Untitled -", "", "MDIClient1")

Link to comment
Share on other sites

I have tried your suggestion as below but it does not work. Am I supposed to run the script then when I print a drawing in Autocad it will automatically 'okay' the dialog box that pops up - like it is supposed to? Is the file supposed to be in a particular file search path?

If WinExists("Untitled -") Then

MsgBox(0, "Equitrac Office", "Window exists")

EndIf

ControlClick("Untitled -", "", "button1")

Link to comment
Share on other sites

oops no attachment...... my file was too big! here is a copy paste from the active window.

This is the window when I have the mouse over the ok button. I see what you mean about the name of the okay button

- button3. I did try changing the name to button3 but still nothing happens

ie

If WinExists("Untitled -") Then

MsgBox(0, "Equitrac Office", "Window exists")

EndIf

ControlClick("Untitled -", "", "Button3")

here is the active window.............

Press CTRL-ALT-F to freeze the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Equitrac Office

Class: #32770

Size: X: 452 Y: 426 W: 376 H: 145

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 637 Y: 522

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xD4D0C8 Dec: 13947080

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 161 Y: 68 W: 95 H: 23

Control ID: 1

ClassNameNN: Button3

Text: OK

Style: 0x50010001

ExStyle: 0x00000004

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

C:\Documents and Settings\rxbeeto0\My Documents\Drawing1 Layout (1)

Billing Code

42046954.00010

42046954.00010

OK

Cancel

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

Reset

Link to comment
Share on other sites

okay looking at the help file I have tried this, but I get an error in my expression, the last line is incorrect ,

any ideas what is wrong?

If WinExists("Untitled -") Then

MsgBox(0, "Equitrac Office", "Window exists")

EndIf

ControlClick("Equitrac Office" "OK", "1", "left", "1")

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...