RVTDocs.com

PointLoad.Create(Document, ElementId, XYZ, XYZ, XYZ, PointLoadType)

Method
Description:
Creates a new custom hosted point load within the project using data at point.
Syntax
public static PointLoad Create(
	Document document,
	ElementId hostElemId,
	XYZ point,
	XYZ forceVector,
	XYZ momentVector,
	PointLoadType symbol
)
Examples
Document document = commandData.Application.ActiveUIDocument.Document;
UIDocument activeDoc = commandData.Application.ActiveUIDocument;

//select object for adding a point load
Reference eRef = activeDoc.Selection.PickObject(ObjectType.Element, "Please select the analytical element");
ElementId selectedElementId = null;
if (eRef != null && eRef.ElementId != ElementId.InvalidElementId)
   selectedElementId = eRef.ElementId;

XYZ location = activeDoc.Selection.PickPoint("Point Load location");

using (Transaction transaction = new Transaction(document, "Create custom PointLoad"))
{
   transaction.Start();
   PointLoad pointLoad = null;

   if (PointLoad.IsPointInsideHostBoundaries(document, selectedElementId, location))
      pointLoad = PointLoad.Create(document, selectedElementId, location, new XYZ(1, 0, 0), new XYZ(1, 0, 0), null);

   transaction.Commit();
}
Parameters
Parameter Type Description
document Document Document to which new point load will be added.
hostElemId ElementId The AnalyticalElement host element for the point Load.
point XYZ The position of point load, measured in decimal feet.
forceVector XYZ The applied 3d force vector.
momentVector XYZ The applied 3d moment vector.
symbol PointLoadType The symbol of the PointLoad. Set <span class="keyword"><span data-languagespecifictext="cpp=nullptr|vb=Nothing|nu=null" id="LSTFBBA9B94_1"></span></span> to use default type.
Return Value
Type Description
PointLoad If successful, returns the newly created PointLoad, otherwise.
Exceptions
Exception Condition
ArgumentException hostElemId is not permitted for this type of load. -or- Thrown when work plane is not valid.
ArgumentNullException A non-optional argument was null
ArgumentsInconsistentException Thrown when force and moment vectors are equal zero.
InvalidOperationException Thrown if type could not be set for newly created point load.