Introduction
Purpose : Create and modify 3D Flexible pipe
Availability : 25xFD02
- EKL for Flexible Pipe/Duct
- Add 3D Point , Get Node Type, Remove Node, Get/Set Build Algorithm, wGet/Set Build Mode, Get/Set Global Slack, Get/Set Length, Get/Set Minimum Bend Radius, Get/Set Local Slice Mode, Get/Set Local Slice Value, Update existing flexible pipe properties from a raw material or reference flexible pipe
- EKL for Rigid Pipe / duct / tray
- Update existing Rigid pipe properties from a raw material.
Examples
Add 3d points in flexible route
- input parameter : FlexiblePipeRef -> Piping_Flexible_Pipe
let pBody(BodyFeature) let pPoint(Point) let NewPoint(Point) let pGSMPoint(GSMPoint) let pGSMPointCoord(GSMPointCoord) let ListPoints(list) let pPointType(PointType) let NodeIndex(Integer) let retCode(Integer) let Validation(Boolean) Validation = false if(NULL <> FlexiblePipeRef) { //Add3DPoint // create point pBody = FlexiblePipeRef ->Find ("BodyFeature","",TRUE) if (NULL <> pBody) { Trace (1, " Body retrieves : ",pBody.Name) SetWorkingContext(pBody) // Point_Test1 NewPoint = new("Point", "Point_Test1", pBody) pPointType = "Coordinates" set pGSMPoint = NewPoint if (NULL <> pGSMPoint) { pGSMPoint.PointType = pPointType set pGSMPointCoord = pGSMPoint pGSMPointCoord.X = 100mm pGSMPointCoord.Y = 200mm pGSMPointCoord.Z = 300mm pGSMPointCoord.Update() } Trace (1, " Body retrieves : ",NewPoint.Name) ListPoints.Append(pGSMPoint) //Point_Test2 NewPoint = new("Point", "Point_Test2", pBody) pPointType = "Coordinates" set pGSMPoint = NewPoint if (NULL <> pGSMPoint) { pGSMPoint.PointType = pPointType set pGSMPointCoord = pGSMPoint pGSMPointCoord.X = 100mm pGSMPointCoord.Y = 300mm pGSMPointCoord.Z = 300mm pGSMPointCoord.Update() } Trace(1, " Body retrieves : ",NewPoint.Name) ListPoints.Append(pGSMPoint) set NodeIndex = 0 set retCode = FlexiblePipeRef.Add3DPoint (ListPoints, NodeIndex) if(0 == retCode) { Validation = true Trace (1, "======Add3DPoint done successfullyh=======") } else { Validation = false Trace (1, "======Add3DPoint FAILED=======") } } }
Find node point type pipe and remove node point of flexible pipe
- input parameter : FlexiblePipeRef -> Piping_Flexible_Pipe
let NodeType(PipingNodeType) let NodeIndex(Integer) let NodeIndexToRemove(Integer) let ListNodeIndexToRemove(List) let oReferenceBendRadius(Length) NodeIndex = 2 if(NULL <> FlexiblePipeRef) { // Get Node Type FlexiblePipeRef -> GetNodeType(NodeIndex, NodeType) Message ("Node 2 Type:", NodeType) // Remove Nodes NodeIndexToRemove = 2 ListNodeIndexToRemove.Append(NodeIndexToRemove) NodeIndexToRemove = 3 ListNodeIndexToRemove.Append(NodeIndexToRemove) FlexiblePipeRef -> RemoveNode(ListNodeIndexToRemove) Message ("Removed Nodes:", ListNodeIndexToRemove) }
Find build algorithm and build mode for flexible pipe and also user should set/change build algorithm and build mode for flexible pipe.
- input parameter : FlexiblePipeRef -> Piping_Flexible_Pipe
let iBuildAlgo(CATEbm_BranchTypeEnum) let oBuildAlgo(CATEbm_BranchTypeEnum) let iBuildMode(CATEbm_FlexBuildModeEnum) let oBuildMode(CATEbm_FlexBuildModeEnum) if(NULL <> FlexiblePipeRef) { // Build Algorithm // Set Build Algorithm iBuildAlgo = "CATEbm_FlexCurveFLX" FlexiblePipeRef -> SetBuildAlgorithm(iBuildAlgo) Message ("Set Build Algorithm: ", iBuildAlgo) // Get Build Algorithm FlexiblePipeRef -> GetBuildAlgorithm(oBuildAlgo) Message ("Get Build Algorithm: ", oBuildAlgo) // Build Mode // Set Build Mode iBuildMode = "CATEbm_BMLength" FlexiblePipeRef->SetBuildMode(iBuildMode) Message ("Set Build Mode: ", iBuildMode) // Get Build Mode FlexiblePipeRef->GetBuildMode(oBuildMode) Message ("Get Build Mode: ", oBuildMode) }
Set and get of global slack for flexible pipe
- input parameter : FlexiblePipeRef -> Piping_Flexible_Pipe
let iGlobalSlack(Real) let oGlobalSlack(Real) if(NULL <> FlexiblePipeRef) { // Global Slack // Get Global Slack FlexiblePipeRef -> GetGlobalSlack(oGlobalSlack) Message ("Get Global Slack: ", oGlobalSlack) // Set Global Slack set iGlobalSlack = 10 FlexiblePipeRef -> SetGlobalSlack(iGlobalSlack) Message ("Set Global Slack: ", iGlobalSlack) }
Set and get of length for flexible pipe
- input parameter : FlexiblePipeRef -> Piping_Flexible_Pipe
let iLength(Length) let oLength(Length) if(NULL <> FlexiblePipeRef) { // Length // Get Length FlexiblePipeRef -> GetLength(oLength) Message ("Get Length: ", oLength) // Set Length set iLength = 2000mm FlexiblePipeRef -> SetLength(iLength) Message ("Set Length: ", iLength) }
set and get of minimum bend radius for flexible pipe
- input parameter : FlexiblePipeRef -> Piping_Flexible_Pipe
let iMinBendRadius(Length) let oMinBendRadius(Length) if(NULL <> FlexiblePipeRef) { // Minimun Bend Radius // Get Minimun Bend Radius FlexiblePipeRef -> GetMinimumBendRadius(oMinBendRadius) Message ("Get Length: ", oMinBendRadius) // Set Minimun Bend Radius set iMinBendRadius = 20mm FlexiblePipeRef -> SetMinimumBendRadius(iMinBendRadius) Message ("Set Length: ", iMinBendRadius) }
set and get of local slice mode for flexible pipe
- input parameter : FlexiblePipeRef -> Piping_Flexible_Pipe
let iLocalSliceMode(CATEbm_SlackAndLengthModeEnum) let oLocalSliceMode(CATEbm_SlackAndLengthModeEnum) let Index(Integer) set Index = 2 if(NULL <> FlexiblePipeRef) { // Local Slice Mode // Get Local Slice Mode FlexiblePipeRef -> GetLocalSliceMode(Index, oLocalSliceMode) Message ("Get Length: ", oLocalSliceMode) // Set Local Slice Mode iLocalSliceMode = "IgnoreSlack" FlexiblePipeRef -> SetLocalSliceMode(Index, iLocalSliceMode) Message ("Set Length: ", iLocalSliceMode) }
set and get of local slice value for flexible pipe
- input parameter : FlexiblePipeRef -> Piping_Flexible_Pipe
let iLocalSliceValue(Length) let oLocalSliceValue(Length) let Index(Integer) set Index = 2 if(NULL <> FlexiblePipeRef) { // Local Slice Value // Get Local Slice Value FlexiblePipeRef -> GetLocalSliceValue(Index, oLocalSliceValue) Message ("Get Length: ", oLocalSliceValue) // Set Local Slice Value iLocalSliceValue = 100mm FlexiblePipeRef -> SetLocalSliceValue(Index, iLocalSliceValue) Message ("Set Length: ", iLocalSliceValue) }
Update existing flexible route properties from a raw material or flexible reference route.
- A link is created between pipe and raw material and material name is copied from raw material to pipe.Explain the objectives of this test.
- input parameter : FlexiblePipeRef -> Piping_Flexible_Pipe
- Update existing flexible route properties from reference flexible route
// Update existing flexible route properties from reference flexible route let retCode(Integer) let ExistingPipeInst(Piping_Flexible_Pipe_Inst) let ExistingPipeRef(Piping_Flexible_Pipe) let ExistingPipeVPMRef(VPMReference) let PipeInst(Piping_Flexible_Pipe_Inst) // Step 1 : Retrieve the Flexible pipe Reference set ExistingPipeInst = ReferenceRigidPipeInst set PipeInst = TargetRigidPipeInst if(NULL <> ExistingPipeInst) { set ExistingPipeRef= ExistingPipeInst.Reference } if(NULL <> PipeInst AND NULL <> ExistingPipeRef) { // Step 2 : SetNewRefrence // Existing Reference sent set ExistingPipeVPMRef = ExistingPipeRef if(NULL <> ExistingPipeVPMRef) { set retCode = PipeInst.SetNewReference(ExistingPipeVPMRef) if(0 == retCode) { Message ("Set New Reference: ", PipeInst.Name) } } }
Update existing flexible route properties from raw material
//Update existing flexible route properties from raw material let retCode(Integer) let PipeInst(Piping_Flexible_Pipe_Inst) let RawMaterial(Raw_Material_PipeTube) let myQuery(PLMQuery) let results(List) let currentResult(PLMQueryResult) let RawMaterialVPMReference(VPMReference) // Step 1 : Retrive Raw Material from database myQuery = CreatePLMQuery("Raw_Material_PipeTube") myQuery->AddCriterion("V_Name","Rigid Raw Material PipeTube") results = myQuery->RunQuery() currentResult = results[1] if(currentResult<>NULL) { set RawMaterial = currentResult->LoadResult() set RawMaterialVPMReference = RawMaterial } PipeInst = TargetFlexiblePipeInst if(NULL <> PipeInst AND NULL <> RawMaterialVPMReference) { // Step 2 : Set New Reference // Existing Reference sent set retCode = PipeInst.SetNewReference(RawMaterialVPMReference) if(0 == retCode) { Message("Set New Reference :", PipeInst.Name) } }