Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
wolfgang_nickl
693 Views, 7 Replies

Change FastenerSize of HoleClearanceInfo

Hello together,

 

I want to Change a Holedefinition of a Clearance  Hole.

I can query the current size. In API docu it is descript as Read-write,

but I can't set a new value. Open the attached file or any part with

a clearance hole and start the Sub below. The first Messagebox shows

the Size but it results in an error when I try to set a new value.

What is wrong? 

 

Sub subWNHolefeatureUpdate()
    Dim oWNPartDoc As PartDocument
    Set oWNPartDoc = ThisApplication.ActiveDocument
    Dim oWNHoleFeature As HoleFeature
    For Each oWNHoleFeature In oWNPartDoc.ComponentDefinition.Features.HoleFeatures
        MsgBox oWNHoleFeature.ClearanceInfo.FastenerSize
        On Error Resume Next
            oWNHoleFeature.ClearanceInfo.FastenerSize = "M6"
        MsgBox Err.Description
    Next
End Sub

Best Regards

 

Wolfgang

Tags (1)