Hi, I struggled with this for ages also
There is no way to simply condition the result such that if it's circular or square it will only show the correct value relative to the shape.
The only way to do this is through the Property Set information.
You'll need to:
Set up a bound shape entry, looking at the bound shape of the structure.
RESULT="-"
On Error Resume Next
Set oApp=GetObject(, "AutoCAD.Application")
Set oCivilApp=oApp.GetInterfaceObject("[_XUILand]")
Set obj=oCivilApp.ActiveDocument.ObjectIdToObject("[ObjectID]")
Result = Obj.BoundingShape
Next add a structure size property to use in labels / tables, then using the boundingshape of the structure obtain the Length \ width or diameter respectively.
IF [BoundShape] = "1" then
''Circular
Shp = (obj.PartDataRecord.FindByContext("StructInnerDiameter").Tag & "mm")
Result = Shp
ElseIf [BoundShape] = "2" then
''Square \ rectangular
shp = (Cstr(obj.PartDataRecord.FindByContext("StructInnerLength").Tag) & "mm L x " &Cstr(obj.PartDataRecord.FindByContext("StructInnerLength").Tag) & "mm W" )
Result = Shp
End If
You can't (in 2022) insert the property in the table but you can insert it into a Text Label then copy the string "PS:<???>" out.
You can paste this into the table entry and it will now only display the size for rectangular or square accordingly.
Mike
Mike Evans
Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB