Beispiel #1
0
        /// <summary>
        /// Create a new (or update an existing) section family in the model
        /// </summary>
        /// <param name="name">The name of the section.
        /// May be modified with a numerical suffix if the name already exists in
        /// the model.</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 </returns>
        public SectionFamily SectionFamily(string name, ExecutionInfo exInfo = null)
        {
            SectionFamily result = new SectionFamily();

            result      = Model.History.Update(exInfo, result);
            result.Name = Model.Families.NextAvailableName(name, result);
            Model.Add(result);
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Create a new (or update an existing) linear element in the model.
        /// </summary>
        /// <param name="startPoint">The start of the element set-out line</param>
        /// <param name="endPoint">The end of the element set-out line</param>
        /// <param name="family">The section 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(Vector startPoint, Vector endPoint, SectionFamily family, ExecutionInfo exInfo = null)
        {
            var result = LinearElement(new Line(startPoint, endPoint), exInfo);

            if (result != null)
            {
                result.Family = family;
            }
            return(result);
        }
Beispiel #3
0
        /// <summary>
        /// Create a new (or update an existing) section family in the model
        /// </summary>
        /// <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 SectionFamily SectionFamily(ExecutionInfo exInfo = null)
        {
            SectionFamily result = new SectionFamily();

            result = Model.History.Update(exInfo, result);
            if (result.Name == null)
            {
                result.Name = Model.Families.NextAvailableName("Section", result, true);
            }
            Model.Add(result);
            return(result);
        }
Beispiel #4
0
        /// <summary>
        /// Create a new (or update an existing) linear element in the model.
        /// </summary>
        /// <param name="startPoint">The start of the element set-out line</param>
        /// <param name="endPoint">The end of the element set-out line</param>
        /// <param name="family">The section 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(Node startNode, Node endNode, SectionFamily family, ExecutionInfo exInfo = null)
        {
            var result = LinearElement(new Line(startNode, endNode), exInfo);

            if (result != null)
            {
                result.StartNode = startNode;
                result.EndNode   = endNode;
                result.Family    = family;
            }
            return(result);
        }
Beispiel #5
0
 /// <summary>
 /// Initialise a set to contain all elements in the model to which it
 /// belongs which are assigned the specified section.
 /// </summary>
 /// <param name="section"></param>
 public LinearElementSet(SectionFamily section) : base(section)
 {
 }