Delete all unattached centerlines and dimensions

Delete all unattached centerlines and dimensions

Anonymous
Not applicable
1,167 Views
2 Replies
Message 1 of 3

Delete all unattached centerlines and dimensions

Anonymous
Not applicable
Hello,

I found this sample. But how could I delete all the unattached centerlines?


Public Sub DeleteUnattachedDimensions()

' Set a reference to the active drawing document
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

' Set a reference to the active sheet
Dim oSheet As Sheet
Set oSheet = oDoc.ActiveSheet

Dim oDrawingDim As DrawingDimension

' Iterate over all dimensions in the drawing
' and delete unattached (sick) dimensions.

For Each oDrawingDim In oSheet.DrawingDimensions
If oDrawingDim.Attached = False Then
Call oDrawingDim.Delete
End If
Next

End Sub

Best regards

Georg
0 Likes
1,168 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Centerlines aren't currently exposed by the API so there isn't any way of
doing this. This is a known issue that we plan to address in the future.
--
Brian Ekins
Autodesk Inventor API

"GeorgK" wrote in message
news:5244235@discussion.autodesk.com...
Hello,

I found this sample. But how could I delete all the unattached centerlines?


Public Sub DeleteUnattachedDimensions()

' Set a reference to the active drawing document
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

' Set a reference to the active sheet
Dim oSheet As Sheet
Set oSheet = oDoc.ActiveSheet

Dim oDrawingDim As DrawingDimension

' Iterate over all dimensions in the drawing
' and delete unattached (sick) dimensions.

For Each oDrawingDim In oSheet.DrawingDimensions
If oDrawingDim.Attached = False Then
Call oDrawingDim.Delete
End If
Next

End Sub

Best regards

Georg
0 Likes
Message 3 of 3

Anonymous
Not applicable
I used the Inventor transcript and got this:

ActiveDocument.Execute("Document1","DeleteEmblem","Emblems_Count=1;Emblems_0=Document1.DLSheet577DCSegment.296;")

Is it possible to get the name of the unused centerlines?

Best regards

Georg
0 Likes