# Query Existing Analysis Model

The **ggQuery** component allows you to attach to or use a given existing structural analysis model file to extract results from.

In many cases, you may have developed a structural analysis model directly within a structural analysis program and now want to use Rhino and Grasshopper to perform some calculations based on the analysis results that are trapped inside the structural analysis program.

Unlike the **ggSolve** Component this will not modify the analysis model in any way nor will it tell the structural analysis program to run any analysis. Therefore, you need to ensure that any load case or combinations that have already been run in the model and that it has then been saved in that state.

![Query Component](https://2594167310-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LSS3F7HK0Nk5Ql9jbdt%2Fuploads%2Fgit-blob-1514d52bc474e6959a096c070d25b55ab0253455%2Fimage.png?alt=media)

The query component will typical take one parameter- The query however it will rely on you using the **ggImportModel** or **ggImportData** component to open the model in the first place. The steps below outline the process shown in the image below.

![Extracting model frequency results from an existing model](https://2594167310-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LSS3F7HK0Nk5Ql9jbdt%2Fuploads%2Fgit-blob-a039c3710fbb6079bebf7b722d3e98fb63380f18%2Fimage%20\(21\).png?alt=media)

### Step 1. Open/Import Existing Model

You can use the **ggImportData** component to import the structural analysis model into Grasshopper. This allows you to filter and specify elements and load cases/combinations in which you are going to query analysis results for.

{% content-ref url="../structural-model/import" %}
[import](https://technical.geometrygym.com/rhino-grasshopper/structuralanalysis/geometry-gym-model/structural-model/import)
{% endcontent-ref %}

{% hint style="warning" %}
It is best that the model is **not** already open prior to adding this component to the canvas. Once the file path of the analysis model is specified the component will perform the necessary steps in order to open the model.
{% endhint %}

### Step 2. Generate Queries

Queries are generated similar to as if you were going to run through the solver component. Select your query type and the associated elements and for which particular load case.

Follow the steps here for setting up analysis result queries:

{% content-ref url="results" %}
[results](https://technical.geometrygym.com/rhino-grasshopper/structuralanalysis/geometry-gym-model/analysis-and-solver/results)
{% endcontent-ref %}

Once you have set-up your desired queries, wire these into the queries input of the component.

{% hint style="info" %}
Note: this will automatically generate the queries from the analysis model on the fly. If you have multiple queries you may want to disable the component to allow you to perform the query in one go.
{% endhint %}

### Step 3. Decompose

Once the query component has run, you should receive the result data items for the queries you provided. Decompose these results to get the associated results for your use in grasshopper.
