PipeTube_Physical Functions

PipeTube_Physical Functions

This page discusses:

PLMEnsRefEquipment.CreatePipingPort()

Lets you create piping/tubing ports.

Signature

PLMEnsRefEquipment.CreatePipingPort(X_OriginPt : Real, Y_OriginPt : Real, Z_OriginPt : Real, X_AlignDir : Real, Y_AlignDir : Real, Z_AlignDir : Real, X_OrientDir : Real, Y_OrientDir : Real, Z_OrientDir : Real, PortType : PipingPort_Types, PortName : String, X_OffsetPoint : Real [, Y_OffsetPoint : Real, Z_OffsetPoint : Real]) : Piping_Port

Arguments

Name Input/Output Required? Type Comment
X_OriginPt In Real Defines the center point of the port: X coordinate
Y_OriginPt In Real Defines the center point of the port: Y coordinate
Z_OriginPt In Real Defines the center point of the port: Z coordinate
X_AlignDir In Real Defines the alignment direction: X coordinate
Y_AlignDir In Real Defines the alignment direction: Y coordinate
Z_AlignDir In Real Defines the alignment direction: Z coordinate
X_OrientDir In Real Defines the orientation direction: X coordinate
Y_OrientDir In Real Defines the orientation direction: Y coordinate
Z_OrientDir In Real Defines the orientation direction: Z coordinate
PortType In PipingPort_Types Defines the type of the port from the predefined list in PipingPort_Types
PortName In String Defines the name of the port
X_OffsetPoint In Real If the port type is two points part or hole port, you must define the offset from the center of the port
Y_OffsetPoint In Real -
Z_OffsetPoint In Real -

ReturnType

Piping_Port

Example

/*To create a two point hole port on piping part*/

prd is Piping_Part 

let X_OPt(Real)
let Y_OPt(Real)
let Z_OPt(Real)
X_OPt=0
Y_OPt=0
Z_OPt=0
 
let X_alignDir(Real)
let Y_alignDir(Real)
let Z_alignDir(Real)
X_alignDir=0
Y_alignDir=0
Z_alignDir=2
 
let X_orientDir(Real)
let Y_orientDir(Real)
let Z_orientDir(Real)
X_orientDir=0
Y_orientDir=2
Z_orientDir=0

let X_offsetpt(Real)
let Y_offsetpt(Real)
let Z_offsetpt(Real)
X_offsetpt=2
Y_offsetpt=0
Z_offsetpt=0
 
let porttype(PipingPort_Types)
porttype= "CATPip2HolePort"

let portName(String)
portName = "test1"
 
let port(Piping_Port)
 
Message("CreatePipingPortCalled")
 
port = prd. CreatePipingPort(X_OPt, Y_OPt, Z_OPt, X_alignDir, Y_alignDir, Z_alignDir, X_orientDir, Y_orientDir, Z_orientDir, porttype,
portName, X_offsetpt,Y_offsetpt,Z_offsetpt)

Piping_Flexible_Pipe.GetColor()

Lets you retrieve the color of the flexible pipe/tube from the geometrical feature.

Signature

Piping_Flexible_Pipe.GetColor(oRed : Integer, oGreen : Integer, oBlue : Integer)

Arguments

Name Input/Output Required? Type Comment
oRed Out Integer Value between 0 and 255
oGreen Out Integer Value between 0 and 255
oBlue Out Integer Value between 0 and 255

Example

let Red(Integer)
let Green(Integer)
let Blue(Integer)
Red = 120
Green =180
Blue = 255
let R(Integer)
let G(Integer)
let B(Integer)

Message("SetColor Called")

prd.SetColor(Red, Green, Blue)

Message("GetColor Called")

prd.GetColor(R, G, B)

if(  ( Red == R) and (Green == G) and  ( Blue == B) )
{
	Message("color set and get are equal ")
	Message("color set ", Red ,Green , Blue)
	Message("colorGet" ,R ,G , B)	
}
else
{
	Message("set color is different from get color  ")
}

Piping_Flexible_Pipe.GetOpacity()

Lets you retrieve the opacity of the flexible pipe/tube from the geometrical feature.

Signature

Piping_Flexible_Pipe.GetOpacity(oOpacity : Integer)

Arguments

Name Input/Output Required? Type Comment
oOpacity Out Integer -

Piping_Flexible_Pipe.SetColor()

Lets you set the color on the flexible pipe/tube from the geometrical feature.

Signature

Piping_Flexible_Pipe.SetColor(iRed : Integer, iGreen : Integer, iBlue : Integer)

Arguments

Name Input/Output Required? Type Comment
iRed In Integer Value between 0 and 255
iGreen In Integer Value between 0 and 255
iBlue In Integer Value between 0 and 255

Example

let Red(Integer)
let Green(Integer)
let Blue(Integer)
Red = 120
Green =180
Blue = 255
let R(Integer)
let G(Integer)
let B(Integer)

Message("SetColor Called")

prd.SetColor(Red, Green, Blue)

Message("GetColor Called")

prd.GetColor(R, G, B)

if(  ( Red == R) and (Green == G) and  ( Blue == B) )
{
	Message("color set and get are equal ")
	Message("color set ", Red ,Green , Blue)
	Message("colorGet" ,R ,G , B)	
}
else
{
	Message("set color is different from get color  ")
}

Piping_Flexible_Pipe.SetOpacity()

Lets you set the opacity on the flexible pipe/tube from the geometrical feature.

Signature

Piping_Flexible_Pipe.SetOpacity(iOpacity : Integer)

Arguments

Name Input/Output Required? Type Comment
iOpacity In Integer -

Piping_Insulation.GetColor()

Lets you retrieve the color of the insulation from the geometrical feature.

Signature

Piping_Insulation.GetColor(oRed : Integer, oGreen : Integer, oBlue : Integer)

Arguments

Name Input/Output Required? Type Comment
oRed Out Integer Value between 0 and 255
oGreen Out Integer Value between 0 and 255
oBlue Out Integer Value between 0 and 255

Example

let Red(Integer)
let Green(Integer)
let Blue(Integer)
Red = 120
Green =180
Blue = 255
let R(Integer)
let G(Integer)
let B(Integer)

Message("SetColor Called")

prd.SetColor(Red, Green, Blue)

Message("GetColor Called")

prd.GetColor(R, G, B)

if(  ( Red == R) and (Green == G) and  ( Blue == B) )
{
	Message("color set and get are equal ")
	Message("color set ", Red ,Green , Blue)
	Message("colorGet" ,R ,G , B)	
}
else
{
	Message("set color is different from get color  ")
}

Piping_Insulation.GetOpacity()

Lets you retrieve the opacity of the insulation from the geometrical feature.

Signature

Piping_Insulation.GetOpacity(oOpacity : Integer)

Arguments

Name Input/Output Required? Type Comment
oOpacity Out Integer -

Piping_Insulation.SetColor()

Lets you set the color on the insulation from the geometrical feature.

Signature

Piping_Insulation.SetColor(iRed : Integer, iGreen : Integer, iBlue : Integer)

Arguments

Name Input/Output Required? Type Comment
iRed In Integer Value between 0 and 255
iGreen In Integer Value between 0 and 255
iBlue In Integer Value between 0 and 255

Example

let Red(Integer)
let Green(Integer)
let Blue(Integer)
Red = 120
Green =180
Blue = 255
let R(Integer)
let G(Integer)
let B(Integer)

Message("SetColor Called")

prd.SetColor(Red, Green, Blue)

Message("GetColor Called")

prd.GetColor(R, G, B)

if(  ( Red == R) and (Green == G) and  ( Blue == B) )
{
	Message("color set and get are equal ")
	Message("color set ", Red ,Green , Blue)
	Message("colorGet" ,R ,G , B)	
}
else
{
	Message("set color is different from get color  ")
}

Piping_Insulation.SetOpacity()

Lets you set the opacity on the insulation from the geometrical feature.

Signature

Piping_Insulation.SetOpacity(iOpacity : Integer)

Arguments

Name Input/Output Required? Type Comment
iOpacity In Integer -

Piping_Part.CreatePipingPort()

Lets you create piping/tubing ports.

Signature

Piping_Part.CreatePipingPort(X_OriginPt : Real, Y_OriginPt : Real, Z_OriginPt : Real, X_AlignDir : Real, Y_AlignDir : Real, Z_AlignDir : Real, X_OrientDir : Real, Y_OrientDir : Real, Z_OrientDir : Real, PortType : PipingPort_Types, PortName : String, X_OffsetPoint : Real [, Y_OffsetPoint : Real, Z_OffsetPoint : Real]) : PipingPort

Arguments

Name Input/Output Required? Type Comment
X_OriginPt In Real Defines the center point of the port: X coordinate
Y_OriginPt In Real Defines the center point of the port: Y coordinate
Z_OriginPt In Real Defines the center point of the port: Z coordinate
X_AlignDir In Real Defines the alignment direction: X coordinate
Y_AlignDir In Real Defines the alignment direction: Y coordinate
Z_AlignDir In Real Defines the alignment direction: Z coordinate
X_OrientDir In Real Defines the orientation direction: X coordinate
Y_OrientDir In Real Defines the orientation direction: Y coordinate
Z_OrientDir In Real Defines the orientation direction: Z coordinate
PortType In PipingPort_Types Defines the type of the port from the predefined list in PipingPort_Types
PortName In String Defines the name of the port
X_OffsetPoint In Real If the port type is two points part or hole port, you must define the offset from the center of the port
Y_OffsetPoint In Real -
Z_OffsetPoint In Real -

ReturnType

Piping_Port

Example

/*To create a two point hole port on piping part*/

prd is Piping_Part 

let X_OPt(Real)
let Y_OPt(Real)
let Z_OPt(Real)
X_OPt=0
Y_OPt=0
Z_OPt=0
 
let X_alignDir(Real)
let Y_alignDir(Real)
let Z_alignDir(Real)
X_alignDir=0
Y_alignDir=0
Z_alignDir=2
 
let X_orientDir(Real)
let Y_orientDir(Real)
let Z_orientDir(Real)
X_orientDir=0
Y_orientDir=2
Z_orientDir=0

let X_offsetpt(Real)
let Y_offsetpt(Real)
let Z_offsetpt(Real)
X_offsetpt=2
Y_offsetpt=0
Z_offsetpt=0
 
let porttype(PipingPort_Types)
porttype= "CATPip2HolePort"

let portName(String)
portName = "test1"
 
let port(Piping_Port)
 
Message("CreatePipingPortCalled")
 
port = prd. CreatePipingPort(X_OPt, Y_OPt, Z_OPt, X_alignDir, Y_alignDir, Z_alignDir, X_orientDir, Y_orientDir, Z_orientDir, porttype,
portName, X_offsetpt,Y_offsetpt,Z_offsetpt)

Piping_PipeXPort.CheckCompatibility()

Piping_PipeXPort.CheckCompatibility()

Signature

Piping_PipeXPort.CheckCompatibility(Port Owner Occurrence : ProductOccurrence, Second Port : VPMPort, Second Port Owner Occurrence : ProductOccurrence, Use Only Compatibility Rule Table : Boolean, List of Additional Specifications : List, Parameters whose check failed : List) : Integer

Arguments

Name Input/Output Required? Type Comment
Port Owner Occurrence In ProductOccurrence -
Second Port In VPMPort -
Second Port Owner Occurrence In ProductOccurrence -
Use Only Compatibility Rule Table In Boolean -
List of Additional Specifications In List -
Parameters whose check failed Out List -

ReturnType

Integer

Piping_PipeXPort.SetPortAttributeString()

Piping_PipeXPort.SetPortAttributeString()

Signature

Piping_PipeXPort.SetPortAttributeString(AttrName : String, AttrValue : String)

Arguments

Name Input/Output Required? Type Comment
AttrName In String -
AttrValue In String -

Piping_Port.CheckCompatibility()

Signature

Piping_Port.CheckCompatibility(Port Owner Occurrence : ProductOccurrence, Second Port : VPMPort, Second Port Owner Occurrence : ProductOccurrence, Use Only Compatibility Rule Table : Boolean, List of Additional Specifications : List, Parameters whose check failed : List) : Integer

Arguments

Name Input/Output Required? Type Comment
Port Owner Occurrence In ProductOccurrence -
Second Port In VPMPort -
Second Port Owner Occurrence In ProductOccurrence -
Use Only Compatibility Rule Table In Boolean -
List of Additional Specifications In List -
Parameters whose check failed Out List -

ReturnType

Integer

Piping_Port.SetPortAttributeReal()

Lets you modify the port attribute when its type is real.

Signature

Piping_Port.SetPortAttributeReal(AttrName : String, AttrValue : Real)

Arguments

Name Input/Output Required? Type Comment
AttrName In String Name of the attribute you want to modify
AttrValue In Real New value you want to set on this attribute

Piping_Port.SetPortAttributeString()

Lets you modify the port attribute when its type is string.

Signature

Piping_Port.SetPortAttributeString(AttrName : String, AttrValue : String)

Arguments

Name Input/Output Required? Type Comment
AttrName In String Name of the attribute you want to modify
AttrValue In String New value you want to set on this attribute

Piping_Rigid_Pipe.Add3DPoint()

Lets you add a list of points.

Signature

Piping_Rigid_Pipe.Add3DPoint(iListPoint : List, iIndex : Integer) : Integer

Arguments

Name Input/Output Required? Type Comment
iListPoint In List List of the GSM point coordinates
iIndex In Integer Points are adding after this input Index. If you want to add a point before the first index, the value must be "0".

ReturnType

Integer

Piping_Rigid_Pipe.GetColor()

Lets you retrieve the color of the rigid pipe/tube from the geometrical feature.

Signature

Piping_Rigid_Pipe.GetColor(oRed : Integer, oGreen : Integer, oBlue : Integer)

Arguments

Name Input/Output Required? Type Comment
oRed Out Integer Value between 0 and 255
oGreen Out Integer Value between 0 and 255
oBlue Out Integer Value between 0 and 255

Example

let Red(Integer)
let Green(Integer)
let Blue(Integer)
Red = 120
Green =180
Blue = 255
let R(Integer)
let G(Integer)
let B(Integer)

Message("SetColor Called")

prd.SetColor(Red, Green, Blue)

Message("GetColor Called")

prd.GetColor(R, G, B)

if(  ( Red == R) and (Green == G) and  ( Blue == B) )
{
	Message("color set and get are equal ")
	Message("color set ", Red ,Green , Blue)
	Message("colorGet" ,R ,G , B)	
}
else
{
	Message("set color is different from get color  ")
}

Piping_Rigid_Pipe.GetDefaultBendRadius()

Signature

Piping_Rigid_Pipe.GetDefaultBendRadius(oDefaultBendRadius : LENGTH)

Arguments

Name Input/Output Required? Type Comment
oDefaultBendRadius Out LENGTH Default bend radius value existing on the current route.

Piping_Rigid_Pipe.GetMinimunStraightLength()

Signature

Piping_Rigid_Pipe.GetMinimunStraightLength(oMinimumStraightLength : LENGTH)

Arguments

Name Input/Output Required? Type Comment
oMinimumStraightLength Out LENGTH Minimum straight length value on the route.

Piping_Rigid_Pipe.GetNodeBendRadius()

Signature

Piping_Rigid_Pipe.GetNodeBendRadius(iIndex : Integer, oRadius : LENGTH)

Arguments

Name Input/Output Required? Type Comment
iIndex In Integer Node index at which user needs a bend radius.
oRadius Out LENGTH Node bend radius value at existing node index.

Piping_Rigid_Pipe.GetNodeType()

Signature

Piping_Rigid_Pipe.GetNodeType(iIndex : Integer, oEnumNodeType : PipingNodeType)

Arguments

Name Input/Output Required? Type Comment
iIndex In Integer -
oEnumNodeType Out PipingNodeType CATPipPortPoint, CATPipDirectionalPoint, CATPipComputedPoint, CATPip3DPoint, CATPipParallelPoint

Piping_Rigid_Pipe.GetOpacity()

Lets you retrieve the opacity of the rigid pipe/tube from the geometrical feature.

Signature

Piping_Rigid_Pipe.GetOpacity(oOpacity : Integer)

Arguments

Name Input/Output Required? Type Comment
oOpacity Out Integer -

Piping_Rigid_Pipe.RemoveNode()

Lets you remove a list of nodes from the reference route.

Signature

Piping_Rigid_Pipe.RemoveNode(iListIndex : List) : Integer

Arguments

Name Input/Output Required? Type Comment
iListIndex In List List of node index positions that need to be removed from the reference route

ReturnType

Integer

Piping_Rigid_Pipe.ResetNodeBendRadiustoDefault()

Signature

Piping_Rigid_Pipe.ResetNodeBendRadiustoDefault(iIndex : Integer)

Arguments

Name Input/Output Required? Type Comment
iIndex In Integer Node index at which user resets the bend radius to default bend radius. If you want to reset the node bend radius on all the nodes of the route, set the input node index at 0.

Piping_Rigid_Pipe.SetColor()

Lets you set the color on the rigid pipe/tube from the geometrical feature.

Signature

Piping_Rigid_Pipe.SetColor(iRed : Integer, iGreen : Integer, iBlue : Integer)

Arguments

Name Input/Output Required? Type Comment
iRed In Integer Value between 0 and 255
iGreen In Integer Value between 0 and 255
iBlue In Integer Value between 0 and 255

Example

let Red(Integer)
let Green(Integer)
let Blue(Integer)
Red = 120
Green =180
Blue = 255
let R(Integer)
let G(Integer)
let B(Integer)

Message("SetColor Called")

prd.SetColor(Red, Green, Blue)

Message("GetColor Called")

prd.GetColor(R, G, B)

if(  ( Red == R) and (Green == G) and  ( Blue == B) )
{
	Message("color set and get are equal ")
	Message("color set ", Red ,Green , Blue)
	Message("colorGet" ,R ,G , B)	
}
else
{
	Message("set color is different from get color  ")
}

Piping_Rigid_Pipe.SetDefaultBendRadius()

Signature

Piping_Rigid_Pipe.SetDefaultBendRadius(iDefaultBendRadius : LENGTH) : Integer

Arguments

Name Input/Output Required? Type Comment
iDefaultBendRadius In LENGTH Default bend radius value.

ReturnType

Integer

Piping_Rigid_Pipe.SetMinimunStraightLength()

Signature

Piping_Rigid_Pipe.SetMinimunStraightLength(iMinimunStraightLength : LENGTH)

Arguments

Name Input/Output Required? Type Comment
iMinimunStraightLength In LENGTH Minimum straight length value on the route.

Piping_Rigid_Pipe.SetNodeBendRadius()

Signature

Piping_Rigid_Pipe.SetNodeBendRadius(iIndex : Integer, iRadius : LENGTH) : Integer

Arguments

Name Input/Output Required? Type Comment
iIndex In Integer Node index at which user needs to set a bend radius.
iRadius In LENGTH Node bend radius value at existing node index.

ReturnType

Integer

Piping_Rigid_Pipe.SetOpacity()

Lets you set the opacity on the rigid pipe/tube from the geometrical feature.

Signature

Piping_Rigid_Pipe.SetOpacity(iOpacity : Integer)

Arguments

Name Input/Output Required? Type Comment
iOpacity In Integer -

Piping_Rigid_Pipe_Inst.PropagateReferenceToGeometry()

Launches PLM Update to propagate attribute, apply and update geometry as per the shape and launch geometrical update. If any geometrical error appears, then this method will try to correct the issue and for some issues, it returns the error.

Signature

Piping_Rigid_Pipe_Inst.PropagateReferenceToGeometry() : Integer

ReturnType

Integer

Important Note

Regarding the following functions:

  • Add3Point()
  • RemoveNode()
  • GetNodeType()
  • SetDefaultBendRadius()
  • GetDefaultBendRadius()
  • SetNodeBendRadius()
  • GetNodeBendRadius()
  • ResetNodeBendRadiustoDefault()
  • SetMinimumStraightLength()
  • GetMinimumStraightLength()
  • PropagateReferenceToGeometry()
  • SetNewReference()

If you call thiese functions, then only PLM attributes will be updated, but it will not update the geometry, then it may cause or not check build break in the geometry. After having completed all the modified routes functionality by calling these functions, its user responsability to call the PropagateReferenceToGeometry() function at the end to update the geometry. This function will correct bad values internally if it cause some build break or other bad issues.

Piping_Rigid_Pipe_Inst.SetNewReference()

Signature

Piping_Rigid_Pipe_Inst.SetNewReference(VPMReference : VPMReference) : Integer

Arguments

Name Input/Output Required? Type Comment
VPMReference In VPMReference VPMReference of the route filtered from the Data Setup or provided by the user as input from which attributes need to be copied.

If input VPMReference is not NULL, then:

  • NewFrom -> Reuse or,
  • NewFrom -> ReuseorNewReference or
  • NewFrom -> NewReference

If input VPMReference is NULL, then NewFrom -> NewReference

ReturnType

Integer

SharedEquipmentPart.CreatePipingPort()

Lets you create piping/tubing ports.

Signature

SharedEquipmentPart.CreatePipingPort(X_OriginPt : Real, Y_OriginPt : Real, Z_OriginPt : Real, X_AlignDir : Real, Y_AlignDir : Real, Z_AlignDir : Real, X_OrientDir : Real, Y_OrientDir : Real, Z_OrientDir : Real, PortType : PipingPort_Types, PortName : String, X_OffsetPoint : Real [, Y_OffsetPoint : Real, Z_OffsetPoint : Real]) : Piping_Port

Arguments

Name Input/Output Required? Type Comment
X_OriginPt In Real Defines the center point of the port: X coordinate
Y_OriginPt In Real Defines the center point of the port: Y coordinate
Z_OriginPt In Real Defines the center point of the port: Z coordinate
X_AlignDir In Real Defines the alignment direction: X coordinate
Y_AlignDir In Real Defines the alignment direction: Y coordinate
Z_AlignDir In Real Defines the alignment direction: Z coordinate
X_OrientDir In Real Defines the orientation direction: X coordinate
Y_OrientDir In Real Defines the orientation direction: Y coordinate
Z_OrientDir In Real Defines the orientation direction: Z coordinate
PortType In PipingPort_Types Defines the type of the port from the predefined list in PipingPort_Types
PortName In String Defines the name of the port
X_OffsetPoint In Real If the port type is two points part or hole port, you must define the offset from the center of the port
Y_OffsetPoint In Real -
Z_OffsetPoint In Real -

ReturnType

Piping_Port

Example

/*To create a two point hole port on piping part*/

prd is Piping_Part 

let X_OPt(Real)
let Y_OPt(Real)
let Z_OPt(Real)
X_OPt=0
Y_OPt=0
Z_OPt=0
 
let X_alignDir(Real)
let Y_alignDir(Real)
let Z_alignDir(Real)
X_alignDir=0
Y_alignDir=0
Z_alignDir=2
 
let X_orientDir(Real)
let Y_orientDir(Real)
let Z_orientDir(Real)
X_orientDir=0
Y_orientDir=2
Z_orientDir=0

let X_offsetpt(Real)
let Y_offsetpt(Real)
let Z_offsetpt(Real)
X_offsetpt=2
Y_offsetpt=0
Z_offsetpt=0
 
let porttype(PipingPort_Types)
porttype= "CATPip2HolePort"

let portName(String)
portName = "test1"
 
let port(Piping_Port)
 
Message("CreatePipingPortCalled")
 
port = prd. CreatePipingPort(X_OPt, Y_OPt, Z_OPt, X_alignDir, Y_alignDir, Z_alignDir, X_orientDir, Y_orientDir, Z_orientDir, porttype,
portName, X_offsetpt,Y_offsetpt,Z_offsetpt)

VPMPort.CheckCompatibility()

Signature

VPMPort.CheckCompatibility(Port Owner Occurrence : ProductOccurrence, Second Port : VPMPort, Second Port Owner Occurrence : ProductOccurrence, Use Only Compatibility Rule Table : Boolean, List of Additional Specifications : List, Parameters whose check failed : List) : Integer

Arguments

Name Input/Output Required? Type Comment
Port Owner Occurrence In ProductOccurrence -
Second Port In VPMPort -
Second Port Owner Occurrence In ProductOccurrence -
Use Only Compatibility Rule Table In Boolean -
List of Additional Specifications In List -
Parameters whose check failed Out List -

ReturnType

Integer

Example

            

VPMReference.CreatePipingPortOnReference()

Signature

VPMReference.CreatePipingPortOnReference(PortPtOrigin : GSMPoint, AlignDir : Direction, OrientDir : Direction, PortType : PipingPort_Types, PortName : String, OffsetPt : GSMPoint]) : Piping_Port

Arguments

Name Input/Output Required? Type Comment
PortPtOrigin In GSMPoint -
AlignDir In Direction -
OrientDir In Direction -
PortType In PipingPort_Types -
PortName In String -
OffsetPt In GSMPoint -

ReturnType

Piping_Port

Example

let prd(VPMReference)
let pGSMPoint_1(GSMPoint) 
let pGSMPoint_2(GSMPoint)
let pGSMPointCoord(GSMPointCoord)
let DirectionAlign(Direction) 
let DirectionOrient(Direction)
let pPoint(Point)
let pPointOffset(Point)
let pPointType(PointType)
let pBody(BodyFeature)
 
pPointType = "Coordinates"

let NameProduct(String)
NameProduct = prd.Name

if("Physical Product00000002_95E5D97B-0000-1C0C-5E0DB5C000044475" == NameProduct)
{
   pBody = prd->Find ("BodyFeature","",TRUE)
   
   if (NULL <> pBody)
   {
      Trace(1, " Body retrieved : ",pBody.Name)
      let porttype(PipingPort_Types)
      porttype= "CATPipPartPort"
      
	  
	  /* 2 point Part Port, + Offset */
	  /* ============================*/
	  porttype = "CATPip2PartPort"
	  portName = "PIP_Port_20_2pPart_+Offset"
	  
	  SetWorkingContext(pBody)

          let pPipingPort(Piping_Port)

	  pPoint = pBody->Find("Point","x.Name==\"Point_01\"",TRUE) 
          set pGSMPoint_1 = pPoint
		if (NULL <> pGSMPoint_1)
		{
			pGSMPoint_1.PointType = pPointType
			set pGSMPointCoord = pGSMPoint_1
			pGSMPointCoord.X = 0mm
			pGSMPointCoord.Y = 0mm
			pGSMPointCoord.Z = 0mm
			pGSMPointCoord.Update()
		}
	  

	  pPoint = pBody->Find("Point","x.Name==\"Point_02\"",TRUE) 
	  set pGSMPoint_2 = pPoint
	  
                if (NULL <> pGSMPoint_2)
		{
			pGSMPoint_2.PointType = pPointType
			set pGSMPointCoord = pGSMPoint_2
			pGSMPointCoord.X = 100mm
			pGSMPointCoord.Y = 0mm
			pGSMPointCoord.Z = 0mm
			pGSMPointCoord.Update()
		}
	  DirectionAlign = direction(1mm, 0mm, 0mm)
	  DirectionOrient = direction(0mm, 0mm, 1mm)
	  
	  pPipingPort= prd.CreatePipingPortOnReference(pGSMPoint_1, DirectionAlign, DirectionOrient, porttype, portName, pGSMPoint_2)
                if (NULL == pPipingPort)
		{
			Message("Creation FAIL")
		}
	  

	  pBody.Update()
   }  
}