Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to check if a sketch is fully defined.
Solidworks
if sketch.[1] == 'Fully Defined': print('Sketch is fully defined')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'state' instead of 'status' causes attribute errors.
✗ Incorrect
The property status holds the definition state of the sketch.
2fill in blank
mediumComplete the code to retrieve the definition state of the sketch.
Solidworks
definition_state = sketch.[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'definition', 'mode' or 'state' causes attribute errors.
✗ Incorrect
The property status holds the definition state of the sketch.
3fill in blank
hardFix the error in the code to detect an over-defined sketch.
Solidworks
if sketch.[1] == 'Over Defined': print('Sketch has conflicting constraints')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'state' or 'mode' causes attribute errors.
✗ Incorrect
The correct property to check the sketch's definition state is status.
4fill in blank
hardFill both blanks to check if a sketch is under-defined and print a message.
Solidworks
if sketch.[1] == '[2]': print('Sketch needs more constraints')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the property and state values.
✗ Incorrect
Use status to check if the sketch is Under Defined.
5fill in blank
hardFill all three blanks to print the sketch state with a message.
Solidworks
state = sketch.[1] if state == '[2]': print('Sketch is ' + [3])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using string literals instead of variable for print.
✗ Incorrect
Get the status property, compare to 'Fully Defined', and print the variable state.