Anyone had luck making a point group via the .NET API in 2013?
I'm crashing out. But then, it's my first attempt, and I could have it all wrong... 🙂
CivilDocument
civilDoc = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument;
System.Windows.Forms.
MessageBox.Show(civilDoc.PointGroups.Count.ToString());
ObjectId pointGrpId = ObjectId.Null;
pointGrpId = civilDoc.PointGroups.Add(
"TEST");
System.Windows.Forms.
MessageBox.Show(pointGrpId.ToString());
PointGroup pointGrp = (PointGroup)pointGrpId.GetObject(OpenMode.ForWrite);
StandardPointGroupQuery qry = newStandardPointGroupQuery();
qry.IncludeRawDescriptions =
"TEST*";
pointGrp.SetQuery(qry);
pointGrp.Update();
Yes, that is pretty much what I am doing. Although, I am running after a .NET context menu click.
I still got objectID's back for the point I selected but gettting an ID back from the PointGroups.Add() method seems spotty. I'll keep digging.
Did you try to debug and see what line it is crashing ? Apparently I don't see anything wrong in your code snippet.
Here is a relevant blog post and you could try the same code using your data to see if that works fine.
Thanks,
It has something to do with how I am calling it from a context menu. After the context menu, a dialog appears. After it is closed, I add the group, but crash.
Running a seperate command line version works OK. So not an API bug in that regard.
Thanks,
Mike