Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Trying to reposition the Jog Points of an Ordinate Dimension set but Inventor crashes. Moving the text has been successful but continually crashes with jog points.
There maybe something outside the code that is an issue considering this code works for a colleague.
Any thoughts?
Here is the basic code to test the concept, the crash occurs at 'oOrdDimSet.OriginMember.JogPointTwo = oPos':
Sub AdjustOrdinateDimensionJogPoints3()
On Error GoTo ErrorHandler
Dim doc As DrawingDocument
Set doc = ThisApplication.ActiveDocument
If doc Is Nothing Then
MsgBox "No active document found.", vbExclamation
Exit Sub
End If
Dim oSheet As Sheet
Set oSheet = doc.ActiveSheet
If oSheet Is Nothing Then
MsgBox "No active sheet found.", vbExclamation
Exit Sub
End If
Dim oOrdDimSet As OrdinateDimensionSet
Dim oDim As OrdinateDimension
Set oDim = oSheet.DrawingDimensions.item(1)
If oDim.IsOrdinateSetMember Then
oDim.HideValue = True
Set oOrdDimSet = oDim.OrdinateDimensionSet
If oDim Is Nothing Then
MsgBox "No ordinate dimension found on the active sheet.", vbExclamation
Exit Sub
End If
Dim oPos, oPos1 As Point2d
Set oPos = oOrdDimSet.OriginMember.JogPointTwo
Set oPos1 = oOrdDimSet.OriginMember.Text.Origin
oPos.Y = oPos.Y + 1
oPos1.Y = oPos.Y + 5
' Debug.Print "oPos.X: " & oPos.X
Debug.Print "oPos.Y: " & oPos.Y
oOrdDimSet.OriginMember.Text.Origin = oPos1
oOrdDimSet.OriginMember.JogPointTwo = oPos
Debug.Print "oOrdDimSet.JogPointTwo: " & oOrdDimSet.OriginMember.JogPointTwo.Y
End If
ErrorHandler:
End Sub
Solved! Go to Solution.