AcadX

AcadX

Anonymous
Not applicable
1,043 Views
12 Replies
Message 1 of 13

AcadX

Anonymous
Not applicable
does anyone use this? I just downloaded some samples and such from the
website.
I am trying to work with the InputPoint example.
I have added code to put the form always on top, this way I can have acad
maximized and
still see the form.
the form is on top with respect to all apps except ACAD.
Does the AcadX dll make it impossible to have a form always on top?
VB6 SP4
A2K
WinNT 4.0 SP6
I used the following to put the form on top.

Option Explicit
Public Acad As AcadApplication
Public Doc As AcadDocument
Public AcadX As AcadXApplication
Public WithEvents InputMan As AcadXInputManager
Public IsDragging As Boolean

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long,
ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long,
ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1

Private Sub Form_Load()
Set Acad = GetObject(, "AutoCAD.Application.15")
Set Doc = Acad.ActiveDocument
Set AcadX = Acad.GetInterfaceObject("AcadX.Application")
Set InputMan = Acad.GetInterfaceObject("AcadX.InputManager")
InputMan.InputPointEventsEnabled = True
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub
0 Likes
1,044 Views
12 Replies
Replies (12)
Message 2 of 13

Anonymous
Not applicable
Have you tried contacting the author (Tony Tanzillo) directly? He
hasn't visited this group in quite a while so you'd probably have
better luck with email.

--
http://www.acadx.com
"You keep using that word. I do not think it means what you think it
means."

"Mike Daugird" wrote in message
news:AC1B18658B28B146E2499C30E350ED0E@in.WebX.SaUCah8kaAW...
> does anyone use this?
0 Likes
Message 3 of 13

Anonymous
Not applicable
Mike I have not used AcadX, I'd reccomend if you are just trying to make
your form on top, try this (this is in a form)....

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long,
ByVal hWndNewParent As Long) As Long

Private Sub Form_Load()
Dim oAcad As AcadApplication
Dim hWnd As Long

Set oAcad = GetObject(, "AUTOCAD.APPLICATION")
hWnd = FindWindow(vbNullString, oAcad.Caption)
SetParent Me.hWnd, hWnd

End Sub

It's less code / work / resources than the alternative you asked about.

Regards,
Jacob Dinardi

Mike Daugird wrote in message
news:AC1B18658B28B146E2499C30E350ED0E@in.WebX.SaUCah8kaAW...
does anyone use this? I just downloaded some samples and such from the
website.
I am trying to work with the InputPoint example.
I have added code to put the form always on top, this way I can have acad
maximized and
still see the form.
the form is on top with respect to all apps except ACAD.
Does the AcadX dll make it impossible to have a form always on top?
VB6 SP4
A2K
WinNT 4.0 SP6
I used the following to put the form on top.

Option Explicit
Public Acad As AcadApplication
Public Doc As AcadDocument
Public AcadX As AcadXApplication
Public WithEvents InputMan As AcadXInputManager
Public IsDragging As Boolean

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long,
ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long,
ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1

Private Sub Form_Load()
Set Acad = GetObject(, "AutoCAD.Application.15")
Set Doc = Acad.ActiveDocument
Set AcadX = Acad.GetInterfaceObject("AcadX.Application")
Set InputMan = Acad.GetInterfaceObject("AcadX.InputManager")
InputMan.InputPointEventsEnabled = True
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub
0 Likes
Message 4 of 13

Anonymous
Not applicable
"Jacob Dinardi" wrote in message
news:D6F6E3E77BA516D3E2D09D62605428A1@in.WebX.SaUCah8kaAW...
> Mike I have not used AcadX, I'd reccomend if you are just trying to make
> your form on top, try this (this is in a form)....
>
> It's less code / work / resources than the alternative you asked about.

You probably misunderstood Mike's request. He's not trying to
use AcadX to keep a window on top.

Regards,
Phil
0 Likes
Message 5 of 13

Anonymous
Not applicable
Mike - I use the InputManager class in AcadX extensively in my
VB6 applications, and I have not seen the problem you noted.

Also, I tried the InputPointVB sample with your modified
stay-on-top code and it worked as one would expect.

Regards,
Phil

"Mike Daugird" wrote in message
news:AC1B18658B28B146E2499C30E350ED0E@in.WebX.SaUCah8kaAW...
> does anyone use this? I just downloaded some samples and such from the
> website.
> I am trying to work with the InputPoint example.
> I have added code to put the form always on top, this way I can have acad
> maximized and
> still see the form.
> the form is on top with respect to all apps except ACAD.
> Does the AcadX dll make it impossible to have a form always on top?
> VB6 SP4
> A2K
> WinNT 4.0 SP6
> I used the following to put the form on top.
>
> Option Explicit
> Public Acad As AcadApplication
> Public Doc As AcadDocument
> Public AcadX As AcadXApplication
> Public WithEvents InputMan As AcadXInputManager
> Public IsDragging As Boolean
>
> Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long,
> ByVal hWndInsertAfter As Long, _
> ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long,
> ByVal wFlags As Long) As Long
> Private Const HWND_TOPMOST = -1
> Private Const SWP_NOMOVE = &H2
> Private Const SWP_NOSIZE = &H1
>
> Private Sub Form_Load()
> Set Acad = GetObject(, "AutoCAD.Application.15")
> Set Doc = Acad.ActiveDocument
> Set AcadX = Acad.GetInterfaceObject("AcadX.Application")
> Set InputMan = Acad.GetInterfaceObject("AcadX.InputManager")
> InputMan.InputPointEventsEnabled = True
> SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
> End Sub
>
0 Likes
Message 6 of 13

Anonymous
Not applicable
thank you all for your help.
The thank you thread was ment to go here.
Jacob Dinardi's code works well for me.
His code puts my form on top of autocad only, this
is nice because if a user minimizes autocad my app goes with it.
Originally I was just trying to put my form on top of everything
but makeing autocad the parent form of my app is a better way
to do it. Thank you to everyone who responded.

Is there a way I can capture a click event with AcadX?
0 Likes
Message 7 of 13

Anonymous
Not applicable
Glad you liked the code. Just a different approach.

Regards,
Jacob Dinardi

Mike Daugird wrote in message
news:CF4D15E1F2162162C0391640752D7702@in.WebX.SaUCah8kaAW...
thank you all for your help.
The thank you thread was ment to go here.
Jacob Dinardi's code works well for me.
His code puts my form on top of autocad only, this
is nice because if a user minimizes autocad my app goes with it.
Originally I was just trying to put my form on top of everything
but makeing autocad the parent form of my app is a better way
to do it. Thank you to everyone who responded.

Is there a way I can capture a click event with AcadX?
0 Likes
Message 8 of 13

Anonymous
Not applicable
"Mike Daugird" wrote in message >

> Is there a way I can capture a click event with AcadX?

You might try contacting the author directly
(tony.tanzillo@worldnet.att.net).

The InputPointEvent event function has a History parameter
that might work for this. I'm pretty sure the value changes when
the mouse button is down, but I don't recall the exact details.

Another way may be to use the InputManager's EndGetPoint()
event handler, which is fired when the user responds to a prompt
for coordinate input.

You might also try contacting the author of AcadX directly (I
haven't seen him post here recently, not sure why).

Regards,
Phil
0 Likes
Message 9 of 13

Anonymous
Not applicable
I'm trying out Tony Tanzillo's AcadX.arx and I'm having trouble
loading it into VBA.

I found that if I take one of the sample applications, strip out all
the existing code and create my app on top of it works, but if I then
export all my code and import it into a new app I get the error
message "User-defined type not defined" when it tries to load any of
the AcadX classes.

All the code is identical in both cases, but the original dvb file is
around 60KB larger than the new one.

Any tips on what I'm doing wrong?

Ray Greene.
0 Likes
Message 10 of 13

Anonymous
Not applicable
Are you adding a reference to the AcadX 1.0 type library?

--
http://www.acadx.com
"You keep using that word. I do not think it means what you think it
means."

"Ray Greene" wrote in message
news:3a905f61.18589069@discussion.autodesk.com...
> I'm trying out Tony Tanzillo's AcadX.arx and I'm having trouble
> loading it into VBA.
>
> I found that if I take one of the sample applications, strip out all
> the existing code and create my app on top of it works, but if I
then
> export all my code and import it into a new app I get the error
> message "User-defined type not defined" when it tries to load any of
> the AcadX classes.
>
> All the code is identical in both cases, but the original dvb file
is
> around 60KB larger than the new one.
>
> Any tips on what I'm doing wrong?
>
> Ray Greene.
0 Likes
Message 11 of 13

Anonymous
Not applicable
On Sun, 18 Feb 2001 20:05:02 -0800, "Frank Oquendo"
wrote:

>Are you adding a reference to the AcadX 1.0 type library?

You mean: Public AcadX As ACADXLib.AcadXApplication ?

I assume that's all that's needed as it's what is in the sample code.
Or have I missed something?

Ray Greene.
0 Likes
Message 12 of 13

Anonymous
Not applicable
Open the VBAIDE and click on Tools -> References. This will display a list
of available references. Make sure that there is a check in the box beside
the AcadX 1.0 type library.

--
Best Regards,

D. M. Levesque
0 Likes
Message 13 of 13

Anonymous
Not applicable
On Mon, 19 Feb 2001 07:08:17 -0800, "D. M. Levesque"
wrote:

>Open the VBAIDE and click on Tools -> References. This will display a list
>of available references. Make sure that there is a check in the box beside
>the AcadX 1.0 type library.

Of course, that's what Frank was referring to. Duh!
Well, yeah, that fixed it all right..

Can't believe I didn't think to do that myself though

Thanks for giving instructions simple enough for me to understand 🙂

Ray Greene.
0 Likes