Bird
Raised Fist0
Solidworksbi_tool~10 mins

Display states in Solidworks - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to activate a display state named '{{BLANK_1}}'.

Solidworks
model.DisplayStates.[1].Activate()
Drag options to blanks, or click blank then click option'
AActivate
BActivateDisplayState
CSetActive
DShow
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Show' instead of 'Activate'
Using 'SetActive' which is not a valid method
Using 'ActivateDisplayState' which does not exist
2fill in blank
medium

Complete the code to get the name of the current display state using {{BLANK_1}}.

Solidworks
currentStateName = model.DisplayStates.[1]()
Drag options to blanks, or click blank then click option'
AGetActiveDisplayStateName
BActiveDisplayState
CCurrentDisplayState
DDisplayStateName
Attempts:
3 left
💡 Hint
Common Mistakes
Using property names instead of method calls
Using 'ActiveDisplayState' which is not a method
Using 'DisplayStateName' which is not valid
3fill in blank
hard

Fix the error in the code to set a display state named 'Design' as active using {{BLANK_1}}.

Solidworks
model.DisplayStates.[1]('Design')
Drag options to blanks, or click blank then click option'
AActivate
BActivateDisplayState
CSetActiveDisplayState
DSetDisplayState
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Activate' which requires an object, not a name
Using 'SetActiveDisplayState' which does not exist
Using 'SetDisplayState' which is invalid
4fill in blank
hard

Fill both blanks to create a new display state named '{{BLANK_1}}' and activate it using {{BLANK_2}}.

Solidworks
newState = model.DisplayStates.[1]('NewState')
newState.[2]()
Drag options to blanks, or click blank then click option'
AAdd
BActivate
CCreate
DSetActive
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Create' instead of 'Add'
Using 'SetActive' which is invalid
Using 'Activate' before adding the state
5fill in blank
hard

Fill all three blanks to list all display state names and print each using a loop.

Solidworks
states = model.DisplayStates.[1]()
for state in states:
    print(state.[2])
    if state.[3] == 'Active':
        print('This is the active display state')
Drag options to blanks, or click blank then click option'
AGetNames
BName
CStatus
DGetAll
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'GetAll' which is invalid
Using 'Name' as a method instead of property
Using 'Activate' instead of 'Status'

Practice

(1/5)
1. What is the main purpose of Display States in SolidWorks?
easy
A. To permanently change the geometry of a model
B. To save different visual appearances of a model without changing its shape
C. To create new parts from an assembly
D. To export the model to different file formats

Solution

  1. Step 1: Understand what Display States do

    Display States allow saving different looks of the same model, such as colors or visibility, without altering the model's shape.
  2. Step 2: Differentiate from geometry changes

    Changing geometry permanently modifies the model, which Display States do not do.
  3. Final Answer:

    To save different visual appearances of a model without changing its shape -> Option B
  4. Quick Check:

    Display States = Visual appearance only [OK]
Hint: Remember: Display States change looks, not shape [OK]
Common Mistakes:
  • Confusing Display States with geometry editing
  • Thinking Display States create new parts
  • Assuming Display States export files
2. Which of the following is the correct way to create a new Display State in SolidWorks?
easy
A. Go to File > Save As and choose Display State
B. Click on the Features tab and select 'New Display State'
C. Use the Move tool to create a Display State
D. Right-click on the Display States tab and select 'Add Display State'

Solution

  1. Step 1: Locate Display States tab

    In SolidWorks, Display States are managed in the ConfigurationManager under the Display States tab.
  2. Step 2: Create new Display State

    Right-clicking on the Display States tab gives the option 'Add Display State' to create a new one.
  3. Final Answer:

    Right-click on the Display States tab and select 'Add Display State' -> Option D
  4. Quick Check:

    Create Display State = Right-click Display States tab [OK]
Hint: Right-click Display States tab to add new state [OK]
Common Mistakes:
  • Trying to create Display State from File menu
  • Using Move tool which edits geometry
  • Looking under Features tab incorrectly
3. Given a model with two Display States: State1 shows all parts visible, and State2 hides the front cover. What will happen when you switch from State1 to State2?
medium
A. The front cover becomes invisible while other parts remain visible
B. The entire model becomes invisible
C. The model shape changes to remove the front cover permanently
D. The colors of all parts change but visibility stays the same

Solution

  1. Step 1: Understand Display State visibility control

    Display States can control visibility of parts without changing geometry.
  2. Step 2: Analyze effect of switching states

    Switching to State2 hides the front cover but keeps other parts visible as per the saved state.
  3. Final Answer:

    The front cover becomes invisible while other parts remain visible -> Option A
  4. Quick Check:

    Switch Display State = Change visibility only [OK]
Hint: Switching Display State changes visibility, not shape [OK]
Common Mistakes:
  • Thinking the model shape changes permanently
  • Assuming entire model hides
  • Confusing color changes with visibility
4. You created a Display State but when switching to it, the model looks the same as the default state. What is the most likely cause?
medium
A. You forgot to save changes to visibility or appearance in the new Display State
B. The model geometry was deleted accidentally
C. Display States only work in assemblies, not parts
D. You need to restart SolidWorks to apply Display States

Solution

  1. Step 1: Check if changes were saved in Display State

    Display States save visual changes like visibility or color. If no changes were saved, switching states shows no difference.
  2. Step 2: Eliminate other causes

    Geometry deletion affects shape, not Display States. Display States work in parts and assemblies. Restart is not required.
  3. Final Answer:

    You forgot to save changes to visibility or appearance in the new Display State -> Option A
  4. Quick Check:

    No saved changes = No visible difference [OK]
Hint: Always save visibility/appearance changes in Display State [OK]
Common Mistakes:
  • Assuming geometry deletion affects Display States
  • Thinking Display States need restart
  • Believing Display States only work in assemblies
5. You want to compare two color schemes for a product without changing the model shape or creating multiple files. How can Display States help you achieve this?
hard
A. Apply colors directly to the model and save multiple versions manually
B. Create two separate files with different colors and switch between them
C. Create two Display States, each with a different color scheme applied to the model
D. Use configurations to change the model shape and color simultaneously

Solution

  1. Step 1: Understand Display States for color variations

    Display States allow saving different appearances like colors without changing geometry or creating new files.
  2. Step 2: Apply different colors in separate Display States

    Create two Display States, each with a unique color scheme, and switch between them to compare easily.
  3. Final Answer:

    Create two Display States, each with a different color scheme applied to the model -> Option C
  4. Quick Check:

    Display States = Multiple looks, one file [OK]
Hint: Use Display States to save color options without new files [OK]
Common Mistakes:
  • Creating multiple files instead of using Display States
  • Confusing configurations with Display States
  • Manually saving versions instead of using states