Hello
What has changed:
'----------------------------------------------------------------------------
' Preconditions:
' 1. Open public_documents\tutorial\advdrawings\foodprocessor.slddrw.
' 2. Open an Immediate window.
'
' Postconditions:
' 1. The specified angular running dimension is inserted into the drawing.
' 2. Inspect the Immediate window.
'
' NOTE: Because the model is used elsewhere, do not save changes to it.
' ---------------------------------------------------------------------------
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim PartExt As SldWorks.ModelDocExtension
Sun selmgr As SldWorks.SelectionMgr
Dim dispdim As SldWorks.DisplayDimension
Dim swDispDim As SldWorks.DisplayDimension
Dim vdim As Variant
Dim boolstatus As Boolean
Dim errstatus As Long
Sun i As Long
Option Explicit
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set PartExt = Part.Extension
boolstatus = Part.ActivateView("Drawing View1")
boolstatus = Part.Extension.SelectByID2("", "VERTEX", 0.17648799570697, 0.195948476524618, 4.79999999998881E-03, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "EDGE", 0.270641278567064, 0.202920893989561, 4.799999999993197E-03, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "EDGE", 0.238383279638647, 0.257816085148446, -3.99999999899592E-04, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "EDGE", 0.154059738580153, 0.26234352359454, 6.00000000247292E-04, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "EDGE", 0.104823845478885, 0.213673560299033, 6.000000000019918E-04, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "EDGE", 0.152361949162868, 0.163871737392003, 6.000000000019918E-04, True, 0, Nothing, 0)
vdim = PartExt.AddAngularRunningDim(True, True, True, 0.154288188900673, 7.94194886913027E-02, 0, errstatus)
Part.SetPickMode
For i = 0 To UBound(vdim)
Set dispdim = vdim(i)
Part.Extension.ReJogRunningDimension
Part.Extension.AlignRunningDimension
Debug.Print "Display chained angular dimensions? " & dispdim. DisplayAsChain
Debug.Print "Run the angular dimensions bidirectionally? " & dispdim. RunBidirectionally
Debug.Print "Extend extension lines from center of angular running dimension? " & dispdim. ExtensionLineExtendsFromCenterOfSet
Debug.Print "Are extension lines jogged? " & dispdim. Jogged
Debug.Print "Extension line style same as leader line style? " & dispdim. ExtensionLineSameAsLeaderStyle
Debug.Print "Extension line uses document settings? " & dispdim. ExtensionLineUseDocumentDisplay
Next
End Sub
In bold:
There was a casting issue in the return value of the AddAngularRunningDim() and swDispDim function .
Incidentally, AddAngularRunningDim() returns an Array(of DisplayDimension) that vba couldn't cast to Object.
In italics, it's just a loop to display the properties of the created dimensions.
Kind regards.