添加项目文件。
This commit is contained in:
26
Szmedi.AIScriptRunner/Samples/DuplicateElements.csx
Normal file
26
Szmedi.AIScriptRunner/Samples/DuplicateElements.csx
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
using (Transaction tx = new Transaction(doc))
|
||||
{
|
||||
tx.Start("复制元素");
|
||||
|
||||
Group group = doc.Create.NewGroup(
|
||||
uidoc.Selection.GetElementIds());
|
||||
|
||||
LocationPoint location = group.Location
|
||||
as LocationPoint;
|
||||
|
||||
XYZ p = location.Point;
|
||||
XYZ newPoint = new XYZ(p.X, p.Y + 10, p.Z);
|
||||
|
||||
Group newGroup = doc.Create.PlaceGroup(
|
||||
newPoint, group.GroupType);
|
||||
|
||||
group.UngroupMembers();
|
||||
|
||||
|
||||
ICollection<ElementId> eIds
|
||||
= newGroup.UngroupMembers();
|
||||
|
||||
tx.Commit();
|
||||
Print("成功");
|
||||
}
|
||||
Reference in New Issue
Block a user