Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I have following code which places a base view and projected view of a part. Next I am trying to place the automated hole center lines but they are not showing up. Strangely when I debug the code to investigate what is wrong, the center points are correctly created as intended. Any idea what I am doing wrong?
Sub btnGenerateDrawing_Click()
'------ Locating the Template ------'
strLocation = ThisApplication.FileOptions.TemplatesPath
Set oDrgDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, strLocation & "Test.idw")
Dim oSheet As Sheet
Set oSheet = oDrgDoc.Sheets.Item(1)
Dim oPoint1 As Point2d
Set oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(15#, 25#)
Dim oPoint2 As Point2d
Set oPoint2 = ThisApplication.TransientGeometry.CreatePoint2d(15#, 15#)
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.Documents.Open("D:\Updated\Drawing Example\TestPart.ipt", False)
Dim oView1 As DrawingView
Set oView1 = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint1, 0.1, kBottomViewOrientation, kHiddenLineDrawingViewStyle)
Dim oView2 As DrawingView
Set oView2 = oSheet.DrawingViews.AddProjectedView(oView1, oPoint2, kFromBaseDrawingViewStyle, 0.1)
Dim settings As AutomatedCenterlineSettings
Set settings = oDrgDoc.DrawingSettings.AutomatedCenterlineSettings
settings.ApplyToHoles = True
settings.ProjectionParallelAxis = True
Call oView1.SetAutomatedCenterlineSettings(settings)
Call oView2.SetAutomatedCenterlineSettings(settings)
Call oPartDoc.Close(True)
End Sub
best regards,
sam
Solved! Go to Solution.