-Thanks
Code: Select all
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swSketchMgr As SldWorks.SketchManager
Dim swSkRelMgr As SldWorks.SketchRelationManager
Dim swSketch As SldWorks.Sketch
Dim swDispDim As SldWorks.DisplayDimension
Dim coreDim As SldWorks.Dimension
Dim swAnn As SldWorks.Annotation
Dim vSkRelArr As Variant
Dim vSkRel As Variant
Dim dimName As String
Dim result As Boolean
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swSketchMgr = swModel.SketchManager
Set swSketch = swSketchMgr.ActiveSketch
Set swSkRelMgr = swSketch.RelationManager
vSkRelArr = swSkRelMgr.GetRelations(0)
'setup by editing sketch inside derived config
'attempt to find dimensions in active sketch that are configuration specific and not linked to parent config
swModel.ClearSelection2 (True)
For Each vSkRel In vSkRelArr
Set swSkRel = vSkRel
t = swSkRel.GetRelationType
If (t = swConstraintType_e.swConstraintType_DISTANCE) Or (t = swConstraintType_e.swConstraintType_DIAMETER) Or (t = swConstraintType_e.swConstraintType_ANGLE) Or (t = swConstraintType_e.swConstraintType_RADIUS) Then
Set swDispDim = swSkRel.GetDisplayDimension
Set coreDim = swDispDim.GetDimension2(0)
If coreDim.IsAppliedToAllConfigurations = False Then 'highlight all dims that are configured for manual checking
Set swAnn = swDispDim.GetAnnotation
swAnn.Select (True)
'how to check to see if dim is linked to parent configuration.
End If
End If
Next
End Sub