Hi @tim11_manhhieu. In this situation, we could first check the HoleFeature.Tapped property's value, to see if it is True, before we even get around to checking the HoleFeature.TapInfo property. But when we bet to that TapInfo property, its value Type is 'Object', instead of something more specific, because it can return two different Types of objects (HoleTapInfo or TaperedThreadInfo). Unfortunately, there is no direct property of the HoleFeature that tells us which one to expect. So, if we do not already know which one to expect, we would have to check what Type of value it has first. We can use an If...ElseIf...End If type statement, where we check if it is each Type, and when a match is found, set it as the value of the correct Type of variable. But we would most likely want to declare both types of variables before the If statement starts, instead of within the If statement, that way we could continue using that variable after the If statement's end. Since there are only 2 options, we can just use the 'TypeOf' operator to compare the Value with the expected Type in both cases. Once we have determined which one we got, we can move on with the rest of our code, which accesses the unique properties of that specific Type. Most times we already know what type to expect, because we only have one type of threads in our designs, which makes it simpler to deal with.
This is a common situation to encounter throughout the Inventor API (and elsewhere), so those tactics can be used in many different situations. Perhaps the most common is the Inventor.Property object (AKA: iProperty). The Property.Value of all of them is Object (Variant Type is the VBA system's version of VB.NET's Object Type), instead of something more specific. This is because they can hold a String, Boolean, Number, or Date...each is a different object type. Since some of us interact with them so often, we just know which ones have which type of values, and plan on that. But if we were new to them, and do not know what type of value to expect, we would need to do extra testing to determine the Type of each one. When we create custom Properties, we set their Type simply by setting a value to them, then they adapt that value's Type.
Wesley Crihfield

(Not an Autodesk Employee)