ModelItemCollection oMC_NET = Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.SelectedItems;
ComApi.InwOpState10 oState = ComApiBridge.State;
if (oMC_NET.Count > 0)
{
ComApi.InwOpSelection comSelectionOut =
ComApiBridge.ToInwOpSelection(oMC_NET);
ComApi.InwSelectionPathsColl oPaths = comSelectionOut.Paths();
ComApi.InwOaPath3 oPath = (ComApi.InwOaPath3)oPaths.Last();
ComApi.InwGUIPropertyNode2 propn =
(ComApi.InwGUIPropertyNode2)oState.GetGUIPropertyNode(oPath, true);
ComApi.InwOaPropertyVec newPvec =
(ComApi.InwOaPropertyVec)oState.ObjectFactory(
ComApi.nwEObjectType.eObjectType_nwOaPropertyVec, null, null);
ComApi.InwOaProperty erectionDatesP = (ComApi.InwOaProperty)oState.ObjectFactory(
ComApi.nwEObjectType.eObjectType_nwOaProperty, null, null);
erectionDatesP.name = "Erection Date";
erectionDatesP.UserName = "Erection Date_UserName";
erectionDatesP.value = "na";
newPvec.Properties().Add(erectionDatesP);
ComApi.InwOaProperty bolttorqueDatesP = (ComApi.InwOaProperty)oState.ObjectFactory(
ComApi.nwEObjectType.eObjectType_nwOaProperty, null, null);
bolttorqueDatesP.name = "Bolt Torque Date";
bolttorqueDatesP.UserName = "Bolt Torque Date_UserName";
bolttorqueDatesP.value = "na";
newPvec.Properties().Add(bolttorqueDatesP);
ComApi.InwOaProperty inspectionDatesP = (ComApi.InwOaProperty)oState.ObjectFactory(
ComApi.nwEObjectType.eObjectType_nwOaProperty, null, null);
inspectionDatesP.name = "Inspection Date";
inspectionDatesP.UserName = "Inspection Date_UserName";
inspectionDatesP.value = "na";
newPvec.Properties().Add(inspectionDatesP);
propn.SetUserDefined(0, "Construction Dates",
"Construction Dates_InteralName", newPvec);
}