Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I have been trying to call a Sub on a Button Event and no luck
Public Class frmFLOR
Sub Main()
Dim invApp As Inventor.Application = GetObject(, "Inventor.Application")
AddSketch(invApp)
End Sub
Private Sub btnSketch1_Click(sender As Object, e As EventArgs) Handles btnSketch1.Click
' here is how I call the sub, But it doesnt Work
AddSketch()
End Sub
Public Sub AddSketch(ThisApplication As Inventor.Application)
Dim oCompDef As PartComponentDefinition
oCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oSketch As PlanarSketch
oSketch = oCompDef.Sketches.Add("XY Plane", True)
oSketch.Name = "Master Sketch"
End Sub
End Class
Any help would be apreciated
Solved! Go to Solution.