Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all!
Does anyone know how to "Simulate" having pressed the "Start 2D Sketch" button in the toolbar? I am creating a program that will create new parts and then I want the user to be able to choose what axis they start their sketch on.
I could program that myself, but I figure using Inventors built in methods may be nicer. Below is what I have so far, I can get into the part to edit it but I'm not sure how to trigger the sketch creator.
Function CreateFiles(ProjectFolder As String, ProjectName As String)
Dim Origin As Matrix = ThisApplication.TransientGeometry.CreateMatrix()
Dim oPart As PartDocument = ThisApplication.Documents.Add(kPartDocumentObject,,False)
oPart.SaveAs(ProjectFolder & "\" & ProjectName & ".ipt", False)
oPart.Close
Dim oAsm As AssemblyDocument = ThisApplication.Documents.Add(kAssemblyDocumentObject)
oAsm.SaveAs(ProjectFolder & "\" & ProjectName & ".iam", False)
Dim oOcc As ComponentOccurrence = oAsm.ComponentDefinition.Occurrences.Add(ProjectFolder & "\" & ProjectName & ".ipt", Origin) : oOcc.Grounded = True
With ThisApplication.ActiveView.Camera
.ViewOrientationType = ViewOrientationTypeEnum.kIsoTopRightViewOrientation
.Fit
.ApplyWithoutTransition
End With
Dim oOccDef As PartComponentDefinition = oOcc.Definition
oOcc.Edit
End Function
Thanks!
Solved! Go to Solution.