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

setting fastener size using API

 

Sub main()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oHoleF As HoleFeatures
Set oHoleF = oDoc.ComponentDefinition.Features.HoleFeatures


oHoleF.Item(3).ClearanceInfo.FastenerSize = "M10"
    MsgBox (oHoleF.Item(3).ClearanceInfo.FastenerType)

Hello, I am new to the API 

through this code, I am trying to set the fastener size to be a specific value based on a specific parameter. the programming/API Help informed that the "FastenerSize" is a read-write property to set or get the fastener size so how can I use this method to set the fastener size, Although using this code introduces error for me " Run-time error 445, Object doesn't support this action".

noting that this is the only thing in the hole feature that will change as shown in the figure below and all other choices will be constant with a different configuration of the model.

Capturerr.PNG

 

thanks