# Type to instance

**URL:** <https://forum.dynamobim.com/t/type-to-instance/101010>\
**Category:** Revit\
**Tags:** revit, dynamo, structural\
**Created:** [May 15, 2024, 8:06am UTC](https://forum.dynamobim.com/t/type-to-instance/101010 "2024-05-15T08:06:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nizarmalek10](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nizarmalek10](https://forum.dynamobim.com/u/nizarmalek10)\
**Post date:** [May 15, 2024, 8:06am UTC](https://forum.dynamobim.com/t/type-to-instance/101010/1 "2024-05-15T08:06:23Z")

</div>

Dear Dynamo community,  
I have a question, i want to get instance parameters from these types is it possible?  
i want to use the normal Revit nodes i want to aavoid packages as much as i can.  
Best regards.

 ![2024-05-15_09h02_40](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/7/374d73b91707912f6d92f0e40e8c4485d04447c9.png)

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [May 15, 2024, 8:14am UTC](https://forum.dynamobim.com/t/type-to-instance/101010/2 "2024-05-15T08:14:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/f/0f1a9e4f709391fd522a2633e2cdf11667614828.png)

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [May 15, 2024, 8:20am UTC](https://forum.dynamobim.com/t/type-to-instance/101010/3 "2024-05-15T08:20:54Z")

</div>

Hi,

The typical workflow would be to get an instance element and parameters from there…

Otherwise it gets a bit more awkward, perhaps I am forgetting an easier way…

If you don’t have any placed instances, you could place one, get the parameters, then delete it.

If you are comfortable in Python you can use a filtered element collector to get the type and then pull parameters from there, checking if they are ‘isInstance’.

Hope that helps,

Mark

---

<div class="post-metadata">

**Author:** ![nizarmalek10](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nizarmalek10](https://forum.dynamobim.com/u/nizarmalek10)\
**Post date:** [May 15, 2024, 2:43pm UTC](https://forum.dynamobim.com/t/type-to-instance/101010/4 "2024-05-15T14:43:05Z")

</div>

it didn’t get me the instance parameters

---

<div class="post-metadata">

**Author:** ![nizarmalek10](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nizarmalek10](https://forum.dynamobim.com/u/nizarmalek10)\
**Post date:** [May 15, 2024, 2:43pm UTC](https://forum.dynamobim.com/t/type-to-instance/101010/5 "2024-05-15T14:43:29Z")

</div>

TBH with you i don’t know anything about python.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [May 15, 2024, 3:00pm UTC](https://forum.dynamobim.com/t/type-to-instance/101010/6 "2024-05-15T15:00:24Z")

</div>

I think this is what you’re after:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/0/c0dde7aca53f171e5b721aa1a2a8a57fbbf6565c.png)

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [May 15, 2024, 11:49pm UTC](https://forum.dynamobim.com/t/type-to-instance/101010/7 "2024-05-15T23:49:41Z")

</div>

As most people have shown you in solutions a type will not correlate to a single instance, in fact it may not correlate to any instances if none are placed in the project. Whilst an instance has a type, a type will usually have many instances with their own respective instance parameters.

If you’re trying to snoop the parameters available to the family, an alternative method could be to get the type’s family, programatically open/read/close the family document and return all parameter names. I have nodes in Crumple which can do this that use Python.

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [May 16, 2024, 12:40pm UTC](https://forum.dynamobim.com/t/type-to-instance/101010/8 "2024-05-16T12:40:22Z")

</div>

Hey,

This is an example, I place then delete.

I don’t think it works in Dynamo unless you can use a roll back… Someone will correct me if I’m wrong…

Warning : Super Slow!

Background opening is still valid as Gavin says, I think that would also be super slow 🙂

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/a/7a1f576b08d1f97936f3fc2782ec7f8fe0dfb337.png)

```auto
import clr

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Import Revit API
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

import Revit
clr.ImportExtensions(Revit.Elements)

# Get the current Revit document
doc = DocumentManager.Instance.CurrentDBDocument
structuralType = Structure.StructuralType.NonStructural

# Get all window types
window_collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Windows).WhereElementIsElementType().ToElements()

#get any level
level = [FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Levels).ToElements()][0][0]
#make a point anywhere
point = XYZ(1,0,0)

# Start a transaction
TransactionManager.Instance.EnsureInTransaction(doc)
window_params = []
for type in window_collector:
    type.Activate()        
    window_fam = doc.Create.NewFamilyInstance(point, type, level, structuralType)
    parameters = window_fam.Parameters
    param_info = []
    for parameter in parameters:
        param_info.append([parameter.Definition.Name, parameter.AsValueString()])    
    window_params.append([window_fam.Name, param_info])
    doc.Delete(window_fam.Id)#

# Commit the transaction
TransactionManager.Instance.TransactionTaskDone()

OUT = window_params

```

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [May 16, 2024, 7:08pm UTC](https://forum.dynamobim.com/t/type-to-instance/101010/9 "2024-05-16T19:08:52Z")

</div>

Best bet will be a rollback here, as that will be faster. That said I don’t see why we want to do this - when faced with such an issue it is almost always a sign that you are going at the problem in the wrong direction.
