Message 1 of 5
Macro delete project geometry in sketch

Not applicable
07-31-2013
07:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello.
I wish to delete all project geometry in the active drawingsketch with 1 click
But unsure how to get to these constraints.
Are these geometricConstraints?
What I have now doesnt work:
Select Case ThisDoc.Document.DocumentType
Case 12292:
Case Else: MsgBox("Current Document not a drawing document")
Exit Sub
End Select
If Not TypeOf ThisApplication.ActiveEditObject Is Sketch Then
MsgBox("Please activate a sketch")
Exit Sub
End If
Dim oDoc As DrawingDocument = ThisDoc.Document
Dim oSketch As Inventor.DrawingSketch = ThisApplication.ActiveEditObject
Dim oGeos As GeometricConstraints = OSketch.GeometricConstraints
Dim oGeo As GeometricConstraint
For Each oGeo In oGeos
oGeo.delete
Next
What am I doing wrong?
Thx in advance,
Arnold