cAreaObjAddByCoord Method |
Adds a new area object, defining points at the specified coordinates.
Namespace:
ETABS2016
Assembly:
ETABS2016 (in ETABS2016.dll) Version: 16.0.0.0 (16.0.0.0)
Syntaxint AddByCoord(
int NumberPoints,
ref double[] X,
ref double[] Y,
ref double[] Z,
ref string Name,
string PropName = "Default",
string UserName = "",
string CSys = "Global"
)
Function AddByCoord (
NumberPoints As Integer,
ByRef X As Double(),
ByRef Y As Double(),
ByRef Z As Double(),
ByRef Name As String,
Optional PropName As String = "Default",
Optional UserName As String = "",
Optional CSys As String = "Global"
) As Integer
int AddByCoord(
int NumberPoints,
array<double>^% X,
array<double>^% Y,
array<double>^% Z,
String^% Name,
String^ PropName = L"Default",
String^ UserName = L"",
String^ CSys = L"Global"
)
abstract AddByCoord :
NumberPoints : int *
X : float[] byref *
Y : float[] byref *
Z : float[] byref *
Name : string byref *
?PropName : string *
?UserName : string *
?CSys : string
(* Defaults:
let _PropName = defaultArg PropName "Default"
let _UserName = defaultArg UserName ""
let _CSys = defaultArg CSys "Global"
*)
-> int
Parameters
- NumberPoints
- Type: SystemInt32
The number of points in the area object.
- X
- Type: SystemDouble
- Y
- Type: SystemDouble
- Z
- Type: SystemDouble
- Name
- Type: SystemString
This is the name that the program ultimately assigns to the area object.
If no userName is specified, the program assigns
a default name to the area object. If a userName is specified
and that name is not used for another area object, the userName
is assigned to the area object; otherwise a default name is assigned to the area object.
- PropName (Optional)
- Type: SystemString
This is Default, None or the name of a defined area property.
If it is Default, the program assigns a default area property to the area object.
If it is None, no area property is assigned to the area object.
If it is the name of a defined area property, that property is assigned to the area object.
- UserName (Optional)
- Type: SystemString
- CSys (Optional)
- Type: SystemString
The name of the coordinate system in which the area object point coordinates are defined.
Return Value
Type:
Int32
Returns zero if the area object is successfully added,
otherwise it returns a nonzero value.
Remarks
ExamplesPublic Sub Example()
Dim SapModel As cSapModel
Dim EtabsObject As cOAPI
Dim ret As Integer = -1
Dim x() As Double
Dim y() As Double
Dim z() As Double
Dim Name As String
EtabsObject = CreateObject("CSI.ETABS.API.ETABSObject")
ret = EtabsObject.ApplicationStart()
SapModel = EtabsObject.SapModel
ret = SapModel.InitializeNewModel()
ret = SapModel.File.NewBlank()
ReDim x(5)
ReDim y(5)
ReDim z(5)
x(0) = 50: y(0) = 0
x(1) = 100: y(1) = 0
x(2) = 150: y(2) = 40
x(3) = 100: y(3) = 80
x(4) = 50: y(4) = 80
x(5) = 0: y(5) = 40
ret = SapModel.AreaObj.AddByCoord(6, x, y, z, Name)
ret = SapModel.View.RefreshView(0, False)
EtabsObject.ApplicationExit(False)
SapModel = Nothing
EtabsObject = Nothing
End Sub
See Also