Message 1 of 3
Automated Centerlines iLogic

Not applicable
01-09-2016
06:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have found parts of some code and written the rest to place automated centerlines on holes and projected parallel axis on all views on a drawing. But I am having some trouble with the code. It will place the centerlines on the holes but not the projected parallel axis. Also, the remove unattached centerlines is not working. I'm sure I just have a small error somewhere but I am missing it. Thanks in advance!
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 9446 StartFragment: 314 EndFragment: 9414 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet
'Set a reference to the active drawing document Dim oDoc As DrawingDocument oDoc = ThisDoc.Document Dim oSheets As Sheets Dim oSheet As Sheet Dim oViews As DrawingViews Dim oView As DrawingView oSheets = oDoc.Sheets oSheet = oDoc.ActiveSheet 'For each view add centerlines to holes and projection parallel axis For Each oSheet In oSheets oViews = oSheet.DrawingViews For Each oView In oViews Dim oCenterline As AutomatedCenterlineSettings oView.SetAutomatedCenterlineSettings(oCenterline) oCenterline.ApplytoHoles = True oCenterline.ProjectionParallelAxis = True Dim resultCenters As ObjectsEnumerator resultCenters = oView.SetAutomatedCenterlineSettings(oCenterline) Next Next ' Delete all unattached centerlines For Each centerLine In oSheet.CenterLines If (Not centerLine.Attached) Then centerLine.Delete() End If Next