Group.PlaceInstance operation failed

I’m trying to extract Groups from a base file and place them in a new file. I do this by using the IDs of the Groups. Only when I run the node “Group.PlaceInstance” do I get the following message:

Warning: Group.PlaceInstance operation failed.
The call is ambiguous between the following methods or properties: ‘Revit.Elements.ElementWrapper.Wrap(Autodesk.Revit.DB.RoofType, bool)’ and ‘Revit.Elements.ElementWrapper.Wrap(Autodesk.Revit.DB.ScheduleSheetInstance, bool )’

I can’t figure out how to solve this.

@Andries

create your own node

@Draxl_Andreas thanks for the reply. I have no experience here. Do you have any tips where I can find more information on how to do this with the data from the website link?

@Andries


import clr
import sys 

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

locationPoint = XYZ(0.0,0.0,0.0)
gT = IN[0]

# 🔓 place it
t = Transaction(doc, "Place Group")
t.Start()

output = []

newGroupType = doc.Create.PlaceGroup(locationPoint, UnwrapElement(gT))
output.append(newGroupType)

t.Commit()
# 🔒 Done

OUT = output

the example works for 1x group

@Draxl_Andreas If I use it separately within the same file it works, but not in my script. it gives the error message below.

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 32, in
Exception: Starting a new transaction is not permitted. It could be because another transaction already started and has not been completed yet, or the document is in a state in which it cannot start a new transaction (e.g. during failure handling or a read-only mode, which could be either permanent or temporary) .

The purpose of this script is that I can indicate different group types in an Excel file. This contains the ID numbers of the groups that he retrieves from a basic file with the nodes “file path” and “Document.Open” and “Element.ById”. The coordinates are also determined and calculated in the Excel file. these must also be entered for this. If I want to adjust this in the script, this is not possible.

The purpose of this script is to generate housing blocks.

@Andries

output = []

# 🔓🔒🔐 place group

with revit.Transaction("place group"):
    try:
        newGroupType = doc.Create.PlaceGroup(locationPoint, UnwrapElement(gT))
        output.append(newGroupType)
    except:
        import traceback
        output.append(traceback.format_exc())

try this