Thread Features and ThreadFeatureData Objects
To create a Thread feature:
See the
IThreadFeatureData
examples.
-
Ensure that Tools > Options > System Options > File Location > Thread
Options > Folder contains thread profiles (*.sldlfp).
-
Open a part document with a Hole Wizard hole, Advanced Hole, or Extruded
Cut.
-
Call
IFeatureManager::CreateDefinition(swFeatureNameID_e.swFmSweepThread)
to create a new
ThreadFeatureData object.
-
Initialize the thread feature data object with default property settings using
IThreadFeatureData::InitializeThreadData.
-
Select thread feature reference entities using
IModelDocExtension::SelectByRay:
- Edge of cylinder where the thread begins with Mark = 1.
- Up To Selection end condition reference with Mark = 1.
- (Optional) Starting location of the thread helix with Mark = 2, (only
if step 1 does not select a planar circular edge):
-
Set
IThreadFeatureData::Edge with the selection from step 6.1.
-
Call
IThreadFeatureData::SetEndConditionReference with Value set to the
selection from step 6.2.
-
Set
IThreadFeatureData::StartEntity with the selection from step 6.3.
-
Modify other property settings in the ThreadFeatureData object.
-
Create the thread feature by calling
IFeatureManager::CreateFeature.
To edit a Thread feature:
- Call
IFeature::GetDefinition.
- Call
IThreadFeatureData::AccessSelections.
- Modify property settings in the ThreadFeatureData object.
- Call
IFeature::ModifyDefinition if you modified the
feature or
IThreadFeatureData::ReleaseSelectionAccess if you did not modify
the feature.