Examples for inputPointManager ???

Examples for inputPointManager ???

Anonymous
Not applicable
227 Views
2 Replies
Message 1 of 3

Examples for inputPointManager ???

Anonymous
Not applicable
I run the Tony's inputpointmanager program in VB5. I don't quite sure about this program. Can anyone tell me about this program or give me a simple explanation to show how this program works.
0 Likes
228 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
On Sat, 24 Feb 2001 07:31:51 -0800, phuwanart
wrote:

>I run the Tony's inputpointmanager program in VB5. I don't quite sure about this program. Can anyone tell me about this program or give me a simple explanation to show how this program works.

Here's a simple demo of InputManager which creates a circle and moves
it around on a drawing.
Watch out for word wrapping!

Create a UserForm with a CommandButton.
In Tools > References check AcadX 1.0 Type Library
Set the CommandButton to run the PlaceCircle sub.

Add this to Userform General Declarations

Option Explicit
Dim mbolCircleDrawn As Boolean
Dim mobjCircle As AcadCircle
Dim mvarOldPoint As Variant
Dim AcadX As ACADXLib.AcadXApplication
Dim WithEvents InputMan As AcadXInputManager
Dim Acad As AcadApplication

Add this to UserForm_Activate()

Set Acad = GetObject(, "AutoCAD.Application.15")
Set AcadX = Acad.GetInterfaceObject("AcadX.Application")
Set InputMan = Acad.GetInterfaceObject("AcadX.InputManager")

Add these subs

Private Sub InputMan_InputPointEvent(Document As AcadDocument,
RawPoint As Variant, ComputedPoint As Variant, ByVal History As Long)
'when InputMan.InputPointEventsEnabled is set to True
'in PlaceCircle, this event fires whenever the mouse is moved
'it will move the circle until the mouse is clicked
'(mouse click is detected in PlaceXRef, not here)

On Error Resume Next

If History = 0 Then Exit Sub

If Not mbolCircleDrawn Then
'place a circle in the drawing to begin with
Set mobjCircle = ThisDrawing.ModelSpace.AddCircle(ComputedPoint,
5)
mbolCircleDrawn = True
mvarOldPoint = ComputedPoint
Else
'moves the XRef with the cursor until the mouse is clicked
mobjCircle.Move mvarOldPoint, ComputedPoint
mvarOldPoint = ComputedPoint
End If

End Sub

Private Sub PlaceCircle()
'enables InputMan.InputPointEvent

Dim varDummyPoint As Variant

'hide the form
Me.Hide

'set InputMan.InputPointEvent to fire
InputMan.InputPointEventsEnabled = True
mbolCircleDrawn = False

'this sub will now wait until the mouse is clicked
'meanwhile the InputMan.InputPointEvent will create
'the circle and move it around
varDummyPoint = ThisDrawing.Utility.GetPoint

'set InputMan.InputPointEvent disabled
'the circle will now stay where it was when
'the mouse was clicked
InputMan.InputPointEventsEnabled = False

'show the form again
Me.Show

End Sub

Ray Greene.
0 Likes
Message 3 of 3

Anonymous
Not applicable
Attached to this is a slighly more complex example of using
the InputManager from AcadX. I wrote this after getting tired
of bugging Tony for a more comprehensive example.

Use it at your own risk, of course.

Regards,
Bill
"phuwanart" wrote in message
news:f02d7b4.-1@WebX.maYIadrTaRb...
I run the Tony's inputpointmanager program in VB5. I don't quite sure about
this program. Can anyone tell me about this program or give me a simple
explanation to show how this program works.
0 Likes