Anonymous
432 Views, 0 Replies
07-02-2018
02:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
07-02-2018
02:29 PM
Create 2D sketch in IDW using API
I need to create a 2D sketch from parameters stored in a CSV file for an object that would be laser cut. The code sample I have does not fail, but results in nothing. I'm running this code in a module withing a larger project which is why I'm calling variables and don't have them declared.
Public Sub Retainer(CompDef, TG, m_inventorApp, Sketch, ID)
Dim DrawDoc = m_inventorApp.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, m_inventorApp.FileManager.GetTemplateFile(DocumentTypeEnum.kDrawingDocumentObject))
Dim Sheet As Sheet = DrawDoc.ActiveSheet
Sheet.Border.Delete()
Sheet.TitleBlock.Delete()
Dim Width As Double = 24 * 2.54
Dim Height As Double = 12 * 2.54
Sheet.Size = DrawingSheetSizeEnum.kCustomDrawingSheetSize
Sheet.Width = Width
Sheet.Height = Height
Sketch(1) = CompDef.Sketches.Add(CompDef.WorkPlanes(3))
Dim Retainer As SketchCircle = Sketch(1).SketchCircles.AddByCenterRadius(TG.CreatePoint2d(0, 0), ID / 2)
DrawDoc.Update()
End Sub