API: Get feature from sketch

Jun 15, 2004 3 Replies

This seems like an easy problem. Is there a call to get a feature that is created from a sketch?



Thanks,



Brian


Look up

Feature::GetChildren

Corey

Ok, exactly what I need. Thanks.

Feature::GetParents

See Also Example Availability

Description

This method gets the parent features for this feature.

Syntax (OLE Automation)

retval = Feature.GetParents ( )

Return: (VARIANT) retval VARIANT of type SafeArray pointers to Dispatch objects

Syntax (COM)

status = Feature->IGetParents ( retval )

Output: (LPFEATURE*) retval Pointer to an array of feature objects Return: (HRESULT) status S_OK if successful Remarks

This method gets only the direct parents of this feature. It does not get parents of parents.

If you are writing a COM application, use Feature::IGetParentCount to determine the array size necessary when calling this method. If you are writing a Dispatch application, you do not have to call GetParentCount since the SafeArray is sized automatically by SolidWorks and the Dispatch caller can determine the size of the array by checking the upper bound of the SafeArray upon return.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required