RecognizedHole Object

Derived from: Base Object
Defined in namespace "adsk::cam" and the header file is <Cam/HoleRecognition/RecognizedHole.h>

Description

Object that represents a hole, a hole is made of one or more segments.

Methods

Name Description
classType Static function that all classes support that returns the type of the class as a string. The returned string matches the string returned by the objectType property. For example if you have a reference to an object and you want to check if it's a SketchLine you can use myObject.objectType == fusion.SketchLine.classType().
recognizeHoles **RETIRED** Returns a collection of all recognized holes.
recognizeHolesWithInput PreviewReturns a collection of all recognized holes.
segment Returns the segment at the specified index from this hole. The collection of segments that comprise this hole are in order. The first segment is at the top of this hole and the last segment is at the bottom.

Properties

Name Description
axis Returns the unit vector that points straight up out of the hole in the global coordinate system.
bottom Returns a point at the center of the hole bottom.
bottomDiameter Returns the diameter of the bottom of this hole (bottom diameter of the last segment contained in this hole).
hasErrors Returns true if there are any errors associated with this hole.
hasWarnings Returns true if there are any warnings associated with this hole.
isThreaded Returns true if at least one segment of this hole is threaded, i.e. associated with a thread feature.
isThrough Returns true if this is a through hole, i.e. if the bottom is open.
isValid Indicates if this object is still valid, i.e. hasn't been deleted or some other action done to invalidate the reference.
objectType This property is supported by all objects in the API and returns a string that contains the full name (namespace::objecttype) describing the type of the object.

It's often useful to use this in combination with the classType method to see if an object is a certain type. For example: if obj.objectType == adsk.core.Point3D.classType():
segmentCount Returns the number of segments contained in this hole.
top Returns a point at the center of the hole top.
topDiameter Returns the diameter of the top of this hole (top diameter of the first segment contained in this hole).
totalLength Returns the total length of all segments contained in this hole.

Accessed From

RecognizedHoleGroup.item, RecognizedHoles.item

Samples

Name Description
Hole and Pocket Recognition API Sample

This sample script demonstrates three different methods for feature recognition: one for holes and two for pockets.

The script starts by creating a simple component which is then used to demonstrate the three methods. After the features are recognised they are coloured and milling and drilling operations are created for each feature.

RecognizedHoleGroup returns a list of BRepFaces that can be used as selections for the drilling operation. RecognizedPocket and PocketRecognitionSelection do not return BRepFaces, and their output needs additional processing before the output can be used for creating machining operations.

The sample script demonstrates a couple of different methods, including finding the pocket BRepFaces and creating sketches from the recognized pockets.

This script works only if the Manufacturing Extension is active.

Version

Introduced in version May 2023