Please tell me how to make tab countsink visible in a drawing.

Please tell me how to make tab countsink visible in a drawing.

tkddud711
Advocate Advocate
376 Views
3 Replies
Message 1 of 4

Please tell me how to make tab countsink visible in a drawing.

tkddud711
Advocate
Advocate

hello.
I posted the same content a year ago, but didn't get an answer.
I would like to write ilogic on the topic below.

If you model a tab as shown below, a tab is created with countsink.
If you draw M3,M4,M5,M6,M8,M10,M12, you will draw circles of Φ3,Φ4,Φ5,Φ6,Φ8,Φ10,Φ12 in the plan view.
I would like to hide the countsink circle drawn on the floor plan.

If the countsink cannot be hidden in the drawing when creating a tab, is there an ilogic that allows you to enter the size of the circle in the drawing and then select it?

tkddud711_0-1701395195975.png

 

0 Likes
377 Views
3 Replies
Replies (3)
Message 2 of 4

Michael.Navara
Advisor
Advisor

You can try following code. It works only for first drawing view on active sheet, but it can be modified easily.

 

Sub Main()

    Dim drawing As DrawingDocument = ThisDoc.Document

    Dim drawingView As DrawingView = drawing.ActiveSheet.DrawingViews(1)
    Dim part As PartDocument = drawingView.ReferencedDocumentDescriptor.ReferencedDocument
    Dim partDef As PartComponentDefinition = part.ComponentDefinition
    For Each holeFeature As HoleFeature In partDef.Features.HoleFeatures
        If holeFeature.HoleType <> HoleTypeEnum.kCounterSinkHole Then Continue For

        'Get the biggest circles of holeFeature in drawing view
        Dim biggestCircles As New List(Of DrawingCurveSegment)
        Dim biggestCircleRadius As Double = 0

        Dim holeDrawingCurves = drawingView.DrawingCurves(holeFeature)
        For Each holeDrawingCurve As DrawingCurve In holeDrawingCurves
            For Each drawingCurveSegment As DrawingCurveSegment In holeDrawingCurve.Segments
                Dim circle2d = TryCast(drawingCurveSegment.Geometry, Circle2d)
                If circle2d Is Nothing Then Exit For
                If circle2d.Radius > biggestCircleRadius Then
                    biggestCircles.Clear()
                    biggestCircleRadius = circle2d.Radius
                    biggestCircles.Add(drawingCurveSegment)
                ElseIf circle2d.Radius = biggestCircleRadius Then
                    biggestCircles.Add(drawingCurveSegment)

                End If
            Next
        Next

        'Hide 
        For Each biggestCircle As DrawingCurveSegment In biggestCircles
            biggestCircle.Visible = False
        Next
    Next

End Sub
Message 3 of 4

tkddud711
Advocate
Advocate

thank you for the reply.
It works fine, but
Tabs using the pattern function are not applied.
I want to apply it to patterned tabs as well.
I want to select a view and apply the function.
Is it possible?

0 Likes
Message 4 of 4

tkddud711
Advocate
Advocate
hello? Mr. Michael Navara.
In response to an inquiry from ilogic, a rule was created to hide the tab's countsink circle in the drawing, and there was a request.
I included a link to the file in the post I posted, but I also want to hide the circle in the tabs of the square pattern, circular pattern, and linked pattern.
And I want to select a view in the drawing.
Is it possible?
0 Likes