Thanks for the input guys.
Below is my macro
----------
Sub RotateSketch()
Dim oApp As Inventor.Application
Set oApp = ThisApplication
Dim oDoc As Document
Set oDoc = oApp.ActiveDocument
Dim oTxnMgr As TransactionManager
Set oTxnMgr = ThisApplication.TransactionManager
' Start a transaction
Dim oTxn1 As Transaction
Set oTxn1 = oTxnMgr.StartTransaction(oDoc, "MyRotateSketchMacro")
Dim oActvieSketch As PlanarSketch
If oDoc.ActivatedObject.Type = kPlanarSketchObject Then
Set oActvieSketch = oDoc.ActivatedObject
Else
MsgBox "Please exit the sketch you wish to rotate the geomerty on then re-run the macro", vbCritical
Exit Sub
End If
Dim oSketchObjects As Inventor.ObjectCollection
Set oSketchObjects = oApp.TransientObjects.CreateObjectCollection
Dim oSketchEntity As SketchEntity
Dim SketchConstraints As SketchConstraintsEnumerator
Dim SketchConstraint As Variant
For Each oSketchEntity In oActvieSketch.SketchEntities
Set SketchConstraints = oSketchEntity.Constraints
For Each SketchConstraint In SketchConstraints
If SketchConstraint.Type <> kTwoPointDistanceDimConstraintObject And _
SketchConstraint.Type <> kOffsetDimConstraintObject And _
SketchConstraint.Type <> kDiameterDimConstraintObject And _
SketchConstraint.Type <> kRadiusDimConstraintObject _
Then
If SketchConstraint.Type = kGroundConstraintObject And SketchConstraint.Deletable = True Then
On Error Resume Next
SketchConstraint.Delete
End If
End If
Next
oSketchObjects.Add oSketchEntity
Next
' Set a reference to the transient geometry collection.
Dim oTransGeom As TransientGeometry
Set oTransGeom = ThisApplication.TransientGeometry
Dim oPoint As Point2d
Set oPoint = oTransGeom.CreatePoint2d(0, 0)
Dim dDeg As Double
dDeg = InputBox("Enter Angle to Rotate", "RotateSketch", 270)
Dim dPi As Double
dPi = dDeg * Atn(1)
Call oActvieSketch.RotateSketchObjects(oSketchObjects, oPoint, dPi, False, True)
oTxn1.End
End Sub
------------------
I have attached two sketches (Inventor 2013 format).
One that will rotate and one that will not rotate using the macro.
If you could help me work out why the one of them will not rotate that would be fantastic.
Thanks
Stuart