- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Previously, I sought help and received an answer. Today, I have a new question. I am not good at programming, rules work well in certain aspects. When I put it into a component, it indicates a problem and I don't know how to modify it.😫
Dim oMeasureTools As MeasureTools = ThisApplication.MeasureTools
Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
Dim oPartCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oSurfaceBody As SurfaceBody = oPartCompDef.SurfaceBodies.Item(1)
Dim YZPlane As WorkPlane = oPartCompDef.WorkPlanes.Item("YZ Plane")
For Each oFace As Face In oSurfaceBody.Faces
If oFace.SurfaceType = SurfaceTypeEnum.kPlaneSurface Then
Dim FaceAngleRadians As Double = oMeasureTools.GetAngle(YZPlane, oFace)
Dim FaceAngleDegrees As Double = FaceAngleRadians * 180 / Math.PI
Dim FaceLocation As String
If Not EqualWithinTolerance(FaceAngleDegrees, 90, 0.001) Then
If oFace.PointOnFace.X > 0 Then
FaceLocation = "Right"
Parameter("R") =Round(FaceAngleDegrees, 2)
Else
FaceLocation = "Left"
Parameter("L") =Round(FaceAngleDegrees, 2)
End If
End If
End If
Next
Solved! Go to Solution.