0
0
Solidworksbi_tool~10 mins

Feature Manager design tree in Solidworks - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select the first feature in the Feature Manager design tree.

Solidworks
feature = design_tree.[1]()
Drag options to blanks, or click blank then click option'
ADeleteFeature
BSelectFeature
CAddFeature
DGetFirstFeature
Attempts:
3 left
💡 Hint
Common Mistakes
Using methods that modify the tree instead of retrieving features.
Confusing selection methods with retrieval methods.
2fill in blank
medium

Complete the code to get the name of a feature object.

Solidworks
feature_name = feature.[1]
Drag options to blanks, or click blank then click option'
AName()
BGetName()
CName
DFeatureName()
Attempts:
3 left
💡 Hint
Common Mistakes
Using methods with parentheses when a property is required.
Using incorrect method names that do not exist.
3fill in blank
hard

Fix the error in the code to correctly iterate through all features in the Feature Manager design tree.

Solidworks
feature = design_tree.GetFirstFeature()
while feature != None:
    print(feature.Name)
    feature = feature.[1]()
Drag options to blanks, or click blank then click option'
AGetNextFeature
BGetName
CNextFeature
DGetPreviousFeature
Attempts:
3 left
💡 Hint
Common Mistakes
Using the method to get the name instead of the next feature.
Using a method that gets the previous feature instead of the next.
4fill in blank
hard

Fill both blanks to create a dictionary of feature names and their types from the Feature Manager design tree.

Solidworks
features_dict = {feature.[1]: feature.[2]() for feature in features_list}
Drag options to blanks, or click blank then click option'
AGetName
BGetTypeName
CGetFeatureType
DName
Attempts:
3 left
💡 Hint
Common Mistakes
Using method names instead of properties for the name.
Mixing up type and name methods.
5fill in blank
hard

Fill all three blanks to filter features by type and create a list of their names.

Solidworks
filtered_names = [feature.[1] for feature in features if feature.[2]() == [3]]
Drag options to blanks, or click blank then click option'
AName
BGetTypeName
C"Boss-Extrude"
D"Cut-Extrude"
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names.
Using wrong string values for feature types.
Forgetting quotes around the type string.