Exemplo n.º 1
0
        /// <summary>
        /// Create a new (or update an existing) load in the model
        /// </summary>
        /// <typeparam name="TLoad">The type of load to be created</typeparam>
        /// <param name="lCase">The case of which the new load is to be part</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>The created or updated load case.</param>
        /// <returns></returns>
        public TLoad Load <TLoad>(LoadCase lCase, ExecutionInfo exInfo = null)
            where TLoad : Load, new()
        {
            TLoad result = new TLoad();

            result      = (TLoad)Model.History.Update(exInfo, result);
            result.Case = lCase;
            Model.Add(result);
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get all loads in this collection that belong to the specified load case
        /// </summary>
        /// <param name="loadCase"></param>
        /// <returns></returns>
        public LoadCollection AllInCase(LoadCase loadCase)
        {
            var result = new LoadCollection();

            foreach (Load load in this)
            {
                if (load.Case == loadCase)
                {
                    result.Add(load);
                }
            }
            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create a new (or update an existing) load case in the model
        /// </summary>
        /// <param name="name">The name of the load case</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>The created or updated load case.</returns>
        public LoadCase LoadCase(string name, LoadCaseType type, ExecutionInfo exInfo = null)
        {
            LoadCase result = new LoadCase();

            result = Model.History.Update(exInfo, result);
            if (name != null)
            {
                result.Name = name;
            }
            if (result.Name == null)
            {
                result.Name = Model.LoadCases.NextAvailableName("Load Case", result, true);
            }
            result.CaseType = type;
            Model.Add(result);
            return(result);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Create a new (or update an existing) panel load in the model
 /// </summary>
 /// <param name="lCase">The case of which the new load is to be part</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>The created or updated load case.</param>
 /// <returns></returns>
 public PanelLoad PanelLoad(LoadCase lCase, ExecutionInfo exInfo = null)
 {
     return(Load <PanelLoad>(lCase, exInfo));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a new (or update an existing) linear element point load in the model
 /// </summary>
 /// <param name="lCase">The case of which the new load is to be part</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>The created or updated load case.</param>
 /// <returns></returns>
 public LinearElementPointLoad LinearElementPointLoad(LoadCase lCase, ExecutionInfo exInfo = null)
 {
     return(Load <LinearElementPointLoad>(lCase, exInfo));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Create a new (or update an existing) thermal load in the model
 /// </summary>
 /// <param name="lCase">The case of which the new load is to be part</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>The created or updated load case.</param>
 /// <returns></returns>
 public ThermalLoad ThermalLoad(LoadCase lCase, ExecutionInfo exInfo = null)
 {
     return(Load <ThermalLoad>(lCase, exInfo));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Create a new (or update an existing) gravity load in the model
 /// </summary>
 /// <param name="lCase">The case of which the new load is to be part</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>The created or updated load case.</param>
 /// <returns></returns>
 public GravityLoad GravityLoad(LoadCase lCase, ExecutionInfo exInfo = null)
 {
     return(Load <GravityLoad>(lCase, exInfo));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Create a new (or update an existing) nodal load in the model
 /// </summary>
 /// <param name="lCase">The case of which the new load is to be part</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>The created or updated load case.</param>
 /// <returns></returns>
 public NodeLoad NodeLoad(LoadCase lCase, ExecutionInfo exInfo = null)
 {
     return(Load <NodeLoad>(lCase, exInfo));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Add a new load case to this model, if it does not already exist within it
 /// </summary>
 /// <param name="loadCase">The load case to be added.</param>
 /// <returns>True if the load case could be added, false if it had already
 /// been added to the model.</returns>
 public bool Add(LoadCase loadCase)
 {
     return(LoadCases.TryAdd(loadCase));
 }