Controlling a CAD-program (SE 15) using VB.NET

PsychoBlade

New member
Joined
Jun 6, 2004
Messages
1
I have the source code for the mouse query of a CAD program (Solid Edge V15) using Visual Basic 6.0 which is working wonderful with Visual Studio 6.0. Now I have to rewrite this code to work with Visual Basic .Net using Visual Studio .Net and I can't get it running. I get the error message that there is a type library missing and that I should install Visual Studio 6.0 as well. But unfortunately this is not possible on the system that I have to use.

I'm using the control elements "igCommand" and igMouse" which I get from Solid Edge.

- The Source Code consists of a form with just the empty "Sub Main" being
used as the start object.

VB.NET:
Public Sub Main()
End Sub
There also is a class with the following code:

VB.NET:
Private Sub Class_Terminate()
	Unload DrawHexagon
End Sub
 
Public Sub Command_Initialize(BasicCmd As Object)
	Set DrawHexagon.igCommand1.Command = BasicCmd
End Sub

- The main form ("DrawHexagon") has this code:
(I didn't include the code for the function ("Hexagon"9 since this is not
important for my issue and the function is already working in VB.Net)

VB.NET:
Private Sub cmdCancel_Click()
	Unload Me
End Sub
Private Sub igCommand1_Activate()
	DrawHexagon.Show
	txtHexagonSize.SelLength = Len(txtHexagonSize.Text)
End Sub

Private Sub igCommand1_Deactivate()
	DrawHexagon.Hide
End Sub

Private Sub igMouse1_MouseClick(ByVal Button As Integer, _
								ByVal Shift As Integer, _
								ByVal x As Double, _
								ByVal y As Double, _
								ByVal z As Double, _
								ByVal Window As Object, _
								ByVal KeyPointType As Long, _
								ByVal Graphic As Object)
	
	DrawHexagon.Hide
	
	Call Hexagon(x, y, CDbl(txtHexagonSize) * 0.001)
	
	DrawHexagon.Show
	
End Sub

Private Sub igMouse1_MouseMove(ByVal Button As Integer, _
							   ByVal Shift As Integer, _
							   ByVal x As Double, _
							   ByVal y As Double, _
							   ByVal z As Double, _
							   ByVal Window As Object, _
							   ByVal KeyPointType As Long, _
							   ByVal Graphic As Object)

	Dim strOut As String
	
	txtCoordinateX.Text = Format(x, ".0000")
	txtCoordinateY.Text = Format(y, ".0000")

End Sub
I suppose, that in VB.Net I don't use these extra class and extra form and include their task into the main form "DrawHexagon" (parts of it in the "Sub New" section). But I'm not able to get it running. Using this old method with extra class and extra form nothing is happening. And trying to move their function into the main form the "DrawHexagon" form pops up, but querying the mouse of the solid edge application doesn't work at all. I hope there's someone out there who can help with this problem!!

Thanks,
Blade
 
Some thoughts

have you tryed declaring your calss with events? I often have this issue when conrtolling other apps. Also the files that you got from the vendor, are they just com objects? if so I think that would be where you need to declare them with events. It looks like the events you are trying to trigger is never firing at all because .net is not looking for events to occur. Just my thoughts


T
 
Back
Top