Community
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
"leonardlay" escreveu na mensagemI
href="news:6142686@discussion.autodesk.com">news:6142686@discussion.autodesk.com...
am trying to add a group of objects to a group so that they can be selected as
a unit. Here is my code. After this, when I select one of the slabs that is
supposed to be in this group, it shows that nothing is grouped. What am I
doing wrong?
Handle GroupMiniPanel()
{
Handle
groupHandle = new Handle(0);
using (Transaction trans =
HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction())
{
Database
db = HostApplicationServices.WorkingDatabase;
DBDictionary
groupDictionary = (DBDictionary)trans.GetObject(db.GroupDictionaryId,
OpenMode.ForWrite,false);
string curLayer =
AutodeskTransactionWrapper.GetCurrentLayer();
/////////////////////////////////////////////////
string
miniPanelGroupDescription = string.Format("{0}_Group",
curLayer);
groupHandle =
groupDictionary.SetAt(_miniPanelGroup.Description,
_miniPanelGroup).Handle;
//Add all of the minipanel items to the
group
_miniPanelGroup.Append(_miniPanelArea.ObjectId);
for (int
ii = 0; ii < _miniItems.Count; ii++)
{
ObjectId objId =
HostApplicationServices.WorkingDatabase.GetObjectId(false, _miniItems[ii],
0);
_miniPanelGroup.Append(objId);
}
trans.AddNewlyCreatedDBObject(_miniPanelGroup,
false);
trans.Commit();
}
return
groupHandle;
}