When attempting to create path reinforcement in a new model my code gives an exception stating that the ElementID for Path Reinforcement must be valid.
I get the default elementID with the following code:
ElementId defaultRebarBarTypeId = CDoc.myDoc.rvtDoc.GetDefaultElementTypeId(ElementTypeGroup.RebarBarType);
ElementId defaultPathReinforcementTypeId = CDoc.myDoc.rvtDoc.GetDefaultElementTypeId(ElementTypeGroup.PathReinforcementType);
the first defaultRebarBarTypeId returns a valid elementID but the defaultPathReinforcementTypeId value is -1. The value changes to a valid number only after i create path reinforcement in my model and try to run my code again. Is there any way around having to do that everytime?