← Inbox

C3D-0349 · READ-ONLY: probe the PointGroup API surface (retry, escape fixed) [C3D-APIPROBE2] error

Retry of C3D-0348 which failed to compile on a backslash escape. Reflects over PointGroup and the PointGroups collection to list every property and method on this build, dumps the current group order, verifies the intended point and label styles exist by exact name, and tests whether the E: data folder is reachable. Writes nothing.

Script file
C3D-0349.cs
Target
260714 - 285 Huckaby Rd R2.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
120s

C# payload

// READ-ONLY. What the PointGroup / PointGroupRoot API actually exposes on this build, so the
// stake-out group can be built without a compile failure.
var civ = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument;
Log("drawing: " + Db.Filename);
Log("");

// ---- PointGroup: every member, so we know how to set membership
ObjectId first = ObjectId.Null;
foreach (ObjectId gid in civ.PointGroups) { first = gid; break; }
if (first.IsNull) { Log("no point groups"); return; }
var g = Tx.GetObject(first, OpenMode.ForRead);
Log("=== PointGroup type: " + g.GetType().FullName + " ===");
Log("--- properties ---");
foreach (var pi in g.GetType().GetProperties()) {
    string acc = (pi.CanRead ? "get" : "") + (pi.CanWrite ? "/set" : "");
    Log(string.Format("   {0,-34} {1,-34} {2}", pi.Name, pi.PropertyType.Name, acc));
}
Log("--- methods (declared, non-property) ---");
foreach (var mi in g.GetType().GetMethods()) {
    if (mi.Name.StartsWith("get_") || mi.Name.StartsWith("set_")) continue;
    if (mi.DeclaringType == typeof(object)) continue;
    var ps = mi.GetParameters();
    var sb = new System.Text.StringBuilder();
    foreach (var p in ps) { if (sb.Length>0) sb.Append(", "); sb.Append(p.ParameterType.Name).Append(" ").Append(p.Name); }
    Log(string.Format("   {0} {1}({2})", mi.ReturnType.Name, mi.Name, sb.ToString()));
}

// ---- PointGroupRoot: how groups are created and ordered
Log("");
Log("=== PointGroups collection: " + civ.PointGroups.GetType().FullName + " ===");
foreach (var mi in civ.PointGroups.GetType().GetMethods()) {
    if (mi.Name.StartsWith("get_") || mi.Name.StartsWith("set_")) continue;
    if (mi.DeclaringType == typeof(object)) continue;
    var ps = mi.GetParameters();
    var sb = new System.Text.StringBuilder();
    foreach (var p in ps) { if (sb.Length>0) sb.Append(", "); sb.Append(p.ParameterType.Name).Append(" ").Append(p.Name); }
    Log(string.Format("   {0} {1}({2})", mi.ReturnType.Name, mi.Name, sb.ToString()));
}
Log("--- properties ---");
foreach (var pi in civ.PointGroups.GetType().GetProperties())
    Log(string.Format("   {0,-30} {1}", pi.Name, pi.PropertyType.Name));

// ---- group DRAW ORDER, which decides which style wins
Log("");
Log("=== current group order (index = priority) ===");
int i = 0;
foreach (ObjectId gid in civ.PointGroups) {
    var pg = Tx.GetObject(gid, OpenMode.ForRead);
    var np = pg.GetType().GetProperty("Name");
    Log(string.Format("   [{0,2}] {1}", i++, np.GetValue(pg, null)));
}

// ---- the label styles we need, do they exist by these exact names?
Log("");
Log("=== label styles we intend to use ===");
foreach (string want in new string[]{"Point#-Elevation-Description","Description Only [IPF]","Description Only"}) {
    bool found = false;
    foreach (ObjectId sid in civ.Styles.LabelStyles.PointLabelStyles.LabelStyles) {
        var st = Tx.GetObject(sid, OpenMode.ForRead);
        if (((string)st.GetType().GetProperty("Name").GetValue(st,null)) == want) { found = true; break; }
    }
    Log(string.Format("   \"{0}\"  {1}", want, found ? "EXISTS" : "MISSING"));
}
foreach (string want in new string[]{"Iron Pin","Iron Pin [LARGE]","Basic"}) {
    bool found = false;
    foreach (ObjectId sid in civ.Styles.PointStyles) {
        var st = Tx.GetObject(sid, OpenMode.ForRead);
        if (((string)st.GetType().GetProperty("Name").GetValue(st,null)) == want) { found = true; break; }
    }
    Log(string.Format("   pointStyle \"{0}\"  {1}", want, found ? "EXISTS" : "MISSING"));
}

// ---- does E:\DATA exist from the plugin's side?
Log("");
string EDIR = "E:" + ((char)92) + "DATA";
Log("E drive folder " + EDIR + " exists: " + System.IO.Directory.Exists(EDIR));

Result

Status
error
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260714 - 285 Huckaby Rd, Brooks, GA 30205, USA\260714 - 285 Huckaby Rd R2.dwg
Message
Property Get method was not found.
Entities
Duration
357 ms
Civil 3D
25.0.0.0

Log

drawing: C:\Users\sanja\OneDrive\_SurveyDisco\260714 - 285 Huckaby Rd, Brooks, GA 30205, USA\260714 - 285 Huckaby Rd R2.dwg

=== PointGroup type: Autodesk.Civil.DatabaseServices.PointGroup ===
--- properties ---
   UDPClassificationApplyType         UDPClassificationApplyType         get
   UDPClassificationName              String                             get
   AllPointsGroupName                 String                             get
   PointLabelStyleId                  ObjectId                           get/set
   IsPointLabelStyleOverridden        Boolean                            get/set
   PointStyleId                       ObjectId                           get/set
   IsPointStyleOverridden             Boolean                            get/set
   ElevationOverride                  PointGroupElevationOverrideInfo    get
   IsElevationOverridden              Boolean                            get/set
   RawDescriptionOverride             PointGroupRawDescriptionOverrideInfo get
   IsRawDescriptionOverridden         Boolean                            get/set
   IsLocked                           Boolean                            get/set
   IsOutOfDate                        Boolean                            get
   RawDescription                     String                             get
   PointsCount                        UInt32                             get
   IsAllPointsGroup                   Boolean                            get
   Description                        String                             /set
   Name                               String                             get/set
   IsUsed                             Boolean                            get
   Document                           Object                             get
   Application                        Object                             get
   PaperOrientation                   PaperOrientationStates             get
   Annotative                         AnnotativeStates                   get/set
   HasFields                          Boolean                            get
   AcadObject                         Object                             get
   ClassID                            Guid                               get
   ObjectBirthVersion                 FullDwgVersion                     get
   HasSaveVersionOverride             Boolean                            get/set
   IsObjectIdsInFlux                  Boolean                            get
   UndoFiler                          DwgFiler                           get
   IsAProxy                           Boolean                            get
   IsTransactionResident              Boolean                            get
   IsReallyClosing                    Boolean                            get
   IsCancelling                       Boolean                            get
   IsUndoing                          Boolean                            get
   IsNotifying                        Boolean                            get
   IsNewObject                        Boolean                            get
   IsModifiedGraphics                 Boolean                            get
   IsModifiedXData                    Boolean                            get
   IsModified                         Boolean                            get
   IsNotifyEnabled                    Boolean                            get
   IsWriteEnabled                     Boolean                            get
   IsReadEnabled                      Boolean                            get
   IsErased                           Boolean                            get
   IsEraseStatusToggled               Boolean                            get
   XData                              ResultBuffer                       get/set
   MergeStyle                         DuplicateRecordCloning             get/set
   ExtensionDictionary                ObjectId                           get
   Drawable                           Drawable                           get
   Database                           Database                           get
   Handle                             Handle                             get
   OwnerId                            ObjectId                           get/set
   ObjectId                           ObjectId                           get
   Id                                 ObjectId                           get
   IsPersistent                       Boolean                            get
   DrawStream                         DrawStream                         get/set
   Bounds                             Nullable`1                         get
   DrawableType                       DrawableType                       get
   AutoDelete                         Boolean                            get/set
   IsDisposed                         Boolean                            get
   UnmanagedObject                    IntPtr                             get
--- methods (declared, non-property) ---
   PointGroupChangeInfo GetPendingChanges()
   Void Update()
   UInt32[] GetPointNumbers()
   Boolean ContainsPoint(UInt32 pointNumber)
   Void LockPoints()
   Void UnlockPoints()
   Void DeletePoints()
   Void ApplyDescriptionKeys()
   Void UseAllClassifications()
   Void UseNoneClassification()
   Void UseCustomClassification(UDPClassification udpClassification)
   Void UseCustomClassification(String name)
   Void SetQuery(PointGroupQuery query)
   PointGroupQuery GetQuery()
   DBObject DeepClone(DBObject ownerPointer, IdMapping idMap, Boolean isPrimary)
   DBObject WblockClone(RXObject ownerPointer, IdMapping idMap, Boolean isPrimary)
   DecomposeForSaveReplacementRecord DecomposeForSave(DwgVersion version)
   Void CreateExtensionDictionary()
   Void ReleaseExtensionDictionary()
   Void UpgradeOpen()
   Boolean UpgradeFromNotify()
   Void DowngradeOpen()
   Void DowngradeToNotify(Boolean wasWritable)
   Void Cancel()
   Void Close()
   Void CloseAndPage(Boolean onlyWhenClean)
   Void Erase()
   Void Erase(Boolean erasing)
   Void HandOverTo(DBObject newPointer, Boolean keepXData, Boolean keepExtensionDictionary)
   Void SwapIdWith(ObjectId otherId, Boolean swapExtendedData, Boolean swapExtensionDictionary)
   Void SwapReferences(IdMapping idMap)
   Void Audit(AuditInfo auditInfo)
   Void DwgIn(DwgFiler filer)
   Void DwgOut(DwgFiler filer)
   Void DxfIn(DxfFiler filer)
   Void DxfOut(DxfFiler filer)
   Void XDataTransformBy(Matrix3d transform)
   ResultBuffer GetXDataForApplication(String applicationName)
   Byte[] GetBinaryDataForKey(String key)
   Void SetBinaryDataForKey(String key, Byte[] chunk)
   Void DisableUndoRecording(Boolean disable)
   Void ApplyPartialUndo(DwgFiler undoFiler, RXClass classObj)
   Boolean HasPersistentReactor(ObjectId objId)
   List`1 GetReactors()
   List`1 GetTransientReactors()
   ObjectIdCollection GetPersistentReactorIds()
   Void SetObjectIdsInFlux()
   FullDwgVersion GetObjectSaveVersion(DxfFiler filer)
   FullDwgVersion GetObjectSaveVersion(DwgFiler filer)
   ObjectId GetField(String propertyName)
   ObjectId GetField()
   ObjectId SetField(String propertyName, Field field)
   ObjectId SetField(Field field)
   Void RemoveField(ObjectId id)
   ObjectId RemoveField(String propertyName)
   ObjectId RemoveField()
   Boolean SetFromStyle()
   Void ResetScaleDependentProperties()
   Void SetPaperOrientation(Boolean bPaperOrientation)
   Void ApplyPaperOrientationTransform(Viewport viewport)
   Boolean SupportsCollection(String collectionName)
   Boolean HasContext(ObjectContext context)
   Void AddContext(ObjectContext context)
   Void RemoveContext(ObjectContext context)
   DBObjectEventExtender GetEventExtender(Boolean create)
   Void add_Cancelled(EventHandler A_0)
   Void remove_Cancelled(EventHandler A_0)
   Void add_Copied(ObjectEventHandler A_0)
   Void remove_Copied(ObjectEventHandler A_0)
   Void add_Erased(ObjectErasedEventHandler A_0)
   Void remove_Erased(ObjectErasedEventHandler A_0)
   Void add_Goodbye(EventHandler A_0)
   Void remove_Goodbye(EventHandler A_0)
   Void add_OpenedForModify(EventHandler A_0)
   Void remove_OpenedForModify(EventHandler A_0)
   Void add_Modified(EventHandler A_0)
   Void remove_Modified(EventHandler A_0)
   Void add_SubObjectModified(ObjectEventHandler A_0)
   Void remove_SubObjectModified(ObjectEventHandler A_0)
   Void add_ModifyUndone(EventHandler A_0)
   Void remove_ModifyUndone(EventHandler A_0)
   Void add_ModifiedXData(EventHandler A_0)
   Void remove_ModifiedXData(EventHandler A_0)
   Void add_Unappended(EventHandler A_0)
   Void remove_Unappended(EventHandler A_0)
   Void add_Reappended(EventHandler A_0)
   Void remove_Reappended(EventHandler A_0)
   Void add_ObjectClosed(ObjectClosedEventHandler A_0)
   Void remove_ObjectClosed(ObjectClosedEventHandler A_0)
   IParameter GetParameterInterface(String name, Boolean runtimeInterface)
   Int32 SetAttributes(DrawableTraits traits)
   Boolean WorldDraw(WorldDraw wd)
   Void ViewportDraw(ViewportDraw vd)
   Int32 ViewportDrawLogicalFlags(ViewportDraw vd)
   IntPtr X(RXClass protocolClass)
   IntPtr QueryX(RXClass protocolClass)
   RXClass GetRXClass()
   Int32 CompareTo(Object obj)
   Object Clone()
   Void CopyFrom(RXObject source)
   Boolean Equals(Object obj)
   Int32 GetHashCode()
   Void Dispose()
   Object GetLifetimeService()
   Object InitializeLifetimeService()

=== PointGroups collection: Autodesk.Civil.DatabaseServices.PointGroupCollection ===
   Boolean Contains(String name)
   Boolean Contains(ObjectId pointGroupId)
   ObjectId Add(String name)
   Void Remove(ObjectId pointGroupId)
   Void Remove(String name)
   Void RemoveAt(Int32 index)
   ObjectIdCollection GetOutOfDatePointGroupIds()
   Void UpdateAllPointGroups()
   IEnumerator`1 GetEnumerator()
   IEnumerator GetObjectEnumerator()
   PointGroupCollection GetPointGroups(Database pDatabase)
--- properties ---
   DrawOrder                      ObjectIdCollection
   AllPointsPointGroupId          ObjectId
   Count                          Int32
   Item                           ObjectId
   Item                           ObjectId

=== current group order (index = priority) ===
   [ 0] PP
   [ 1] POB
   [ 2] IPF NS
   [ 3] MH
   [ 4] FH
   [ 5] FF
   [ 6] GAS
   [ 7] TBC
   [ 8] No Display
   [ 9] BUILDING
   [10] NORTHING_EASTING
   [11] FENCE
   [12] Display [SPECIFIC]
   [13] TOPO
   [14] WALL ELEV
   [15] TREES
   [16] WALL
   [17] UTIL
   [18] WM
   [19] _All Points
   [20] CL

=== label styles we intend to use ===

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.