Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to insert a group by its name. Does anyone have an example of doing that? The closest I have found was in the "First Plugin" where a group is inserted by selecting the group.
I found this in the API help:
public Group PlaceGroup( XYZ location, GroupType groupType )
But I'm not sure what it wants for "groupType".
I also found this, but again, I can't get it to run because I'm not sure what it wants for a groupType.
public void GetInfo_GroupType(GroupType groupType) { string message = "GroupType"; //Retrieve a set of all the groups that have this type. foreach (Group group in groupType.Groups) { // Get GroupType group name message = "\nThe group type name is : " + groupType.Name; //Returns all the members of the group. message += "\nThe types and ids of the group members are : "; IList<ElementId> groupMembers = group.GetMemberIds(); foreach (ElementId memberId in groupMembers) { Element element = group.Document.GetElement(memberId); // Get GroupType group element id message += "\n\t" + element.GetType().Name + " : " + memberId.IntegerValue; } } TaskDialog.Show("Revit",message); }
Solved! Go to Solution.