Panel Rerouting Rule

This action rule reroutes inputs of panels, plates, parametric panels, parametric plates, openings on panel, flanges and slots.

This page discusses:

General Information

This action rule is invoked when it is called in the main rerouting rule.

Arguments

Name Type
lvPanelReroutingInputs List

Sample

/* Argument List
lvPanelReroutingInputs : List
*/

/* Contents of lvPanelReroutingInputs list
The order of inputs MUST be respected
iCopySpecification Type = StrStructureCopySpecification // First item of lvPanelReroutingInputs
iSourceObject Type = Feature // Second item of lvPanelReroutingInputs
iResultObject Type = Feature  // Thrid item of lvPanelReroutingInputs
*/

/* About Action
The name of this Action should be 'Panel Rerouting Rule'
This Action should be located under a Related Set named 'Copy Rerouting Rule'
*/

let iCopySpecification(StrStructureCopySpecification)
let iSourceObject(Feature)
let iResultObject(Feature)

let NbrmyInput(Integer)
set NbrmyInput = lvPanelReroutingInputs->Size()
if(NbrmyInput == 3)
{	
	set iCopySpecification = lvPanelReroutingInputs->GetItem(1)
	set iSourceObject = lvPanelReroutingInputs->GetItem(2)
	set iResultObject = lvPanelReroutingInputs->GetItem(3)
}

if(iCopySpecification <> NULL and iSourceObject <> NULL and iResultObject <> NULL)
{
	let DestinationPartFeature(PartFeature)
	let Destination(Feature)
	
	DestinationPartFeature = iResultObject->Find("PartFeature", "", false)
	let ChildrenList1, ChildrenList2, ChildrenList3(List)
	if( NULL <> DestinationPartFeature )
		ChildrenList1 = DestinationPartFeature.Children
	set ChildrenList2 = ChildrenList1->Filter("OpenBodyFeature", "x.Name == \"RuleCopyReferences\"") // a geometrical set for new input objects
	if( 0 < ChildrenList2->Size() )
		set Destination = ChildrenList2->GetItem(1)
	if(Destination == NULL and DestinationPartFeature <> NULL)
		new("OpenBodyFeature", "RuleCopyReferences", DestinationPartFeature)	
	
	let SymmetryPlane, SourcePlaneWF, DestinationPlaneWF(Wireframe)
	let CopyMode(Integer)	
	let TranslateDirection(Direction)
	let TranslateVector(Vector)
	let TranslateDistance(LENGTH)
	let TranslationLine(Line)
	let CopyReferencePlane(List)
	let TransformationCopyMatrix(Matrix)
	
	iCopySpecification->GetReferencePlane(CopyReferencePlane)
	if(CopyReferencePlane.Size() == 1)
	{
		set SymmetryPlane = CopyReferencePlane.GetItem(1)	
		CopyMode = 1
	}
	else if(CopyReferencePlane.Size() == 2)
	{
		set SourcePlaneWF = CopyReferencePlane.GetItem(1)
		set DestinationPlaneWF = CopyReferencePlane.GetItem(2)
		CopyMode = 2
		let SourcePlaneCOG, DestinationPlaneCOG(Point)
		set SourcePlaneCOG = new("Point", "SourcePointCoG", Destination)
		set SourcePlaneCOG = centerofgravity(SourcePlaneWF)
		set DestinationPlaneCOG = new("Point", "DestinationPointCoG", Destination)
		set DestinationPlaneCOG = centerofgravity(DestinationPlaneWF)	
		
		set TranslationLine = new("Line", "TranslationLine", Destination)
		set TranslationLine = line(SourcePlaneCOG, DestinationPlaneCOG)
		TranslateDirection = direction(TranslationLine)
		TranslateDistance = length(TranslationLine)	
		set TranslateVector = TranslateDirection.Vector()
		
		SourcePlaneCOG->Delete()
		DestinationPlaneCOG->Delete()
	}
	
	let SourcePanel(SldPanel)
	let SourcePlate(SldPlate)
	set SourcePanel = iSourceObject
	set SourcePlate = iSourceObject
	if(SourcePanel <> NULL or SourcePlate <> NULL)
	{
		let ResultPanel(SldPanel)
		set ResultPanel = iResultObject
		let ResultPlate(SldPlate)
		set ResultPlate = iResultObject	
		
		let SourceSBPanel(SldSketchBasedPanel)
		set SourceSBPanel = iSourceObject
		let SourceSBPlate(SldSketchBasedPlate)
		set SourceSBPlate = iSourceObject
		
		if((SourceSBPanel <> NULL or SourcePanel <> NULL) and ResultPanel <> NULL ) // For SketchBasedPanel and Panel
		{
			// Reroute Support
			let SourceSupport, NewSupportPlane(Feature)
			SourcePanel->GetSupport(SourceSupport)	
			let SourceThrowOrientation, NewThrowOrientation(Integer)
			SourceThrowOrientation = SourcePanel.ThrowOrientation	
			if(SourceSupport <> NULL)
			{
				let bRetrieved(Boolean)
				bRetrieved = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceSupport, SourceThrowOrientation, NewSupportPlane, NewThrowOrientation)
				if(bRetrieved == TRUE)
				{
					ResultPanel->SetSupport(NewSupportPlane)
					ResultPanel->SetThrowOrientation(NewThrowOrientation)
				}
				else
				{
					let NewSupport(Feature)
					if(CopyMode == 1)
					{
						set NewSupport = new("Surface", SourceSupport.Name + "_" + iCopySpecification.Name, Destination)
						let SourceSupportWireFrame, NewSupportWireFrame(Wireframe)
						set SourceSupportWireFrame = SourceSupport
						set NewSupportWireFrame = symmetry(SourceSupportWireFrame , SymmetryPlane)
						set NewSupport = NewSupportWireFrame			
					}
					else if(CopyMode == 2)
					{
						set NewSupport = new("Surface", SourceSupport.Name + "_" + iCopySpecification.Name, Destination)
						let SourceSupportWireFrame, NewSupportWireFrame(Wireframe)
						set SourceSupportWireFrame = SourceSupport
						let SourcePlane(Plane)
						set SourcePlane = SourcePlaneWF
						
						set NewSupportWireFrame = translate(SourceSupportWireFrame , TranslateDirection, TranslateDistance)
						set NewSupport = NewSupportWireFrame
					}
					if(NewSupport == NULL)
					{
						let CloneStatus(Boolean)
						CloneStatus = iCopySpecification->CreateTransformedObject(SourceSupport, Destination, NewSupport, 1)
						if(CloneStatus == TRUE)
						{
							NewSupport.Name =  SourceSupport.Name + "_" + iCopySpecification.Name
						}
					}				
					if(NewSupport <> NULL)
					{
						ResultPanel->SetSupport(NewSupport)
						NewThrowOrientation = iCopySpecification->ComputeInputOrientation(SourcePanel, SourceSupport, SourceThrowOrientation, NewSupport)
						if(NewThrowOrientation <> 0)
						{
							ResultPanel->SetThrowOrientation(NewThrowOrientation)
						}
					}					
				}
			}
			
			if(SourceSBPanel <> NULL)
			{
				// Reroute Limits of Sketch based Panel
				let ResultSBPanel(SldSketchBasedPanel)
				set ResultSBPanel = iResultObject
				if(ResultSBPanel <> NULL)
				{
					let SourceSBPanelPositionMode, ResultSBPanelPositionMode(Integer)
					SourceSBPanel->GetPositionMode(SourceSBPanelPositionMode)
					ResultSBPanel->GetPositionMode(ResultSBPanelPositionMode)
					if(SourceSBPanelPositionMode == 3) // 3DAxis mode
					{
						let Source3DAxis(Feature)
						SourceSBPanel->Get3DAxisSystem(Source3DAxis)
						if(Source3DAxis <> NULL)
						{
							let bCreatedDatumObject(Boolean)
							let NewDatumAxis(Feature)
							bCreatedDatumObject = iCopySpecification->CreateTransformedObject(Source3DAxis, Destination, NewDatumAxis, 0)
							if(bCreatedDatumObject == TRUE)
							{
								ResultSBPanel->Set3DAxisSystem(NewDatumAxis)
							}		
						}
					}
					else
					{
						let nbrSBPanelLimit(Integer)
						SourceSBPanel->GetNbOfLimits(nbrSBPanelLimit)	
						let idxCnt(Integer)
						set idxCnt = 1
						for idxCnt while idxCnt <= nbrSBPanelLimit
						{
							let SourceSBPanelLimit(Feature)
							SourceSBPanel->GetLimitingObject(SourceSBPanelLimit,idxCnt)
							let SourceSBPanelLimitOrientation(Integer)
							SourceSBPanel->GetLimitOrientation(SourceSBPanelLimitOrientation, idxCnt+1)
							let SourcePanelLimit, ResultPanelLimit(SldPanel)
							let SourceProfileLimit, ResultProfileLimit(SldProfile)				
							set SourcePanelLimit = SourceSBPanelLimit
							set SourceProfileLimit = SourceSBPanelLimit
							if(SourceProfileLimit <> NULL)
							{		
								let SourceProfileLimitFeature, ResultProfileLimitFeature(Feature)
								set SourceProfileLimitFeature = SourceProfileLimit
								iCopySpecification->RetrieveNewObject(SourceProfileLimitFeature, ResultProfileLimitFeature)
								set ResultProfileLimit = ResultProfileLimitFeature
								
								let SourceLimitType(Integer)
								SourceSBPanel->GetPanelLimitType(idxCnt, SourceLimitType)
								let SourceLimitKey(String)
								SourceSBPanel->GetLimitKey(idxCnt+1, SourceLimitKey)								
								if(ResultProfileLimit <> NULL)
								{
									ResultSBPanel->SetLimitingObject(ResultProfileLimit, idxCnt+1, SourceSBPanelLimitOrientation, SourceLimitType, SourceLimitKey)
								}								
							}
							else if(SourcePanelLimit <> NULL)
							{
								let SourcePanelLimitFeature, ResultPanelLimitFeature(Feature)
								set SourcePanelLimitFeature = SourcePanelLimit
								iCopySpecification->RetrieveNewObject(SourcePanelLimitFeature, ResultPanelLimitFeature)
								set ResultPanelLimit = ResultPanelLimitFeature
								
								let SourceLimitType(Integer)
								SourceSBPanel->GetPanelLimitType(idxCnt, SourceLimitType)
								let SourceLimitKey(String)
								SourceSBPanel->GetLimitKey(idxCnt+1, SourceLimitKey)								
								if(ResultPanelLimit <> NULL)
								{
									ResultSBPanel->SetLimitingObject(ResultPanelLimit, idxCnt+1, SourceSBPanelLimitOrientation, SourceLimitType, SourceLimitKey)
								}								
							}
							else
							{
								let bRetrieved(Boolean)
								let NewLimit(Feature)
								let NewLimitOrientation(Integer)
								bRetrieved = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceSBPanelLimit, SourceSBPanelLimitOrientation, NewLimit, NewLimitOrientation)
								if(bRetrieved == FALSE)
								{
									if(CopyMode == 1)
									{
										set NewLimit = new("Surface", SourceSBPanelLimit.Name + "_" + iCopySpecification.Name, Destination)
										let SourceLimitWireFrame, NewLimitWireFrame(Wireframe)
										set SourceLimitWireFrame = SourceSBPanelLimit
										set NewLimitWireFrame = symmetry(SourceLimitWireFrame , SymmetryPlane)
										set NewLimit = NewLimitWireFrame			
									}
									else if(CopyMode == 2)
									{
										set NewLimit = new("Surface", SourceSBPanelLimit.Name + "_" + iCopySpecification.Name, Destination)
										let SourceLimitWireFrame, NewLimitWireFrame(Wireframe)
										set SourceLimitWireFrame = SourceSBPanelLimit
										
										set NewLimitWireFrame = translate(SourceLimitWireFrame , TranslateDirection, TranslateDistance)
										set NewLimit = NewLimitWireFrame
									}
								}
								if(NewLimit <> NULL)
								{
									let SourceLimitType(Integer)
									SourceSBPanel->GetPanelLimitType(idxCnt, SourceLimitType)
									let SourceLimitKey(String)
									SourceSBPanel->GetLimitKey(idxCnt+1, SourceLimitKey)								
									if(NewLimit <> NULL)
									{
										ResultSBPanel->SetLimitingObject(NewLimit, idxCnt+1, NewLimitOrientation, SourceLimitType, SourceLimitKey)
									}
									ResultSBPanel->SetLimitOrientation(NewLimitOrientation, idxCnt+1)
								}
							}
						}						
					}
				}
			}
			else
			{
				// Reroute Limits of Panel
				let lvSourcePanelLimits, lvResultPanelLimits(List)
				set lvSourcePanelLimits = SourcePanel.Limits
				let nbrSourceLimit, nbrResultLimit(Integer)
				nbrSourceLimit = lvSourcePanelLimits.Size()
				set lvResultPanelLimits = ResultPanel.Limits
				nbrResultLimit = lvResultPanelLimits.Size()
				if(nbrSourceLimit == nbrResultLimit)
				{
					let idxCnt(Integer)
					set idxCnt = 1
					for idxCnt while idxCnt <= nbrSourceLimit
					{
						let SourcePanelLimit, NewPanelLimit, NewStructurePanelLimit(Feature)
						SourcePanel->GetLimitingObject(SourcePanelLimit,idxCnt)
						let SRSPlaneLimit(RFGGridFace)
						set SRSPlaneLimit = SourcePanelLimit
						if(SRSPlaneLimit == NULL) // when Structure object is limit,
						{
							let PanelLimit(SldPanel)
							set PanelLimit = SourcePanelLimit
							if(PanelLimit <> NULL)
							{
								iCopySpecification->RetrieveNewObject(SourcePanelLimit, NewStructurePanelLimit)
								PanelLimit->GetSupport(SourcePanelLimit)
							}
						}
						let SourcePanelLimitOrientation, NewPanelLimitOrientation(Integer)
						SourcePanel->GetLimitOrientation(SourcePanelLimitOrientation, idxCnt)
						let SourceLimitKey(String)
						SourcePanel->GetLimitKey(idxCnt, SourceLimitKey)					
						let SourceLimitType(Integer)
						SourcePanel->GetPanelLimitType(idxCnt, SourceLimitType)					
						
						if(NewStructurePanelLimit <> NULL)
						{
							ResultPanel->SetLimitingObject(NewStructurePanelLimit, idxCnt, NewPanelLimitOrientation, SourceLimitType, SourceLimitKey)					
							
							NewPanelLimitOrientation = iCopySpecification->ComputeInputOrientation(SourcePanel, SourcePanelLimit, SourcePanelLimitOrientation, NewStructurePanelLimit)
							if(NewPanelLimitOrientation <> 0)
								ResultPanel->SetLimitOrientation(NewPanelLimitOrientation, idxCnt)
						}	
						else
						{
							let bRetrieved(Boolean)
							bRetrieved = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourcePanelLimit, SourcePanelLimitOrientation, NewPanelLimit, NewPanelLimitOrientation)
							if(bRetrieved == TRUE)
							{
								if(NewPanelLimit <> NULL)
									ResultPanel->SetLimitingObject(NewPanelLimit, idxCnt, NewPanelLimitOrientation, SourceLimitType, SourceLimitKey)
								ResultPanel->SetLimitOrientation(NewPanelLimitOrientation, idxCnt)
							}
						}
						if(NewPanelLimit == NULL and NewStructurePanelLimit == NULL)
						{
							let SketchLimit(Sketch)
							set SketchLimit = SourcePanelLimit
							if(SketchLimit <> NULL)
							{
								let OriginalCopiedLimit(Feature)
								ResultPanel->GetLimitingObject(OriginalCopiedLimit, idxCnt)
								
								let NewSketchLimit(Sketch)
								iCopySpecification->GenerateSketchOnDestination(SourcePanel, SketchLimit, NewSketchLimit)
								
								if(NewSketchLimit <> NULL)
								{								
									if(OriginalCopiedLimit <> NULL)
									{
										let SketchOwner(Feature)
										let PanelofSketch(SldPanel)
										set SketchOwner = OriginalCopiedLimit.Owner
										set PanelofSketch = SketchOwner.Owner
										if(PanelofSketch == ResultPanel)
										{
											OriginalCopiedLimit->Delete()
										}
									}								
									SourcePanel->GetPanelLimitType(idxCnt, SourceLimitType)
									SourcePanel->GetLimitKey(idxCnt, SourceLimitKey)
									ResultPanel->SetLimitingObject(NewSketchLimit, idxCnt, NewPanelLimitOrientation, SourceLimitType, SourceLimitKey)
									
									NewPanelLimitOrientation = iCopySpecification->ComputeInputOrientation(SourcePanel, SketchLimit, SourcePanelLimitOrientation, NewSketchLimit)
									if(NewPanelLimitOrientation <> 0)
										ResultPanel->SetLimitOrientation(NewPanelLimitOrientation, idxCnt)
								}							
							}
							else
							{
								let NewLimit(Feature)
								if(CopyMode == 1)
								{
									let SourceCurveLimit(Curve)
									let SourceSurfaceLimit(Surface)
									set SourceCurveLimit = SourcePanelLimit
									set SourceSurfaceLimit = SourcePanelLimit
									if(SourceCurveLimit <> NULL)
										set NewLimit = new("Curve", SourcePanelLimit.Name + "_" + iCopySpecification.Name, Destination)
									else if(SourceSurfaceLimit <> NULL)
										set NewLimit = new("Surface", SourcePanelLimit.Name + "_" + iCopySpecification.Name, Destination)
									let SourceLimitWireFrame, NewLimitWireFrame(Wireframe)
									set SourceLimitWireFrame = SourcePanelLimit
									if(SourceLimitWireFrame <> NULL)
									{
										set NewLimitWireFrame = symmetry(SourceLimitWireFrame , SymmetryPlane)
										set NewLimit = NewLimitWireFrame
									}			
								}
								else if(CopyMode == 2)
								{
									let SourceCurveLimit(Curve)
									let SourceSurfaceLimit(Surface)
									set SourceCurveLimit = SourcePanelLimit
									set SourceSurfaceLimit = SourcePanelLimit
									if(SourceCurveLimit <> NULL)
										set NewLimit = new("Curve", SourcePanelLimit.Name + "_" + iCopySpecification.Name, Destination)
									else if(SourceSurfaceLimit <> NULL)
										set NewLimit = new("Surface", SourcePanelLimit.Name + "_" + iCopySpecification.Name, Destination)
									let SourceLimitWireFrame, NewLimitWireFrame(Wireframe)
									set SourceLimitWireFrame = SourcePanelLimit
									
									if(SourceLimitWireFrame <> NULL)
									{
										set NewLimitWireFrame = translate(SourceLimitWireFrame , TranslateDirection, TranslateDistance)
										set NewLimit = NewLimitWireFrame
									}
								}
								if(NewLimit <> NULL)
								{
									SourcePanel->GetPanelLimitType(idxCnt, SourceLimitType)
									SourcePanel->GetLimitKey(idxCnt, SourceLimitKey)
									ResultPanel->SetLimitingObject(NewLimit, idxCnt, NewPanelLimitOrientation, SourceLimitType, SourceLimitKey)
									
									NewPanelLimitOrientation = iCopySpecification->ComputeInputOrientation(SourcePanel, SourcePanelLimit, SourcePanelLimitOrientation, NewLimit)
									if(NewPanelLimitOrientation <> 0)
										ResultPanel->SetLimitOrientation(NewPanelLimitOrientation, idxCnt)
								}
							}
						}
					}		
				}
			}
			
			// Cutting Element
			let lvSourcePanelCuttingElement, lvResultPanelCuttingElement(List)
			SourcePanel->GetCuttingElements(lvSourcePanelCuttingElement)
			ResultPanel->GetCuttingElements(lvResultPanelCuttingElement)
			let nbrSourceCuttingElement, nbrResultCuttingElement(Integer)
			nbrSourceCuttingElement = lvSourcePanelCuttingElement->Size()
			nbrResultCuttingElement = lvResultPanelCuttingElement->Size()
			if(nbrSourceCuttingElement == nbrResultCuttingElement)
			{
				let lvNewCuttingElements(List)
				let idxCnt(Integer)
				set idxCnt = 1
				for idxCnt while idxCnt <= nbrSourceCuttingElement
				{
					let SourceCuttingElement, ResultCuttingElement(Feature)
					SourceCuttingElement = lvSourcePanelCuttingElement.GetItem(idxCnt)
					if(SourceCuttingElement <> NULL)
					{
						let bRetrievedCuttingElement(Boolean)
						let SourceOrientation, NewOrientation(Integer)
						SourceOrientation = 0
						bRetrievedCuttingElement = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceCuttingElement, SourceOrientation, ResultCuttingElement, NewOrientation)
						if(bRetrievedCuttingElement == FALSE)
						{
							let SketchCuttingElement(Sketch)
							set SketchCuttingElement = SourceCuttingElement
							if(SketchCuttingElement <> NULL)
							{
								let NewSketchLimit(Sketch)
								iCopySpecification->GenerateSketchOnDestination(SourcePanel, SketchCuttingElement, NewSketchLimit)							
								if(NewSketchLimit <> NULL)
								{								
									ResultCuttingElement = NewSketchLimit
								}
							}
							else
							{
								if(CopyMode == 1)
								{
									set ResultCuttingElement = new("Surface", SourceCuttingElement.Name + "_" + iCopySpecification.Name, Destination)
									let SourceElementWireFrame, NewElementWireFrame(Wireframe)
									set SourceElementWireFrame = SourceCuttingElement
									set NewElementWireFrame = symmetry(SourceElementWireFrame , SymmetryPlane)
									set ResultCuttingElement = NewElementWireFrame			
								}
								else if(CopyMode == 2)
								{
									set ResultCuttingElement = new("Surface", SourceCuttingElement.Name + "_" + iCopySpecification.Name, Destination)
									let SourceElementWireFrame, NewElementWireFrame(Wireframe)
									set SourceElementWireFrame = SourceCuttingElement
									
									set NewElementWireFrame = translate(SourceElementWireFrame , TranslateDirection, TranslateDistance)
									set ResultCuttingElement = NewElementWireFrame
								}
							}
						}
						if(ResultCuttingElement <> NULL)
						{
							lvNewCuttingElements.SetItem(ResultCuttingElement, idxCnt)						
						}	
					}			
				}
				let nbrNewCuttingElement(Integer)
				nbrNewCuttingElement = lvNewCuttingElements->Size()
				if(nbrResultCuttingElement == nbrNewCuttingElement)
				{
					ResultPanel->SetCuttingElements(lvNewCuttingElements)
				}		
			}		
		}
		else if(SourceSBPlate <> NULL and ResultPlate <> NULL)
		{
			// Reroute Limits of Sketch based Plate
			let ResultSBPlate(SldSketchBasedPlate)
			set ResultSBPlate = ResultPlate
			if(ResultSBPlate <> NULL)
			{
				// Reroute Support
				let SourceSupport, NewSupportPlane(Feature)
				SourceSBPlate->GetSupport(SourceSupport)	
				let SourceThrowOrientation, NewThrowOrientation(Integer)
				SourceThrowOrientation = SourceSBPlate.ThrowOrientation	
				if(SourceSupport <> NULL)
				{
					let bRetrieved(Boolean)
					bRetrieved = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceSupport, SourceThrowOrientation, NewSupportPlane, NewThrowOrientation)
					if(bRetrieved == TRUE)
					{
						ResultSBPlate->SetSupport(NewSupportPlane)
						ResultSBPlate->SetThrowOrientation(NewThrowOrientation)
					}
					else
					{
						let NewSupport(Feature)
						if(CopyMode == 1)
						{
							set NewSupport = new("Surface", SourceSupport.Name + "_" + iCopySpecification.Name, Destination)
							let SourceSupportWireFrame, NewSupportWireFrame(Wireframe)
							set SourceSupportWireFrame = SourceSupport
							set NewSupportWireFrame = symmetry(SourceSupportWireFrame , SymmetryPlane)
							set NewSupport = NewSupportWireFrame			
						}
						else if(CopyMode == 2)
						{
							set NewSupport = new("Surface", SourceSupport.Name + "_" + iCopySpecification.Name, Destination)
							let SourceSupportWireFrame, NewSupportWireFrame(Wireframe)
							set SourceSupportWireFrame = SourceSupport
							let SourcePlane(Plane)
							set SourcePlane = SourcePlaneWF
							
							set NewSupportWireFrame = translate(SourceSupportWireFrame , TranslateDirection, TranslateDistance)
							set NewSupport = NewSupportWireFrame
						}
						if(NewSupport == NULL)
						{
							let CloneStatus(Boolean)
							CloneStatus = iCopySpecification->CreateTransformedObject(SourceSupport, Destination, NewSupport, 1)
							if(CloneStatus == TRUE)
							{
								NewSupport.Name =  SourceSupport.Name + "_" + iCopySpecification.Name
							}
						}				
						if(NewSupport <> NULL)
						{
							ResultSBPlate->SetSupport(NewSupport)
							NewThrowOrientation = iCopySpecification->ComputeInputOrientation(SourcePlate, SourceSupport, SourceThrowOrientation, NewSupport)
							if(NewThrowOrientation <> 0)
							{
								ResultSBPlate->SetThrowOrientation(NewThrowOrientation)
							}
						}					
					}
				}
				
				let SourceSBPanelPositionMode, ResultSBPanelPositionMode(Integer)
				SourceSBPlate->GetPositionMode(SourceSBPanelPositionMode)
				ResultSBPlate->GetPositionMode(ResultSBPanelPositionMode)
				if(SourceSBPanelPositionMode == 3) // 3DAxis mode
				{
					let Source3DAxis(Feature)
					SourceSBPlate->Get3DAxisSystem(Source3DAxis)
					if(Source3DAxis <> NULL)
					{
						let bCreatedDatumObject(Boolean)
						let NewDatumAxis(Feature)
						bCreatedDatumObject = iCopySpecification->CreateTransformedObject(Source3DAxis, Destination, NewDatumAxis, 0)
						if(bCreatedDatumObject == TRUE)
						{
							ResultSBPlate->Set3DAxisSystem(NewDatumAxis)
						}		
					}
				}
				else
				{
					let nbrSBPanelLimit(Integer)
					SourceSBPlate->GetNbOfLimits(nbrSBPanelLimit)	
					let idxCnt(Integer)
					set idxCnt = 1
					for idxCnt while idxCnt <= nbrSBPanelLimit
					{
						let SourceSBPanelLimit(Feature)
						SourceSBPlate->GetLimitingObject(SourceSBPanelLimit,idxCnt)
						let SourceSBPanelLimitOrientation(Integer)
						SourceSBPlate->GetOrientation(SourceSBPanelLimitOrientation, idxCnt+1)
						let SourcePanelLimit, ResultPanelLimit(SldPanel)
						let SourceProfileLimit, ResultProfileLimit(SldProfile)				
						set SourcePanelLimit = SourceSBPanelLimit
						set SourceProfileLimit = SourceSBPanelLimit
						if(SourceProfileLimit <> NULL)
						{		
							let SourceProfileLimitFeature, ResultProfileLimitFeature(Feature)
							set SourceProfileLimitFeature = SourceProfileLimit
							iCopySpecification->RetrieveNewObject(SourceProfileLimitFeature, ResultProfileLimitFeature)
							set ResultProfileLimit = ResultProfileLimitFeature
							
							let SourceLimitType(Integer)
							SourceSBPlate->GetPanelLimitType(idxCnt, SourceLimitType)
							let SourceLimitKey(String)
							SourceSBPlate->GetLimitKey(idxCnt+1, SourceLimitKey)								
							if(ResultProfileLimit <> NULL)
							{
								ResultSBPlate->SetLimitingObject(ResultProfileLimit, idxCnt+1, SourceSBPanelLimitOrientation, SourceLimitType, SourceLimitKey)
							}								
						}
						else if(SourcePanelLimit <> NULL)
						{
							let SourcePanelLimitFeature, ResultPanelLimitFeature(Feature)
							set SourcePanelLimitFeature = SourcePanelLimit
							iCopySpecification->RetrieveNewObject(SourcePanelLimitFeature, ResultPanelLimitFeature)
							set ResultPanelLimit = ResultPanelLimitFeature
							
							let SourceLimitType(Integer)
							SourceSBPlate->GetPanelLimitType(idxCnt, SourceLimitType)
							let SourceLimitKey(String)
							SourceSBPlate->GetLimitKey(idxCnt+1, SourceLimitKey)								
							if(ResultPanelLimit <> NULL)
							{
								ResultSBPlate->SetLimitingObject(ResultPanelLimit, idxCnt+1, SourceSBPanelLimitOrientation, SourceLimitType, SourceLimitKey)
							}								
						}
						else
						{
							let bRetrieved(Boolean)
							let NewLimit(Feature)
							let NewLimitOrientation(Integer)
							bRetrieved = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceSBPanelLimit, SourceSBPanelLimitOrientation, NewLimit, NewLimitOrientation)
							if(bRetrieved == FALSE)
							{
								if(CopyMode == 1)
								{
									set NewLimit = new("Surface", SourceSBPanelLimit.Name + "_" + iCopySpecification.Name, Destination)
									let SourceLimitWireFrame, NewLimitWireFrame(Wireframe)
									set SourceLimitWireFrame = SourceSBPanelLimit
									set NewLimitWireFrame = symmetry(SourceLimitWireFrame , SymmetryPlane)
									set NewLimit = NewLimitWireFrame			
								}
								else if(CopyMode == 2)
								{
									set NewLimit = new("Surface", SourceSBPanelLimit.Name + "_" + iCopySpecification.Name, Destination)
									let SourceLimitWireFrame, NewLimitWireFrame(Wireframe)
									set SourceLimitWireFrame = SourceSBPanelLimit
									
									set NewLimitWireFrame = translate(SourceLimitWireFrame , TranslateDirection, TranslateDistance)
									set NewLimit = NewLimitWireFrame
								}
							}
							if(NewLimit <> NULL)
							{
								let SourceLimitType(Integer)
								SourceSBPlate->GetPanelLimitType(idxCnt, SourceLimitType)
								let SourceLimitKey(String)
								SourceSBPlate->GetLimitKey(idxCnt+1, SourceLimitKey)								
								if(NewLimit <> NULL)
								{
									ResultSBPlate->SetLimitingObject(NewLimit, idxCnt+1, NewLimitOrientation, SourceLimitType, SourceLimitKey)
								}
							}
						}
					}						
				}
			}
		}
		
		if(SourcePanel <> NULL and ResultPanel <> NULL)
		{
			// Reroute Panel Opening
			let lvSourceOpenings, lvResultOpenings(List)
			let OpeningType(Integer)
			set OpeningType = 0
			SourcePanel->GetOpenings(lvSourceOpenings, OpeningType)	
			ResultPanel->GetOpenings(lvResultOpenings, OpeningType)
			
			let nbrSourceOpenings, nbrResultOpenings(Integer)
			set nbrSourceOpenings = lvSourceOpenings.Size()
			set nbrResultOpenings = lvResultOpenings.Size()
			if(nbrSourceOpenings == nbrResultOpenings)
			{
				let idxCnt(Integer)
				set idxCnt = 1
				for idxCnt while idxCnt <= nbrSourceOpenings
				{
					let SourceOpeningFeature, ResultOpeningFeature(Feature)
					set SourceOpeningFeature = lvSourceOpenings->GetItem(idxCnt)
					set ResultOpeningFeature = lvResultOpenings->GetItem(idxCnt)
					
					let SourceOpening, ResultOpening(SldOpeningP)
					set SourceOpening = SourceOpeningFeature
					set ResultOpening = ResultOpeningFeature
					
					let SourceOpeningType, ResultOpeningType(Integer)			
					SourceOpeningType = SourceOpening.OpeningType
					ResultOpeningType = ResultOpening.OpeningType
					
					if(SourceOpeningType == ResultOpeningType)
					{
						if(SourceOpeningType == 0) // 3DObject Opening
						{
							let SourceCuttingElement, NewCuttingElement(Feature)
							SourceOpening->GetCuttingElement(SourceCuttingElement)
							
							iCopySpecification->CreateTransformedObject(SourceCuttingElement, Destination, NewCuttingElement, 0)
							if(NewCuttingElement <> NULL)
							{
								ResultOpening->SetCuttingElement(NewCuttingElement)
							}
						}
						else if(SourceOpeningType == 1) // OutputProfile Opening
						{
							let SketchOutputProfile(Feature)
							SourceOpening->GetOutputProfile(SketchOutputProfile)				
							let SketchProfile, NewSketchProfile(Sketch)
							set SketchProfile = SketchOutputProfile.Owner
							iCopySpecification->GenerateSketchOnDestination(SourcePanel, SketchProfile, NewSketchProfile)					
							if(NewSketchProfile <> NULL)
							{
								let lvSketchChildrenList, lvOutputProfile(List)
								lvSketchChildrenList = NewSketchProfile.Children
								let nbrChild(Integer)
								nbrChild = lvSketchChildrenList->Size()
								lvOutputProfile = lvSketchChildrenList->Filter("2DOutputProfile", "")
								if(lvOutputProfile->Size() >= 1)
								{
									let NewOutputProfile(Feature)
									set NewOutputProfile = lvOutputProfile->GetItem(1)
									ResultOpening->SetOutputProfile(NewOutputProfile)
								}
							}
							else
							{
								if(SketchProfile <> NULL)
								{
									let NewOutputProfile(Feature)
									iCopySpecification->CreateTransformedObject(SketchOutputProfile, Destination, NewOutputProfile, 0)
									if(NewOutputProfile <> NULL)
									{
										ResultOpening->SetOutputProfile(NewOutputProfile)
									}
								}
							}
							
							let SourceDirection, ResultDirection(Feature)
							SourceOpening->GetOpeningDirection(SourceDirection)
							let bRetrievedDirection(Boolean)
							let SourceOrientation, NewOrientation(Integer)
							SourceOrientation = 0
							bRetrievedDirection = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceDirection, SourceOrientation, ResultDirection, NewOrientation)
							if(bRetrievedDirection == TRUE)
							{
								ResultOpening->SetOpeningDirection(ResultDirection)
							}					
						}					
						if(SourceOpeningType == 2) // Standard Opening
						{
							let PositionStrategy(String)
							PositionStrategy = SourceOpening.PositionStrategy
							if(PositionStrategy == "CATStrPosOffsetOffset" or PositionStrategy == "CATStrPosHalfHeightOffset")
							{
								let SourceUReference(Feature)
								SourceOpening->GetURef(SourceUReference)
								if(SourceUReference <> NULL)
								{
									let SourceURefOrientation(Integer)
									SourceURefOrientation = SourceOpening.UOffsetSideOrientation						
									let bRetrievedU(Boolean)
									let NewURef(Feature)
									let NewURefOrientation(Integer)
									bRetrievedU = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceUReference, SourceURefOrientation, NewURef, NewURefOrientation)
									if(bRetrievedU == FALSE)
									{
										if(CopyMode == 1)
										{
											set NewURef = new("Plane", SourceUReference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceUReference
											set NewURefWireFrame = symmetry(SourceURefWireFrame , SymmetryPlane)
											set NewURef = NewURefWireFrame			
										}
										else if(CopyMode == 2)
										{
											set NewURef = new("Plane", SourceUReference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceUReference
											
											set NewURefWireFrame = translate(SourceURefWireFrame , TranslateDirection, TranslateDistance)
											set NewURef = NewURefWireFrame
										}								
									}
									if(NewURef <> NULL)
									{
										let OpeningToReroute(SldOpeningP)
										set OpeningToReroute = ResultOpening
										OpeningToReroute->SetURef(NewURef)
										set OpeningToReroute = ResultOpening
										OpeningToReroute->SetUOffsetSideOrientation(NewURefOrientation)							
									}
								}
								
								let SourceVReference(Feature)
								SourceOpening->GetVRef(SourceVReference)
								if(SourceVReference <> NULL)
								{
									let SourceVRefOrientation(Integer)
									SourceVRefOrientation = SourceOpening.VOffsetSideOrientation						
									let bRetrievedV(Boolean)
									let NewVRef(Feature)
									let NewVRefOrientation(Integer)
									bRetrievedV = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceVReference, SourceVRefOrientation, NewVRef, NewVRefOrientation)
									if(bRetrievedV == FALSE)
									{								
										if(CopyMode == 1)
										{
											set NewVRef = new("Plane", SourceVReference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceVRefWireFrame, NewVRefWireFrame(Wireframe)
											set SourceVRefWireFrame = SourceVReference
											set NewVRefWireFrame = symmetry(SourceVRefWireFrame , SymmetryPlane)
											set NewVRef = NewVRefWireFrame			
										}
										else if(CopyMode == 2)
										{
											set NewVRef = new("Plane", SourceVReference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceVRefWireFrame, NewVRefWireFrame(Wireframe)
											set SourceVRefWireFrame = SourceVReference
											
											set NewVRefWireFrame = translate(SourceVRefWireFrame , TranslateDirection, TranslateDistance)
											set NewVRef = NewVRefWireFrame
										}								
									}							
									if(NewVRef <> NULL)
									{
										let OpeningToReroute(SldOpeningP)
										set OpeningToReroute = ResultOpening
										OpeningToReroute->SetVRef(NewVRef)
										set OpeningToReroute = ResultOpening
										OpeningToReroute->SetVOffsetSideOrientation(NewVRefOrientation)							
									}
								}
							}
							else if(PositionStrategy == "CATStrPosMidDistOffset" or PositionStrategy == "CATStrPosHalfHeightMidDist")
							{						
								let SourceU1Reference, SourceU2Reference(Feature)
								SourceOpening->GetURefMidDist(SourceU1Reference, SourceU2Reference)
								if(SourceU1Reference <> NULL and SourceU2Reference <> NULL )
								{
									let SourceU1RefOrientation, SourceU2RefOrientation(Integer)
									SourceU1RefOrientation = SourceOpening.UOffsetSideOrientation						
									let bRetrievedU1,  bRetrievedU2(Boolean)
									let NewU1Ref, NewU2Ref(Feature)
									let NewU1RefOrientation, NewU2RefOrientation(Integer)
									bRetrievedU1 = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceU1Reference, SourceU1RefOrientation, NewU1Ref, NewU1RefOrientation)
									if(bRetrievedU1 == FALSE)
									{								
										if(CopyMode == 1)
										{
											set NewU1Ref = new("Plane", SourceU1Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceU1Reference
											set NewURefWireFrame = symmetry(SourceURefWireFrame , SymmetryPlane)
											set NewU1Ref = NewURefWireFrame			
										}
										else if(CopyMode == 2)
										{
											set NewU1Ref = new("Plane", SourceU1Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceU1Reference
											
											set NewURefWireFrame = translate(SourceURefWireFrame , TranslateDirection, TranslateDistance)
											set NewU1Ref = NewURefWireFrame
										}								
									}
									bRetrievedU2 = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceU2Reference, SourceU2RefOrientation, NewU2Ref, NewU2RefOrientation)
									if(bRetrievedU2 == FALSE)
									{								
										if(CopyMode == 1)
										{
											set NewU2Ref = new("Plane", SourceU2Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceU2Reference
											set NewURefWireFrame = symmetry(SourceURefWireFrame , SymmetryPlane)
											set NewU2Ref = NewURefWireFrame			
										}
										else if(CopyMode == 2)
										{
											set NewU2Ref = new("Plane", SourceU2Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceU2Reference
											
											set NewURefWireFrame = translate(SourceURefWireFrame , TranslateDirection, TranslateDistance)
											set NewU2Ref = NewURefWireFrame
										}								
									}							
									if(NewU1Ref <> NULL and NewU2Ref <> NULL)
									{
										ResultOpening->SetURefMidDist(NewU1Ref, NewU2Ref)
									}
								}
								let SourceVReference(Feature)
								SourceOpening->GetVRef(SourceVReference)
								if(SourceVReference <> NULL)
								{
									let SourceVRefOrientation(Integer)
									SourceVRefOrientation = SourceOpening.VOffsetSideOrientation						
									let bRetrievedV(Boolean)
									let NewVRef(Feature)
									let NewVRefOrientation(Integer)
									bRetrievedV = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceVReference, SourceVRefOrientation, NewVRef, NewVRefOrientation)
									if(bRetrievedV == FALSE)
									{								
										if(CopyMode == 1)
										{
											set NewVRef = new("Plane", SourceVReference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceVRefWireFrame, NewVRefWireFrame(Wireframe)
											set SourceVRefWireFrame = SourceVReference
											set NewVRefWireFrame = symmetry(SourceVRefWireFrame , SymmetryPlane)
											set NewVRef = NewVRefWireFrame			
										}
										else if(CopyMode == 2)
										{
											set NewVRef = new("Plane", SourceVReference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceVRefWireFrame, NewVRefWireFrame(Wireframe)
											set SourceVRefWireFrame = SourceVReference
											
											set NewVRefWireFrame = translate(SourceVRefWireFrame , TranslateDirection, TranslateDistance)
											set NewVRef = NewVRefWireFrame
										}								
									}									
									if(NewVRef <> NULL)
									{
										ResultOpening->SetVRef(NewVRef)
										ResultOpening->SetVOffsetSideOrientation(NewVRefOrientation)							
									}
								}
							}
							else if(PositionStrategy == "CATStrPosMidDistMidDist")
							{
								let SourceU1Reference, SourceU2Reference(Feature)
								SourceOpening->GetURefMidDist(SourceU1Reference, SourceU2Reference)
								if(SourceU1Reference <> NULL and SourceU2Reference <> NULL )
								{
									let SourceU1RefOrientation, SourceU2RefOrientation(Integer)
									SourceU1RefOrientation = SourceOpening.UOffsetSideOrientation						
									let bRetrievedU1,  bRetrievedU2(Boolean)
									let NewU1Ref, NewU2Ref(Feature)
									let NewU1RefOrientation, NewU2RefOrientation(Integer)
									bRetrievedU1 = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceU1Reference, SourceU1RefOrientation, NewU1Ref, NewU1RefOrientation)
									if(bRetrievedU1 == FALSE)
									{								
										if(CopyMode == 1)
										{
											set NewU1Ref = new("Plane", SourceU1Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceU1Reference
											set NewURefWireFrame = symmetry(SourceURefWireFrame , SymmetryPlane)
											set NewU1Ref = NewURefWireFrame			
										}
										else if(CopyMode == 2)
										{
											set NewU1Ref = new("Plane", SourceU1Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceU1Reference
											
											set NewURefWireFrame = translate(SourceURefWireFrame , TranslateDirection, TranslateDistance)
											set NewU1Ref = NewURefWireFrame
										}								
									}
									bRetrievedU2 = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceU2Reference, SourceU2RefOrientation, NewU2Ref, NewU2RefOrientation)
									if(bRetrievedU2 == FALSE)
									{								
										if(CopyMode == 1)
										{
											set NewU2Ref = new("Plane", SourceU2Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceU2Reference
											set NewURefWireFrame = symmetry(SourceURefWireFrame , SymmetryPlane)
											set NewU2Ref = NewURefWireFrame			
										}
										else if(CopyMode == 2)
										{
											set NewU2Ref = new("Plane", SourceU2Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceU2Reference
											
											set NewURefWireFrame = translate(SourceURefWireFrame , TranslateDirection, TranslateDistance)
											set NewU2Ref = NewURefWireFrame
										}								
									}
									if(NewU1Ref <> NULL and NewU2Ref <> NULL)
									{
										ResultOpening->SetURefMidDist(NewU1Ref, NewU2Ref)
									}
								}
								let SourceV1Reference, SourceV2Reference(Feature)
								SourceOpening->GetVRefMidDist(SourceV1Reference, SourceV2Reference)
								if(SourceV1Reference <> NULL and SourceV2Reference <> NULL )
								{
									let SourceV1RefOrientation, SourceV2RefOrientation(Integer)
									SourceV1RefOrientation = SourceOpening.VOffsetSideOrientation						
									let bRetrievedV1,  bRetrievedV2(Boolean)
									let NewV1Ref, NewV2Ref(Feature)
									let NewV1RefOrientation, NewV2RefOrientation(Integer)
									bRetrievedV1 = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceV1Reference, SourceV1RefOrientation, NewV1Ref, NewV1RefOrientation)
									if(bRetrievedV1 == FALSE)
									{								
										if(CopyMode == 1)
										{
											set NewV1Ref = new("Plane", SourceV1Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceV1Reference
											set NewURefWireFrame = symmetry(SourceURefWireFrame , SymmetryPlane)
											set NewV1Ref = NewURefWireFrame			
										}
										else if(CopyMode == 2)
										{
											set NewV1Ref = new("Plane", SourceV1Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceURefWireFrame, NewURefWireFrame(Wireframe)
											set SourceURefWireFrame = SourceV1Reference
											
											set NewURefWireFrame = translate(SourceURefWireFrame , TranslateDirection, TranslateDistance)
											set NewV1Ref = NewURefWireFrame
										}								
									}							
									bRetrievedV2 = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceV2Reference, SourceV2RefOrientation, NewV2Ref, NewV2RefOrientation)
									if(bRetrievedV2 == FALSE)
									{								
										if(CopyMode == 1)
										{
											set NewV2Ref = new("Plane", SourceV2Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceVRefWireFrame, NewVRefWireFrame(Wireframe)
											set SourceVRefWireFrame = SourceV2Reference
											set NewVRefWireFrame = symmetry(SourceVRefWireFrame , SymmetryPlane)
											set NewV2Ref = NewVRefWireFrame			
										}
										else if(CopyMode == 2)
										{
											set NewV2Ref = new("Plane", SourceV2Reference.Name + "_" + iCopySpecification.Name, Destination)
											let SourceVRefWireFrame, NewVRefWireFrame(Wireframe)
											set SourceVRefWireFrame = SourceV2Reference
											
											set NewVRefWireFrame = translate(SourceVRefWireFrame , TranslateDirection, TranslateDistance)
											set NewV2Ref = NewVRefWireFrame
										}								
									}							
									if(NewV1Ref <> NULL and NewV2Ref <> NULL)
									{
										ResultOpening->SetVRefMidDist(NewV1Ref, NewV2Ref)
									}
								}						
							}
							else if(PositionStrategy == "CATStrPos3DAxis")
							{					
								let SourceAxis, NewAxis(Feature)
								SourceOpening->GetOpeningAxisSystem(SourceAxis)
								iCopySpecification->CreateTransformedObject(SourceAxis, Destination, NewAxis, 0)
								ResultOpening->SetOpeningAxisSystem(NewAxis)
							}
						}			
					}			
				}
			}
		}
		
		
		// Reroute Flange for Panel and SketchbasedPanel
		let lvSourcePlates, lvResultPlates(List)
		if(SourcePanel <> NULL and ResultPanel <> NULL)
		{
			SourcePanel->GetSplitplates(lvSourcePlates)
			ResultPanel->GetSplitplates(lvResultPlates)
		}
		
		let nbrResultPlate(Integer)
		set nbrResultPlate = lvResultPlates->Size()
		if(lvSourcePlates->Size() == nbrResultPlate)
		{
			let idxCnt(Integer)
			set idxCnt = 1
			for idxCnt while idxCnt <= nbrResultPlate
			{
				let SourceSplitPlate, ResultSplitPlate(SldPlate)
				SourceSplitPlate = lvSourcePlates->GetItem(idxCnt)
				ResultSplitPlate = lvResultPlates->GetItem(idxCnt)
				
				if(SourceSplitPlate <> NULL and ResultSplitPlate <> NULL)
				{
					let lvSourceFlanges, lvResultFlanges(List)
					SourceSplitPlate->GetFlanges(lvSourceFlanges)
					ResultSplitPlate->GetFlanges(lvResultFlanges)
					
					let nbrFlange(Integer)
					set nbrFlange = lvResultFlanges->Size()
					let idxFlangeCnt(Integer)
					if(nbrFlange == lvSourceFlanges->Size())
					{
						set idxFlangeCnt = 1
						for idxFlangeCnt while idxFlangeCnt <= nbrFlange
						{
							let SourceFlange, ResultFlange(SldFlange)
							set SourceFlange = lvSourceFlanges->GetItem(idxFlangeCnt)
							set ResultFlange = lvResultFlanges->GetItem(idxFlangeCnt)
							// Reroute Edge
							let SourceFlangeEdge, ResultFlangeEdge(Feature)
							SourceFlange->GetEdgeLimit(SourceFlangeEdge)
							if(SourceFlangeEdge <> NULL)
							{
								let SourceOrientation, NewOrientation(Integer)
								SourceOrientation = 0
								let bRetrievedEdgeLimit(Boolean)
								bRetrievedEdgeLimit = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceFlangeEdge, SourceOrientation, ResultFlangeEdge, NewOrientation)
								if(bRetrievedEdgeLimit == TRUE and ResultFlangeEdge <> NULL)
								{			
									ResultFlange->SetEdgeLimit(ResultFlangeEdge)			
								}
								else
								{
									let SourceFlangeEdgeWire(Wireframe)
									set SourceFlangeEdgeWire = SourceFlangeEdge
									if(SourceFlangeEdgeWire <> NULL)
									{
										let bCreatedDatumEdge(Boolean)
										bCreatedDatumEdge = iCopySpecification->CreateTransformedObject(SourceFlangeEdgeWire, Destination, ResultFlangeEdge, 0)
										if(bCreatedDatumEdge == TRUE)
										{
											ResultFlange->SetEdge(ResultFlangeEdge)
										}
									}
								}
							}
							
							// Reroute two Limits
							let SourceFlangeStartLimit, ResultFlangeStartLimit(Feature)
							SourceFlange->GetFlangeStartLimit(SourceFlangeStartLimit)						
							let SourceStartLimitOrientation, NewStartLimitOrientation(Integer)
							SourceStartLimitOrientation = -1
							let bRetrievedStartLimit(Boolean)
							bRetrievedStartLimit = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceFlangeStartLimit, SourceStartLimitOrientation, ResultFlangeStartLimit, NewStartLimitOrientation)
							
							let SourceFlangeEndLimit, ResultFlangeEndLimit(Feature)
							SourceFlange->GetFlangeEndLimit(SourceFlangeEndLimit)						
							let SourceEndLimitOrientation, NewEndLimitOrientation(Integer)
							SourceEndLimitOrientation = -1
							let bRetrievedEndLimit(Boolean)
							bRetrievedEndLimit = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceFlangeEndLimit, SourceEndLimitOrientation, ResultFlangeEndLimit, NewEndLimitOrientation)	
							
							if(bRetrievedStartLimit == TRUE and bRetrievedEndLimit == TRUE)
							{
								let bLimitValid(Boolean)
								bLimitValid = ResultFlange->SetFlangeLimits(ResultFlangeStartLimit, ResultFlangeEndLimit)
								if(bLimitValid == FALSE)
								{
									ResultFlange->SetFlangeLimits(ResultFlangeEndLimit, ResultFlangeStartLimit)
								}
							}
						}
					}				
				}
			}
		}
		
		// Reroute Flange for Panel and SketchbasedPlate
		if(SourcePlate <> NULL and ResultPlate <> NULL)
		{
			
			let lvSourceFlanges, lvResultFlanges(List)
			SourcePlate->GetFlanges(lvSourceFlanges)
			ResultPlate->GetFlanges(lvResultFlanges)
			
			let nbrFlange(Integer)
			set nbrFlange = lvResultFlanges->Size()
			let idxFlangeCnt(Integer)
			if(nbrFlange == lvSourceFlanges->Size())
			{
				set idxFlangeCnt = 1
				for idxFlangeCnt while idxFlangeCnt <= nbrFlange
				{
					let SourceFlange, ResultFlange(SldFlange)
					set SourceFlange = lvSourceFlanges->GetItem(idxFlangeCnt)
					set ResultFlange = lvResultFlanges->GetItem(idxFlangeCnt)
					// Reroute Edge
					let SourceFlangeEdge, ResultFlangeEdge(Feature)
					SourceFlange->GetEdgeLimit(SourceFlangeEdge)
					if(SourceFlangeEdge <> NULL)
					{
						let SourceOrientation, NewOrientation(Integer)
						SourceOrientation = 0
						let bRetrievedEdgeLimit(Boolean)
						bRetrievedEdgeLimit = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceFlangeEdge, SourceOrientation, ResultFlangeEdge, NewOrientation)
						if(bRetrievedEdgeLimit == TRUE and ResultFlangeEdge <> NULL)
						{			
							ResultFlange->SetEdgeLimit(ResultFlangeEdge)			
						}
						else
						{
							let SourceFlangeEdgeWire(Wireframe)
							set SourceFlangeEdgeWire = SourceFlangeEdge
							if(SourceFlangeEdgeWire <> NULL)
							{
								let bCreatedDatumEdge(Boolean)
								bCreatedDatumEdge = iCopySpecification->CreateTransformedObject(SourceFlangeEdgeWire, Destination, ResultFlangeEdge, 0)
								if(bCreatedDatumEdge == TRUE)
								{
									ResultFlange->SetEdge(ResultFlangeEdge)
								}
							}
						}
					}
					
					// Reroute two Limits
					let SourceFlangeStartLimit, ResultFlangeStartLimit(Feature)
					SourceFlange->GetFlangeStartLimit(SourceFlangeStartLimit)						
					let SourceStartLimitOrientation, NewStartLimitOrientation(Integer)
					SourceStartLimitOrientation = -1
					let bRetrievedStartLimit(Boolean)
					bRetrievedStartLimit = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceFlangeStartLimit, SourceStartLimitOrientation, ResultFlangeStartLimit, NewStartLimitOrientation)
					
					let SourceFlangeEndLimit, ResultFlangeEndLimit(Feature)
					SourceFlange->GetFlangeEndLimit(SourceFlangeEndLimit)						
					let SourceEndLimitOrientation, NewEndLimitOrientation(Integer)
					SourceEndLimitOrientation = -1
					let bRetrievedEndLimit(Boolean)
					bRetrievedEndLimit = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceFlangeEndLimit, SourceEndLimitOrientation, ResultFlangeEndLimit, NewEndLimitOrientation)	
					
					if(bRetrievedStartLimit == TRUE and bRetrievedEndLimit == TRUE)
					{
						let bLimitValid(Boolean)
						bLimitValid = ResultFlange->SetFlangeLimits(ResultFlangeStartLimit, ResultFlangeEndLimit)
						if(bLimitValid == FALSE)
						{
							ResultFlange->SetFlangeLimits(ResultFlangeEndLimit, ResultFlangeStartLimit)
						}
					}
				}
			}				
			
		}
		
		if(SourcePanel <> NULL and ResultPanel <> NULL)
		{
			// Reroute Slot
			let lvSourceSlots, lvResultSlots(List)
			SourcePanel->GetSlots(lvSourceSlots)
			ResultPanel->GetSlots(lvResultSlots)
			
			let nbrResultSlot(Integer)
			set nbrResultSlot = lvResultSlots->Size()
			if(lvSourceSlots->Size() == nbrResultSlot)
			{
				let idxCnt(Integer)
				set idxCnt = 1
				for idxCnt while idxCnt <= nbrResultSlot
				{
					let SourceSlotFeature, ResultSlotFeature(Feature)
					set SourceSlotFeature = lvSourceSlots->GetItem(idxCnt)
					set ResultSlotFeature = lvResultSlots->GetItem(idxCnt)
					
					if(SourceSlotFeature <> NULL and ResultSlotFeature <> NULL)
					{
						let SourceSlot, ResultSlot(SldSlotP)
						set SourceSlot = SourceSlotFeature
						set ResultSlot = ResultSlotFeature
						if(SourceSlot <> NULL and ResultSlot <> NULL)
						{
							let SourcePanetratingProfile, ResultPenetratingProfile(Feature)
							SourceSlot->GetPenetratingProfile(SourcePanetratingProfile)
							if(SourcePanetratingProfile <> NULL)
							{
								let bRetrievedProfile(Boolean)
								bRetrievedProfile = iCopySpecification->RetrieveNewObject(SourcePanetratingProfile, ResultPenetratingProfile)
								if(bRetrievedProfile <> NULL)
								{
									ResultSlot->SetPenetratingProfile(ResultPenetratingProfile)
								}
							}
						}
					}
				}	
			}
		}
	}
	
	
	if(TranslationLine <> NULL)
		TranslationLine->Delete()	
	
}