Placing model group by name?

Hi,

It works smoothly on me. The only thing you need is Xyz, the dots and the rest of the code. Previously @Konrad_K_Sobon had done a study on this. I’m adding it to the council to give the acclaimed.How to create a Detail Group in specific View?
Also to see what is needed to create the API
https://www.revitapidocs.com/2017/586d4f2e-0985-2d0b-dbb7-ea6d2f704336.htm ekliyorum.
1

import clr
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

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

import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)

grouptype = UnwrapElement(IN[0])
location = UnwrapElement(IN[1])

TransactionManager.Instance.EnsureInTransaction(doc)

groups = doc.Create.PlaceGroup(location,grouptype)

TransactionManager.Instance.TransactionTaskDone()

OUT = groups

The example I mentioned above is only for 1 group. However, you can use this code when you need to move multiple groups to the desired point.
2

import clr
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

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

import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)

grouptype = UnwrapElement(IN[0])
location = UnwrapElement(IN[1])
a = []

TransactionManager.Instance.EnsureInTransaction(doc)

for l in location:
	
	groups = doc.Create.PlaceGroup(l,grouptype)
	a.append(groups.ToDSType(True))
TransactionManager.Instance.TransactionTaskDone()

OUT = a

Durmus

2 Likes