General InformationThe table below provides the information related to the definition of the Opening ID:
Input ObjectsInput object must be of the following type:
Context Object Parameters
Note:
The Geometry may be feature ( Point/Line/Plane) if explicit feature ( visible in part
specification tree ) or Topology type ( CATVextex/CATEdge/CATFace) if solid or surface sub
elements have been used to define the connection point.
Sample 1The following sample explains how to compute axis system from advanced publication geometry.
/* factype = Feature*/
Notify("BR : ELB_ComputeAxisSystemForPublicationMigration")
Parameters->SetAttributeInteger("Severity",2)
let ElecPub(ElecPort)
set ElecPub = Parameters->GetAttributeObject("PublicationToMigrate")
if ( NULL == ElecPub ) { Notify (" Publication is null KO !! " )
Parameters.Message ="publication object is unset"
exit }
else { Notify ("Publication to migrate : ",ElecPub.V_FunctionalName) }
let Contact(Feature)
let Coincidence(Feature)
let Orientation(Feature)
// get contact point feature
set Contact=Parameters->GetAttributeObject("ContactGeometry")
if ( NULL == Contact ){ Parameters.Message ="contact feature is unset for "+ElecPub.V_FunctionalName exit }
// get coincidence line feature
set Coincidence=Parameters->GetAttributeObject("CoincidenceGeometry")
if ( NULL == Coincidence ){ Parameters.Message ="coincidence feature is unset for "+ElecPub.V_FunctionalName exit }
// get orientation edge feature
set Orientation=Parameters->GetAttributeObject( "OrientationGeometry" )
if ( NULL == Orientation ){ Parameters.Message ="orientation feature is unset for "+ElecPub.V_FunctionalName exit }
let ComputedAxis(Matrix)
set ComputedAxis=Parameters->GetAttributeObject( "ComputedAxisSystem" )
if ( NULL == ComputedAxis ){ Parameters.Message ="axis system matrix cannot be retrieved" exit }
// compute I axis from : normal direction of plane defined by coincidence line and orientation edge
let DIR(Direction)
// contact geometry
Notify(" +contact : ",Contact.Name)
Notify(" type : ",Contact.ModelerType.Name)
let P1(Point)
let X1(LENGTH)
let Y1(LENGTH)
let Z1(LENGTH)
let P2(Point)
let X2(LENGTH)
let Y2(LENGTH)
let Z2(LENGTH)
let norme(Real)
let Vx(LENGTH)
let Vy(LENGTH)
let Vz(LENGTH)
// compute direction of coincidence line
let V_coincidence(Vector)
Notify(" +coincidence : ",Coincidence.Name)
Notify(" type : ",Coincidence.ModelerType.Name)
let CoincidenceLine(GSMLinePtPt)
set CoincidenceLine = Coincidence
if ( CoincidenceLine == NULL ) Notify (" Line coincidence KO !! " )
else
{
set P1 = CoincidenceLine.FirstPoint
X1 =P1.coord(1)
Y1 =P1.coord(2)
Z1 =P1.coord(3)
set P2 = CoincidenceLine.SecondPoint
X2 =P2.coord(1)
Y2 =P2.coord(2)
Z2 =P2.coord(3)
Vx =(X2-X1)
Vy=(Y2-Y1)
Vz=(Z2-Z1)
V_coincidence = [ Vx,Vy,Vz]
norme = V_coincidence.Norm()
V_coincidence = [ Vx/norme,Vy/norme,Vz/norme ]
Notify(" coincidence vector : ",V_coincidence.Get(1,1)," ",V_coincidence.Get(1,2)," ",V_coincidence.Get(1,3))
}
// compute direction of orientation edge
let V_orientation(Vector)
Notify(" +orientation : ",Orientation.Name)
Notify(" type : ",Orientation.ModelerType.Name)
let OrientationLine(GSMLinePtPt)
set OrientationLine = Orientation
if ( OrientationLine == NULL ) Notify (" orientation KO !! " )
else
{
set P1 = OrientationLine.FirstPoint
X1 =P1.coord(1)
Y1 =P1.coord(2)
Z1 =P1.coord(3)
set P2 = OrientationLine.SecondPoint
X2 =P2.coord(1)
Y2 =P2.coord(2)
Z2 =P2.coord(3)
Notify(" P1 : ", X1," ",Y1," ",Z1)
Notify(" P2 : ", X2," ",Y2," ",Z2)
Vx =(X2-X1)
Vy=(Y2-Y1)
Vz=(Z2-Z1)
V_orientation = [ Vx,Vy,Vz]
norme = V_orientation.Norm()
V_orientation = [ Vx/norme,Vy/norme,Vz/norme ]
Notify(" orientation vector : ",V_orientation.Get(1,1)," ",V_orientation.Get(1,2)," ",V_orientation.Get(1,3))
}
// compute new coincidence vector
let V_New_Coincidence(Vector)
V_New_Coincidence=CrossProduct(V_coincidence,V_orientation)
Notify(" new coincidence vector : ",V_New_Coincidence.Get(1,1)," ",V_New_Coincidence.Get(1,2)," ",V_New_Coincidence.Get(1,3))
// keep orientation vector
// compute K vector for axis system
let V_New_VectorK(Vector)
V_New_VectorK = CrossProduct(V_New_Coincidence,V_orientation)
// set new vectors to axis system matrix
ComputedAxis.Set(1,1,V_New_Coincidence.Get(1,1))
ComputedAxis.Set(2,1,V_New_Coincidence.Get(1,2))
ComputedAxis.Set(3,1,V_New_Coincidence.Get(1,3))
ComputedAxis.Set(1,3,V_New_VectorK.Get(1,1))
ComputedAxis.Set(2,3,V_New_VectorK.Get(1,2))
ComputedAxis.Set(3,3,V_New_VectorK.Get(1,3))
Parameters->SetAttributeObject( "CustomizedAxisSystem",ComputedAxis)
Parameters->SetAttributeInteger("Severity",0)
| |||||||||||||||||||||||||||||||||||||