Cú pháp và hàm toán học Subassembly Composer

APPENDIX

VB Expressions: Math

Emphasized values can be changed to reference the applicable value.

Sample VB ExpressionOutputDescription
  math.round(2.568,2)  2.57  Returns a value rounded to the nearest specified decimal places (ex. -2 = hundreds, -1 = tens, 0 = whole number, 1 = tenths, 2 = hundredths, etc.)
  math.floor(2.568)  2Returns the largest integer that is less than or equal to the specified value (i.e. rounds down)
  math.ceiling(2.568)  3Returns the smallest integer that is greater than or equal to the specified value (i.e. rounds up)
math.max(2.568,0.813)2.568Returns the larger of a series of two specified values
math.min(2.568,0.813)0.813Returns the smaller of a series of two specified values
math.abs(-2.568)2.568Returns the absolute value
math.pi3.14159…Returns the value of the constant pi
math.e2.71828…Returns the value of the constant e
math.sin(math.pi)0Returns the sine of a specified angle measured inradians
math.cos(math.pi)-1Returns the cosine of a specified angle measured in radians
math.tan(math.pi)0Returns the tangent of a specified angle measured in radians
  math.asin(1)  1.57079…  Returns the angle measured in radians whose sine is the specified value
  math.acos(1)  0Returns the angle measured in radians whose cosine is the specified value
  math.atan(1)  0.78539…Returns the angle measured in radians whose tangent is the specified value
math.log(math.e)1Returns the natural (base e) logarithm of a specified value
math.log10(10)1Returns the base 10 logarithm of a specified value
math.exp(1)2.71828…Returns e raised to the specified power
math.pow(2,3)8Returns a value raised to the specified power
math.sqrt(81)9Returns the square root of a specified value

Create Subassemblies That Think Outside the Box With Subassembly Composer for AutoCAD Civil 3D

VB Expressions: Logic

Emphasized values can be changed to reference the applicable   value.

  IF(P1.Y>P2.Y,2,3)Used in a VB Expression, returns a value depending on whether the condition (P1.Y>P2.Y) is true (value of 2) or false (value of 3)
P1.Y>P2.YA condition that returns true if P1.Y is greater than P2.Y
P1.Y>=P2.YA condition that returns true if P1.Y is greater than or equal to P2.Y
P1.Y<P2.YA condition that returns true if P1.Y is less than P2.Y
P1.Y<=P2.YA condition that returns true if P1.Y is less than or equal to P2.Y
P1.Y=P2.YA condition that returns true if P1.Y is equal to P2.Y
P1.Y<>P2.YA condition that returns true if P1.Y is not equal to P2.Y
(P1.Y>P2.Y)AND(P2.X>P3.X)A condition that returns true if both the condition (P1.Y>P2.Y) AND the condition (P2.x>P3.X) are true
  (P1.Y>P2.Y)OR(P2.X>P3.X)A condition that returns true as long as either the condition (P1.Y>P2.Y) OR the condition (P2.x>P3.X) is true
  (P1.Y>P2.Y)XOR(P2.X>P3.X)A condition that returns true if only one of the two conditions (P1.Y>P2.Y), (P2.x>P3.X) is true (if both are true or both are false, then false is returned)

VB Expressions: Subassembly Composer Application Programming Interface

(API) Functions

Emphasized values can be changed to reference the applicable   element.

Points and Auxiliary Points Class

P1.XHorizontal distance from point P1 to Origin
P1.YVertical distance from point P1 to Origin
P1.OffsetHorizontal distance from point P1 to assembly baseline
P1.ElevationElevation of point P1 relative to 0
P1.DistanceTo(“P2”)Distance from point P1 to point P2 (Always positive)
P1.SlopeTo(“P2”)Slope from point P1 to point P2 (Upward = positive, Downward = Negative)
P1.IsValidPoint P1 assigned and valid to use (True/False)
  P1.DistanceToSurface(SurfaceTarget)Vertical distance from point P1 to SurfaceTarget (point above = positive, point below = negative)

Elevation Target Class

ElevationTarget.IsValidElevationTarget is assigned and valid to use (True/False)
ElevationTarget.ElevationVertical distance from ElevationTarget to assembly baseline

L1.SlopeSlope of link L1
L1.LengthLength of link L1 (Always positive)
L1.XlengthHorizontal distance between start to end of link L1 (Always positive)
L1.YlengthVertical distance between start to end of link L1 (Always positive)
L1.StartPointA point located at the start of link L1 (Can be used in API Functions for P1 Class)
L1.EndPointA point located at the end of link L1 (Can be used in API Functions for P1 Class)
L1.MaxYMaximum Y elevation from a link‟s points
L1.MinYGet the minimum Y elevation from a link‟s points
L1.MaxInterceptY(slope)Apply the highest intercept of a given link‟s points to the start of another link
L1.MinInterceptY(slope)Apply the lowest intercept of a given link‟s points to the start of another link
L1.LinearRegressionSlopeSlope calculated as a linear regression on the points in a link to find the best fit slope between all of them
L1.LinearRegressionInterceptYThe Y value of the linear regression link
L1.IsValidLink L1 is assigned and valid to use (True/False)
L1.HasIntersection(“L2”) L1.HasIntersection(“L2”, true, true)L1 and L2 have an intersection, second input is a Boolean defining whether to extend L1 with default of false, third input is a boolean defining whether to extend L2 with default of false (True/False)

Offset Target Class

OffsetTarget.IsValidOffsetTarget is assigned and valid to use (True/False)
OffsetTarget.OffsetHorizontal distance from OffsetTarget to assembly baseline

Surface Target Class

SurfaceTarget.IsValid                  SurfaceTarget is assigned and valid to use (True/False)

Baseline Class

Baseline.StationStation on assembly baseline
Baseline.ElevationElevation on assembly baseline
Baseline.RegionStartStation at the start of the current corridor region
Baseline.RegionEndStation at the end of the current corridor region
Baseline.GradeGrade of assembly baseline
Baseline.TurnDirectionTurn direction of assembly baseline (Left = -1, Non curve = 0, Right = 1)

*Note assembly baseline may or may not be the subassembly origin

EnumerationType Class

EnumerationType.Value                The string value of the current enumeration item

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *