Message 1 of 5
Pipe Structure PartSizeName returns wrong information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to make a copy of a Structure, so I need to obtain the FamilyId and SizeId from the existing original Structure.
The PartSizeName that I read from the structure differs from anything that can be found in the PartSizes of the Structure PartFamily.
How do I get the correct match to obtain the SizeId from the existing Structure?
using Autodesk.Civil.DatabaseServices;
// structure that is used for the copy
Structure origStructure = tr.GetObject(origStructureId, OpenMode.ForWrite) as Structure;
Network existingNetwork = tr.GetObject(origStructure.NetworkId, OpenMode.ForRead) as Network;
PartsList networkPartsList = tr.GetObject(existingNetwork.PartsListId, OpenMode.ForRead) as PartsList;
// get structure family Id
ObjectId structureFamilyId = networkPartsList[origStructure.PartFamilyName];
PartFamily partFamily = tr.GetObject(structureFamilyId, OpenMode.ForRead) as PartFamily;
// traverse all part sizes in the part family to find size id
structureSizeId = ObjectId.Null;
for (int i = 0; i < partFamily.PartSizeCount; i++)
{
PartSize partSize = tr.GetObject(partFamily[i], OpenMode.ForRead) as PartSize;
if (partSize.Name == origStructure.PartSizeName)
{
structureSizeId = partSize.Id;
break;
}
}
Structure selection during network creation:
Result:
I have attacthed the basic file with two Pipe Networks.
Using Standard Network works OK, using Storm Network does not.
Moreover, this is possibly a silly question, but why cannot I peek into the Structure object in debug?
I open it normally:
Structure origStructure = tr.GetObject(origStructure, OpenMode.ForRead) as Structure;And this is what I get:
What do I need to do to see the parameter values?