Deleting centerlines on a drawing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've got this bit of code that is supposed to delete all centerlines on my drawing sheet.
j = oSheet.Centerlines.Count
For i = 1 To j
Try
oSheet.Centerlines.Item(i).Delete()
Catch ex As Exception
End Try
Next
Howver, I find that (inellegantly) I have to run it a few times in my code to actually remove all centerlines.
For some reason I get exceptions on some. It's not as though they have child/parent relationships - they are just workplanes displayed on the drawing.
The workplanes were created using this code:
j = oPartCompDef.WorkPlanes.Count
For i = 4 To j
oWP = oPartCompDef.WorkPlanes.Item(i)
Dim oWPpx As WorkPlaneProxy
Call oOcc.CreateGeometryProxy(oWP, oWPpx)
Call oDrawingDoc.Sheets(1).DrawingViews(1).SetVisibility(oWPpx, True)
Next
Does anyone have any ideas on why this is happening?
Thanks in adavance
Dave
envisage uk