API.docx
《API.docx》由会员分享,可在线阅读,更多相关《API.docx(14页珍藏版)》请在冰豆网上搜索。
API
P1(AP1)Class
P1(AP1)类
P1toP1000isreservedasSubassemblyPoints.AP1toAP1000areavailabletorepresentauxiliarypoints.
P1至P1000保留为部件的点,AP1至AP1000用于辅助点。
X
Getapoint'shorizontalposition,relativetotheOriginPointofSubassembly.
获取一个点的水平坐标,相对于部件的原点。
Example:
示例:
P1.X
∙IfSubassemblySideisRightandP1isontherightofOrigin,thenP1.XisPositive.
∙IfSubassemblySideisLeftandP1isontheleftofOrigin,thenP1.XisPositive.
如果部件是“右侧”,并且P1在原点右侧,则P1.X为正值。
如果部件是“左侧”,并且P1在原点左侧,则P1.X为正值。
Y
Getapoint'sverticalposition,relativetotheOriginPointofSubassembly.
获取一个点的垂直坐标,相对于部件的原点。
Offset
Getapoint'soffsetposition,relativetothebaseline.
获取一个点相对于基准线的偏移。
Ifthesubassemblyisattachedtoanoffsetbaseline,thentheoffsetvalueisrelativetotheoffsetbaseline.
如果部件被附着在一个偏移基准线上,偏移值将相对于这个基准线。
Elevation
Getapoint'selevationrelativeto0.0.
获取一个点相对于0.0的高程。
DistanceTo("point")
Getthedistancetoanotherpoint.
获取到另一个点的距离。
Example:
示例:
P1.DistanceTo("P2")orP1.DistanceTo(L1.StartPoint)
SlopeTo("point")
Gettheslopetoanotherpoint.
获取到另一个点的坡度。
Example:
示例:
P1.SlopeTo("P2")orP1.SlopeTo(L1.StartPoint)
IsValid
Determinewhetheratargetisassignedandisvalidtouse.
确定是否制定了目标并且是否有效可用。
DistanceToSurface(surfacetarget)
Gettheverticaldistancetoasurfacetarget.
获取到目标曲面的垂直距离。
Example:
示例:
P1.DistanceToSurface(ExistingSurface)>0.
∙IfP1isabovethesurface,apositivevalueisreturned.
∙IfP1isbelowthesurface,anegativevalueisreturned.
如果P1高出曲面,返回正值;如果P1低于曲面,返回负值。
L1(AL1)Class
L1(AL1)类
L1toL1000isreservedasSubassemblyLinks.AL1toAL1000areavailabletorepresentauxiliarylinks.
L1至L1000保留为部件的连接,AL1至AL1000用于辅助连接。
Slope
Gettheslopeofalink.
获取连接的坡度。
Theslopeispositiveifthelinkisinupwarddirection.
如果连接方向是向上的则坡度为正值。
Length
Getanabsolutelength.
获取绝对长度。
Apositivevalueisalwaysreturned.
永远返回正值。
Xlength
Getalink'shorizontallength.
获取一个连接的水平投影长度。
Apositivevalueisalwaysreturned.
永远返回正值。
Ylength
Getalink'sverticallength.
获取一个连接的垂直投影长度。
Apositivevalueisalwaysreturned.
永远返回正值。
StartPoint
Getthestartpointofalink.
获取连接的起点。
Example:
示例:
Togetthestartpoint'sX:
L1.StartPoint.X
要获取起点的X:
L1.StartPoint.X
EndPoint
Gettheendpointofalink.
获取连接的终点。
MaxY
GetthemaximumYelevationfromalink'spoints.
获取连接点的最大高程值。
MinY
GettheminimumYelevationfromthelink'spoints.
获取连接点的最小高程值。
MaxInterceptY(slope)
Applythehighestinterceptofagivenlink'spointstothestartofanotherlink.
将给定连接点的最高截距点套用到另一个连接的起点。
TheYelevationisrelativetoOriginpoint.
Thisisusedinrehabsubassembliestofindthecriticaldepthformill/overlay.
高程Y相对于原点。
它用于修复部件,用来寻找mill/overlay的临界深度。
MinInterceptY(slope)
Applythelowestinterceptofagivenlink'spointstothestartofanotherlink.
将给定连接点的最低截距点套用到另一个连接的起点。
LinearRegressionSlope
Doalinearregressiononthepointsinalinktofindthebestfitslopebetweenallofthem.
对连接上的点进行线性回归来确定所有点之间的最佳拟合坡度。
Thisisusedinrehabsubassembliestofindtheslopeoftheexistingpavement.
它用于修复部件,用来寻找铺面的坡度。
Bothoftheselinearregressionfunctionsarebasedonstandardformulasforlinearregression.
这里两个线性回归函数都是基于标准的线性回归公式。
LinearRegressionInterceptY
FindtheYvalueofthelinearregressionline(atthestartpointofthelink).
寻找线性回归线的Y值(在连接的起点处)。
IsValid
Determinewhetheratargetisassignedandisvalidtouse.
确定目标是否指定并且是否有效可用。
HasIntersection(Link2IDasstring,ExtendLink1asbool=false,ExtendLink2asbool=false)
Determinewhetherthecurrentlinkintersectswithanotherlink.
确定是否与另一连接相交。
Threeparametersareavailable:
三个参数可用:
∙Link2ID:
stringspecifyingtheintersectinglink.Enterintersectionlinknameinquotationmarks.
指定相交连接的字符串,在双引号中输入连接名称。
∙ExtendLink1:
booleanvaluespecifyingwhetherLink1isextended.ThedefaultvalueisFalse.
指定是否延伸连接1的布尔值,默认值是False。
∙ExtendLink2:
booleanvaluespecifyingwhetherLink2isextended.ThedefaultvalueisFalse.
指定是否延伸连接2的布尔值,默认值是False。
Examples:
示例:
L1.HasIntersection("L2")
L1.HasIntersection("L2",true,true)
SEClass
SE类
HasLeftLI
Returntrueifleftlaneinsidesuperelevationslopeispresent.
如果存在左侧车道内侧超高坡度,则传回真。
HasLeftLO
Returntrueifleftlaneoutsidesuperelevationslopeispresent.
如果存在左侧车道外侧超高坡度,则传回真。
HasLeftSI
Returntrueifleftshouderinsidesuperelevationslopeispresent.
如果存在左侧路肩内侧超高坡度,则传回真。
HasLeftSO
Returntrueifleftshouderoutsidesuperelevationslopeispresent.
如果存在左侧路肩外侧超高坡度,则传回真。
HasRightLI
Returntrueifrightlaneinsidesuperelevationslopeispresent.
如果存在右侧车道内侧超高坡度,则传回真。
HasRightLO
Returntrueifrightlaneoutsidesuperelevationslopeispresent.
如果存在右侧车道外侧超高坡度,则传回真。
HasRightSI
Returntrueifrightshouderinsidesuperelevationslopeispresent.
如果存在右侧路肩内侧超高坡度,则传回真。
HasRightSO
Returntrueifrightshouderoutsidesuperelevationslopeispresent.
如果存在右侧路肩外侧超高坡度,则传回真。
LeftLI
Returnleftlaneinsidesuperelevationslope.
传回左侧车道内侧超高坡度。
LeftLO
Returnleftlaneoutsidesuperelevationslope.
传回左侧车道外侧超高坡度。
LeftSI
Returnleftshouderinsidesuperelevationslope.
传回左侧路肩内侧超高坡度。
LeftSO
Returnleftshouderoutsidesuperelevationslope.
传回左侧路肩外侧超高坡度。
RightLI
Returnrightlaneinsidesuperelevationslope.
传回右侧车道内侧超高坡度。
RightLO
Returnrightlaneoutsidesuperelevationslope.
传回右侧车道外侧超高坡度。
RightSI
Returnrightshouderinsidesuperelevationslope.
传回右侧路肩内侧超高坡度。
RightSO
Returnrightshouderoutsidesuperelevationslope.
传回右侧路肩外侧超高坡度。
OffsetTargetClass
目标偏移类
IsValid
Determinewhetheratargetisassignedandisvalidtouse.
确定目标是否指定并且是否有效可用。
Example:
示例:
OffsetTarget.IsValid
Offset
Gettheoffsetvalueofthetarget.
获取目标的偏移值。
Example:
示例:
OffsetTarget.Offset
ElevationTargetClass
目标高程类
IsValid
Determinewhetheratargetisassignedandisvalidtouse.
确定目标是否指定并且是否有效可用。
Example:
示例:
ElevationTarget.IsValid
Elevation
Gettheelevationvalueofatarget.
获取目标的高程值。
Example:
示例:
ElevationTarget.Elevation
SurfaceTargetClass
目标曲面类
IsValid
Determinewhetheratargetisassignedandisvalidtouse.
确定目标是否指定并且是否有效可用。
Example:
示例:
SurfaceTarget.isValid
BaselineClass
基线类
Station
Getthecurrentstationonthebaselinealignment.
在基准线定线上取得目前的桩号。
Elevation
Getthecurrentelevationonthebaseline.
在基准线上取得目前的高程。
RegionStart
Getthestartstationofthecurrentregion.
取得目前区域的起点桩号。
RegionEnd
Gettheendstationofthecurrentregion.
取得目前区域的终点桩号。
Grade
Getthegradeofthebaselineprothecurrentstation.
取得目前桩号处基准线纵断面的坡度比。
TurnDirection
Gettheturndirectionatthecurrentstation,basedonthecurvegroup.
根据曲线群组,取得目前桩号处的转向。
Dependingontheresultfoundatthecurrentstation,theresultisreturnedinoneofthreeways:
根据在目前桩号处找到的结果,将以三种方式之一传回结果:
∙Leftturn:
-1 左转向:
-1
∙Notoncurve:
0不在曲线上:
0
∙Rightturn:
1右转:
1
EnumerationTypeClass
枚举类型类
Value
Returnthestringvalueofthecurrentenumerationitem.
传回目前枚举项的字符串值。
SAClass
SA类
Thisclasschecksthestatusofanoverallsubassembly.
此类检查整个部件的状态。
IsLayout
ReturnTrueifthecurrentpreviewmodeisLayoutMode.
如果预览模式是布局模式则返回真。
Example:
示例:
SubassemblyName.IsLayout
CantClass
Cant类
PivotType
Returnsthepivotmethodassignedtothecurrentcurve.
传回指定给目前曲线的旋转方式。
Dependingontheresultfoundatthecurrentstation,theresultisreturnedinoneofthreeways:
根据在目前桩号处找到的结果,将以三种方式之一传回结果:
∙-1:
LowSideRail(leftrail)-1:
低侧轨道(左轨道)
∙0:
CenterBaseline(centerline)0:
中心基准线(中心线)
∙1:
HighSideRail(rightrail)1:
高侧轨道(右轨道)
LeftRailDeltaElevation
Returnsthedifferentialelevationfortheleftrail.
传回左轨道的差别高程。
RightRailDeltaElevation
Returnsthedifferentialelevationfortherightrail.
传回右轨道的差别高程。
TrackWidth
ReturnstheTrackWidththatisassignedtothealignment.
传回指定给定线的轨道宽度。
IsDefined
Determineswhethercanthasbeencalculatedonthealignment.
决定是否已根据定线计算铁路铁路铁路超高。
Example:
示例:
IF(Cant.IsDefined,True,False)
APIFunctionExamples
API函数样例
UsetheAPIfunctionstogetparametervaluesfromothergeometryelements.
使用API函数从其他几何图形元素取得参数值。
ToseeexamplesofAPIfunctions,openthefollowing SamplePKTfile:
若要查看API函数的样例,请打开以下PKT样例文件:
APIFunctionExamples.pkt
ThefollowingtableexplainseachoftheAPIfunctionsthatareusedinthisexample.
下表说明了此范例中使用的每种API函数。
CutorFillDecision
填挖判断
AP10.YCheckswhethertheYvalueofAP10islessthantheYvalueofP1:
检查AP10的Y值是否小于P1的Y值:
∙IfTrue,theFillcaseisused
∙IfFalse,theCutcaseisused
如果为真,则使用填方情况
如果为假,则使用挖方情况
FillDecision
填方判断
P1.DistanceToSurface(Surface)>2
CheckswhetherthedistancebetweenP1andtheSurfaceisgreaterthan2:
检查P1和曲面之间的距离是否大于2:
∙IfTrue,theHighFillcase(slopetothesurfaceat-200%)isused
∙IfFalse,theLowFillcase(slopethesurfaceat-100%)isused
如果为真,则使用“高填方”情况(地形坡度-200%)
如果为假,则使用“低填充”情况(地形坡度-100%)
CutDecision
挖方判断
P1.DistanceToSurface(Surface)>-2
CheckswhetherthedistancebetweenP1andtheSurfaceisgreaterthan-2:
检查P1和曲面之间的距离是否大于-2:
∙IfTrue,theDeepCutcase(slopetothesurfaceat100%)isused
∙IfFalse,theShallowCutcase(slopethesurfaceat200%)isused
如果为真,则使用“深挖”情况(地形坡度100%)
如果为假,则使用“浅挖”情况(地形坡度200%)
P4Slope
P4坡度
L1.Slope
ApplytheslopethatiscalculatedforL1.
使用L1的坡度
P4DeltaY
P4增量Y
P2.Y-P3.Y
ApplyaYvaluethatisrelativetotheverticaldistancefromthepreviouspoint(P3).
使用相对于前一点P3的垂直距离的Y值。