Exemplo n.º 1
0
        /// <summary>
        /// Deletes the distributed load assignments to the specified objects for the specified load pattern.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <param name="loadPattern">The name of the load pattern associated with the load.</param>
        /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
        public void DeleteLoadDistributed(CSiApplication app, string loadPattern)
        {
            app.Model.ObjectModel.FrameObject.DeleteLoadDistributed(Name, loadPattern);
            int deleteIndex = DistributedLoads.FindIndex(f => f.LoadPattern == loadPattern);

            DistributedLoads.RemoveAt(deleteIndex);
        }
Exemplo n.º 2
0
        // LoadDistributed
        /// <summary>
        /// Returns the distributed load assignments to objects.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
        public void GetLoadDistributed(CSiApplication app)
        {
            // TODO: Add to API project?
            app.Model.ObjectModel.FrameObject.GetLoadDistributed(Name,
                                                                 out var names,
                                                                 out var loadPatterns,
                                                                 out var forceTypes,
                                                                 out var loadDirections,
                                                                 out var startLoadValues,
                                                                 out var endLoadValues,
                                                                 out var absoluteDistanceStartFromI,
                                                                 out var absoluteDistanceEndFromI,
                                                                 out var relativeDistanceStartFromI,
                                                                 out var relativeDistanceEndFromI,
                                                                 out var coordinateSystems);

            for (int i = 0; i < names.Length; i++)
            {
                FrameLoadDistributed distributedLoad = new FrameLoadDistributed
                {
                    LoadPattern                = loadPatterns[i],
                    ForceType                  = forceTypes[i],
                    LoadDirection              = loadDirections[i],
                    StartLoadValue             = startLoadValues[i],
                    EndLoadValue               = endLoadValues[i],
                    AbsoluteDistanceStartFromI = absoluteDistanceStartFromI[i],
                    AbsoluteDistanceEndFromI   = absoluteDistanceEndFromI[i],
                    RelativeDistanceStartFromI = relativeDistanceStartFromI[i],
                    RelativeDistanceEndFromI   = relativeDistanceEndFromI[i],
                    CoordinateSystem           = coordinateSystems[i],
                };

                DistributedLoads.Add(distributedLoad);
            }
        }