Sub DeleteAllLinesOnLayer(ByVal TargetLayer as String) Dim oEntity as AcadEntity For Each oEntity In ThisDrawing.ModelSpace If oEntity.Layer = TargetLayer And TypeOf oEntity is AcadLine Then oEntity.Delete ThisDrawing.Regen End If NextEnd Sub Note: The "ThisDrawing.Regen" is there just to force the drawing to be updated so you can see each line being deleted. Of course, all of the other entities on the layer (such as text, arcs, etc.) will be left behind.
页:
1
[2]