Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I prepare code to delete all drawing dimension. But I have a problem with ordinate dimension.
When I have drawing with this kind of dimension my rule have error like on gif.
If I delete ordinate dimension manually (del key) everthing is ok.
Can you help me what is wrong ??
My code:
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
'delete sheet formats
Dim oCurrentNumber As Sheet
oCurrentNumber = oDoc.ActiveSheet
' Iterate through the sheets, and delete the title blocks and symbols
For Each oSheet In oDoc.Sheets
oSheet.Activate
Try
oSheet.TitleBlock.Delete
Catch
'catch error if no border found
End Try
Try
oSheet.Border.Delete
Catch
'catch error if no border found
End Try
Next
'set back to original sheet
oCurrentNumber.Activate
'CLEAR DRAWING
Dim oCL As Centerline
Dim oCM As Centermark
Dim oBalloon As Balloon
Dim oThreadNote As HoleThreadNote
Dim oOrdDim As OrdinateDimension
Dim oDrawingDim As DrawingDimension
For Each oSheet In oDoc.Sheets
oSheet.Activate
For Each oCL In oSheet.Centerlines
'If oCL.Attached = False
oCL.Delete
'End if 'Centerline attached
Next 'Centerline
For Each oCM In oSheet.Centermarks
'If oCL.Attached = False
oCM.Delete
'End if 'Centermarks attached
Next 'Centermarks
For Each oBalloon In oSheet.Balloons
'If oBalloon.Attached = True
oBalloon.Delete
'End If 'Baloon attached
Next 'Balloon
For Each oThreadNote In oSheet.DrawingNotes.HoleThreadNotes
'If oBalloon.Attached = False
oThreadNote.Delete
'End If 'Baloon attached
Next 'Balloon
For Each oSymbol In oSheet.SketchedSymbols
'look for the symbol by name
'If oSymbol.Name = "UWAGA: 1" Then
oSymbol.Delete
'End If
Next
For Each oOrdDim In oSheet.DrawingDimensions.OrdinateDimensions
'If oOrdDim.Attached = False
oOrdDim.Delete
'End If 'Baloon attached
Next
For Each oDrawingDim In oSheet.DrawingDimensions
'If oDrawingDim.Attached = False Then
Call oDrawingDim.Delete
'End If
Next
Next
I try delete this dimension by :
For Each oOrdDim In oSheet.DrawingDimensions.OrdinateDimensions 'If oOrdDim.Attached = False oOrdDim.Delete 'End If 'Baloon attached Next
unfortunetly something go wrong.
Someone help me ??
Thanks in advance
ralfmj
Solved! Go to Solution.