/// <summary> /// Create a new (or update an existing) linear element in the model. /// </summary> /// <param name="geometry">The set-out geometry of the element</param> /// <param name="exInfo">Optional. The execution information of the current action. /// If an object has been created previously with matching execution information then /// instead of creating a new item this previous one will be updated and returned instead. /// This enables this method to be used parametrically.</param> /// <returns></returns> public LinearElement LinearElement(Curve geometry, ExecutionInfo exInfo = null) { LinearElement result = new LinearElement(); result = Model.History.Update(exInfo, result); result.ReplaceGeometry(geometry); Model.Add(result); return(result); }
/// <summary> /// Create a new (or update an existing) linear element as a copy of another one /// </summary> /// <param name="element">The element to copy.</param> /// <param name="newGeometry">Optional. The set-out geometry to be used for the new element.</param> /// <param name="exInfo">Optional. The execution information of the current action. /// If an object has been created previously with matching execution information then /// instead of creating a new item this previous one will be updated and returned instead. /// This enables this method to be used parametrically.</param> /// <returns></returns> public LinearElement CopyOf(LinearElement element, Curve newGeometry = null, ExecutionInfo exInfo = null) { LinearElement result = new LinearElement(); result = Model.History.Update(exInfo, result); result.CopyPropertiesFrom(element); if (newGeometry != null) { result.ReplaceGeometry(newGeometry); } Model.Add(result); return(result); }