General InformationThis action rule is invoked when it is called in the main rerouting rule. Arguments
Sample
/* Argument List
lvProfileReroutingInputs : List
*/
/* Contents of lvProfileReroutingInputs list
The order of inputs MUST be respected
iCopySpecification Type = StrStructureCopySpecification // First item of lvProfileReroutingInputs
iSourceObject Type = Feature // Second item of lvProfileReroutingInputs
iResultObject Type = Feature // Thrid item of lvProfileReroutingInputs
*/
/* About Action
The name of this Action should be 'Profile 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 = lvProfileReroutingInputs->Size()
if(NbrmyInput == 3)
{
set iCopySpecification = lvProfileReroutingInputs->GetItem(1)
set iSourceObject = lvProfileReroutingInputs->GetItem(2)
set iResultObject = lvProfileReroutingInputs->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 SourceProfile, ResultProfile(SldProfile)
set SourceProfile = iSourceObject
set ResultProfile = iResultObject
if(SourceProfile <> NULL and ResultProfile <> NULL)
{
let iProfileType(Integer)
SourceProfile->GetType(iProfileType)
if(iProfileType == 0) //ProfilePtLength
{
let SourceMember, ResultMember(SldMember)
set SourceMember = SourceProfile
let SourceStartPoint(Feature)
SourceMember->GetStartPt(SourceStartPoint)
let NewPoint(Point)
if(CopyMode == 1)
{
set NewPoint = new("Point", SourceStartPoint.Name + "_" + iCopySpecification.Name , Destination)
let SourceStartPointWireFrame, NewPointWireFrame(Wireframe)
set SourceStartPointWireFrame = SourceStartPoint
set NewPointWireFrame = symmetry(SourceStartPointWireFrame , SymmetryPlane)
set NewPoint = NewPointWireFrame
}
else if(CopyMode == 2)
{
set NewPoint = new("Point", SourceStartPoint.Name + "_" + iCopySpecification.Name, Destination)
let SourceStartPointWireFrame, NewPointWireFrame(Wireframe)
set SourceStartPointWireFrame = SourceStartPoint
let SourcePlane(Plane)
set SourcePlane = SourcePlaneWF
set NewPointWireFrame = translate(SourceStartPointWireFrame , TranslateDirection, TranslateDistance)
set NewPoint = NewPointWireFrame
}
if(NewPoint <> NULL)
{
set ResultMember = ResultProfile
if(ResultMember <> NULL)
{
ResultMember->SetStartPt(NewPoint)
}
}
let SourceDirectionFeature, ResultDirectionFeature(Feature)
let NewDirectionOrientation(Integer)
SourceMember->GetDirection(SourceDirectionFeature)
if(SourceDirectionFeature <> NULL)
{
let bRetrievedDirection(Boolean)
bRetrievedDirection = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceDirectionFeature, -1, ResultDirectionFeature, NewDirectionOrientation)
if(bRetrievedDirection == FALSE)
{
if(CopyMode == 1)
{
set ResultDirectionFeature = new("Plane", SourceDirectionFeature.Name + "_" + iCopySpecification.Name, Destination)
let SourceDirectionWireFrame, NewDirectionWireFrame(Wireframe)
set SourceDirectionWireFrame = SourceDirectionFeature
set NewDirectionWireFrame = symmetry(SourceDirectionWireFrame , SymmetryPlane)
set ResultDirectionFeature = NewDirectionWireFrame
}
else if(CopyMode == 2)
{
set ResultDirectionFeature = new("Plane", SourceDirectionFeature.Name + "_" + iCopySpecification.Name, Destination)
let SourceDirectionWireFrame, NewDirectionWireFrame(Wireframe)
set SourceDirectionWireFrame = SourceDirectionFeature
set NewDirectionWireFrame = translate(SourceDirectionWireFrame , TranslateDirection, TranslateDistance)
set ResultDirectionFeature = NewDirectionWireFrame
}
}
if(ResultDirectionFeature <> NULL)
{
set ResultMember = ResultProfile
if(ResultMember <> NULL)
{
ResultMember->SetDirection(ResultDirectionFeature)
}
}
}
}
else if(iProfileType == 1) //ProfilePtLimit
{
let SourceMember, ResultMember(SldMember)
set SourceMember = SourceProfile
let SourceStartPoint(Feature)
SourceMember->GetStartPt(SourceStartPoint)
let NewPoint(Point)
if(CopyMode == 1)
{
set NewPoint = new("Point", SourceStartPoint.Name + "_" + iCopySpecification.Name, Destination)
let SourceStartPointWireFrame, NewPointWireFrame(Wireframe)
set SourceStartPointWireFrame = SourceStartPoint
set NewPointWireFrame = symmetry(SourceStartPointWireFrame , SymmetryPlane)
set NewPoint = NewPointWireFrame
}
else if(CopyMode == 2)
{
set NewPoint = new("Point", SourceStartPoint.Name + "_" + iCopySpecification.Name, Destination)
let SourceStartPointWireFrame, NewPointWireFrame(Wireframe)
set SourceStartPointWireFrame = SourceStartPoint
let SourcePlane(Plane)
set SourcePlane = SourcePlaneWF
set NewPointWireFrame = translate(SourceStartPointWireFrame , TranslateDirection, TranslateDistance)
set NewPoint = NewPointWireFrame
}
if(NewPoint <> NULL)
{
set ResultMember = ResultProfile
if(ResultMember <> NULL)
{
ResultMember->SetStartPt(NewPoint)
}
}
let SourceLimitFeature, ResultLimitFeature(Feature)
let NewLimitOrientation(Integer)
SourceMember->GetUpToLimit(SourceLimitFeature)
if(SourceLimitFeature <> NULL)
{
let bRetrievedLimit(Boolean)
bRetrievedLimit = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceLimitFeature, -1, ResultLimitFeature, NewLimitOrientation)
if(bRetrievedLimit == FALSE)
{
if(CopyMode == 1)
{
set ResultLimitFeature = new("Plane", SourceLimitFeature.Name + "_" + iCopySpecification.Name, Destination)
let SourceLimitWireFrame, NewLimitWireFrame(Wireframe)
set SourceLimitWireFrame = SourceLimitFeature
set NewLimitWireFrame = symmetry(SourceLimitWireFrame , SymmetryPlane)
set ResultLimitFeature = NewLimitWireFrame
}
else if(CopyMode == 2)
{
set ResultLimitFeature = new("Plane", SourceLimitFeature.Name + "_" + iCopySpecification.Name, Destination)
let SourceLimitWireFrame, NewLimitWireFrame(Wireframe)
set SourceLimitWireFrame = SourceLimitFeature
set NewLimitWireFrame = translate(SourceLimitWireFrame , TranslateDirection, TranslateDistance)
set ResultLimitFeature = NewLimitWireFrame
}
}
if(ResultLimitFeature <> NULL)
{
set ResultMember = ResultProfile
if(ResultMember <> NULL)
{
ResultMember->SetUpToLimit(ResultLimitFeature)
}
}
}
let SourceDirectionFeature, ResultDirectionFeature(Feature)
let NewDirectionOrientation(Integer)
SourceMember->GetDirection(SourceDirectionFeature)
if(SourceDirectionFeature <> NULL)
{
let bRetrievedDirection(Boolean)
bRetrievedDirection = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceDirectionFeature, -1, ResultDirectionFeature, NewDirectionOrientation)
if(bRetrievedDirection == FALSE)
{
if(CopyMode == 1)
{
set ResultDirectionFeature = new("Plane", SourceDirectionFeature.Name + "_" + iCopySpecification.Name, Destination)
let SourceDirectionWireFrame, NewDirectionWireFrame(Wireframe)
set SourceDirectionWireFrame = SourceDirectionFeature
set NewDirectionWireFrame = symmetry(SourceDirectionWireFrame , SymmetryPlane)
set ResultDirectionFeature = NewDirectionWireFrame
}
else if(CopyMode == 2)
{
set ResultDirectionFeature = new("Plane", SourceDirectionFeature.Name + "_" + iCopySpecification.Name, Destination)
let SourceDirectionWireFrame, NewDirectionWireFrame(Wireframe)
set SourceDirectionWireFrame = SourceDirectionFeature
set NewDirectionWireFrame = translate(SourceDirectionWireFrame , TranslateDirection, TranslateDistance)
set ResultDirectionFeature = NewDirectionWireFrame
}
}
if(ResultDirectionFeature <> NULL)
{
set ResultMember = ResultProfile
if(ResultMember <> NULL)
{
ResultMember->SetDirection(ResultDirectionFeature)
}
}
}
}
else if(iProfileType == 2) //ProfilePts
{
let SourceMember, ResultMember(SldMember)
set SourceMember = SourceProfile
let SourceStartPoint, SourceEndPoint(Feature)
SourceMember->GetStartPt(SourceStartPoint)
SourceMember->GetEndPt(SourceEndPoint)
let NewStartPoint(Point)
if(CopyMode == 1)
{
set NewStartPoint = new("Point", SourceStartPoint.Name + "_" + iCopySpecification.Name, Destination)
let SourceStartPointWireFrame, NewPointWireFrame(Wireframe)
set SourceStartPointWireFrame = SourceStartPoint
set NewPointWireFrame = symmetry(SourceStartPointWireFrame , SymmetryPlane)
set NewStartPoint = NewPointWireFrame
}
else if(CopyMode == 2)
{
set NewStartPoint = new("Point", SourceStartPoint.Name + "_" + iCopySpecification.Name, Destination)
let SourceStartPointWireFrame, NewPointWireFrame(Wireframe)
set SourceStartPointWireFrame = SourceStartPoint
let SourcePlane(Plane)
set SourcePlane = SourcePlaneWF
set NewPointWireFrame = translate(SourceStartPointWireFrame , TranslateDirection, TranslateDistance)
set NewStartPoint = NewPointWireFrame
}
if(NewStartPoint <> NULL)
{
set ResultMember = ResultProfile
if(ResultMember <> NULL)
ResultMember->SetStartPt(NewStartPoint)
}
let NewEndPoint(Point)
if(CopyMode == 1)
{
set NewEndPoint = new("Point", SourceEndPoint.Name + "_" + iCopySpecification.Name, Destination)
let SourceEndPointWireFrame, NewPointWireFrame(Wireframe)
set SourceEndPointWireFrame = SourceEndPoint
set NewPointWireFrame = symmetry(SourceEndPointWireFrame , SymmetryPlane)
set NewEndPoint = NewPointWireFrame
}
else if(CopyMode == 2)
{
set NewEndPoint = new("Point", SourceEndPoint.Name + "_" + iCopySpecification.Name, Destination)
let SourceEndPointWireFrame, NewPointWireFrame(Wireframe)
set SourceEndPointWireFrame = SourceEndPoint
let SourcePlane(Plane)
set SourcePlane = SourcePlaneWF
set NewPointWireFrame = translate(SourceEndPointWireFrame , TranslateDirection, TranslateDistance)
set NewEndPoint = NewPointWireFrame
}
if(NewEndPoint <> NULL)
{
set ResultMember = ResultProfile
if(ResultMember <> NULL)
ResultMember->SetEndPt(NewEndPoint)
}
}
else if(iProfileType == 3) //ProfileCrv --> Member, SFE
{
let SourceCurve(Feature)
SourceProfile->GetCurve(SourceCurve)
let NewCurve(Curve)
if(CopyMode == 1)
{
set NewCurve = new("Curve", SourceCurve.Name + "_" + iCopySpecification.Name, Destination)
let SourceCurveWireFrame, NewCurveWireFrame(Wireframe)
set SourceCurveWireFrame = SourceCurve
set NewCurveWireFrame = symmetry(SourceCurveWireFrame , SymmetryPlane)
set NewCurve = NewCurveWireFrame
}
else if(CopyMode == 2)
{
set NewCurve = new("Curve", SourceCurve.Name + "_" + iCopySpecification.Name, Destination)
let SourceCurveWireFrame, NewCurveWireFrame(Wireframe)
set SourceCurveWireFrame = SourceCurve
let SourcePlane(Plane)
set SourcePlane = SourcePlaneWF
set NewCurveWireFrame = translate(SourceCurveWireFrame , TranslateDirection, TranslateDistance)
set NewCurve = NewCurveWireFrame
}
if(NewCurve <> NULL)
{
ResultProfile->SetCurve(NewCurve)
}
let SourceReference, ResultReference(Feature)
SourceProfile->GetReference(SourceReference)
let SourceWebOrientation, NewWebOrientation(Integer)
SourceProfile->GetWebOrientation(SourceWebOrientation)
let bRetrievedReference(Boolean)
bRetrievedReference = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceReference, SourceWebOrientation, ResultReference, NewWebOrientation)
if(bRetrievedReference == TRUE)
{
ResultProfile->SetReference(ResultReference)
}
else
{
let PanelSourceReference, PanelResultReference(SldPanel)
set PanelSourceReference = SourceReference.Owner
if(PanelSourceReference <> NULL)
{
bRetrievedReference = iCopySpecification->RetrieveNewObject(SourceReference, ResultReference)
if(bRetrievedReference == TRUE)
{
set PanelResultReference = ResultReference
PanelResultReference->GetSupport(ResultReference)
ResultProfile->SetReference(ResultReference)
}
}
else
{
bRetrievedReference = iCopySpecification->CreateTransformedObject(SourceReference, Destination, ResultReference, 0)
if(bRetrievedReference == TRUE)
{
ResultProfile->SetReference(ResultReference)
}
}
}
}
else if(iProfileType == 5) //ProfileSurfSurf
{
// Stiffener and Member(ReferencePlane)
let SourceFirstSurfaceFeature, NewFirstSurfaceFeature(Feature)
SourceProfile->GetFirstSurface(SourceFirstSurfaceFeature)
let SourceSupportPanel(SldPanel)
set SourceSupportPanel = SourceFirstSurfaceFeature.Owner
if(SourceSupportPanel <> NULL)
{
SourceSupportPanel->GetSupport(SourceFirstSurfaceFeature)
}
let SourceWebOrientation, NewWebOrientation(Integer)
SourceProfile->GetWebOrientation(SourceWebOrientation)
let bRetrievedFirstSurface(Boolean)
bRetrievedFirstSurface = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceFirstSurfaceFeature, SourceWebOrientation, NewFirstSurfaceFeature, NewWebOrientation)
if(bRetrievedFirstSurface == TRUE)
{
let SourceMember(SldMember)
set SourceMember = SourceProfile
if( SourceMember <> NULL)
ResultProfile->SetFirstSurface(NewFirstSurfaceFeature)
ResultProfile->SetWebOrientation(NewWebOrientation)
}
let SourceSecondSurfaceFeature, NewSecondSurfaceFeature(Feature)
SourceProfile->GetSecondSurface(SourceSecondSurfaceFeature)
let SourceFlangeOrientation, NewFlangeOrientation(Integer)
SourceProfile->GetFlangeOrientation(SourceFlangeOrientation)
let bRetrievedSecondSurface(Boolean)
bRetrievedSecondSurface = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceSecondSurfaceFeature, SourceFlangeOrientation, NewSecondSurfaceFeature, NewFlangeOrientation)
if(bRetrievedSecondSurface == FALSE)
{
iCopySpecification->CreateTransformedObject(SourceSecondSurfaceFeature, Destination, NewSecondSurfaceFeature, 0)
}
if(NewSecondSurfaceFeature <> NULL)
{
ResultProfile->SetSecondSurface(NewSecondSurfaceFeature)
ResultProfile->SetFlangeOrientation(NewFlangeOrientation)
}
}
else if(iProfileType == 6) //ProfileOnOpening
{
let SourceStiffenerOnFreeEdge(SldStiffenerOnFreeEdge)
set SourceStiffenerOnFreeEdge = SourceProfile
if(SourceStiffenerOnFreeEdge <> NULL)
{
let SourceSFEOpening, ResultSFEOpening(Feature)
SourceStiffenerOnFreeEdge->GetOpening(SourceSFEOpening)
let SourceSupportPanelFeature, ResultSupportPanelFeature(Feature)
set SourceSupportPanelFeature = SourceProfile.Owner
let NewResultSupportPanelFeature(Feature)
iCopySpecification->RetrieveNewObject(SourceSupportPanelFeature, NewResultSupportPanelFeature)
if(ResultSupportPanelFeature == NULL)
{
set ResultSupportPanelFeature = ResultProfile.Owner
if(NewResultSupportPanelFeature <> ResultSupportPanelFeature)
{
let SourceSupportPanel, ResultSupportPanel(SldPanel)
set SourceSupportPanel = SourceSupportPanelFeature
set ResultSupportPanel = NewResultSupportPanelFeature
let SourcePanelOpenings, ResultPanelOpening(List)
SourceSupportPanel->GetOpenings(SourcePanelOpenings, 0)
ResultSupportPanel->GetOpenings(ResultPanelOpening, 0)
let nbrSourcePanelOpening(Integer)
nbrSourcePanelOpening = SourcePanelOpenings->Size()
if(nbrSourcePanelOpening == ResultPanelOpening->Size())
{
let idxCnt(Integer)
set idxCnt = 1
for idxCnt while idxCnt <= nbrSourcePanelOpening
{
let SourceOpening(Feature)
SourceOpening = SourcePanelOpenings->GetItem(idxCnt)
if(SourceOpening == SourceSFEOpening)
{
let NewResultOpening(Feature)
NewResultOpening = ResultPanelOpening->GetItem(idxCnt)
let ResultStiffenerOnFreeEdge(SldStiffenerOnFreeEdge)
set ResultStiffenerOnFreeEdge = ResultProfile
if(ResultStiffenerOnFreeEdge <> NULL)
{
ResultStiffenerOnFreeEdge->SetOpening(NewResultOpening)
}
}
}
}
}
}
}
}
else if(iProfileType == 7) //ProfileOnLimit
{
let SourceStiffenerOnFreeEdge, ResultStiffenerOnFreeEdge(SldStiffenerOnFreeEdge)
set SourceStiffenerOnFreeEdge = SourceProfile
set ResultStiffenerOnFreeEdge = ResultProfile
if(SourceStiffenerOnFreeEdge<> NULL)
{
let SourceFirstSurface, NewFirstSurface(Feature)
let SourceSupportPanel(SldPanel)
set SourceSupportPanel = SourceProfile.Owner
if(SourceSupportPanel <> NULL)
{
SourceSupportPanel->GetSupport(SourceFirstSurface)
let SourceWebOrientation, NewWebOrientation(Integer)
SourceProfile->GetWebOrientation(SourceWebOrientation)
let bRetrievedFirstSurface(Boolean)
bRetrievedFirstSurface = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceFirstSurface, SourceWebOrientation, NewFirstSurface, NewWebOrientation)
if(bRetrievedFirstSurface == TRUE)
{
ResultProfile->SetWebOrientation(NewWebOrientation)
}
}
let lvSourceLimits, lvResultLimits(List)
SourceStiffenerOnFreeEdge->GetSupportLimits(lvSourceLimits)
ResultStiffenerOnFreeEdge->GetSupportLimits(lvResultLimits)
let SourceSupportLimit, NewSupportLimit(Feature)
if(lvSourceLimits->Size() == lvResultLimits->Size() and lvSourceLimits->Size() >= 1)
{
let lvNewResultLimits(List)
let SourceSupportOrientation, NewSupportOrientation(Integer)
SourceSupportOrientation = 0
set SourceSupportLimit = lvSourceLimits.GetItem(1)
let bRetrievedSupport(Boolean)
bRetrievedSupport = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceSupportLimit, SourceSupportOrientation, NewSupportLimit, NewSupportOrientation)
if(bRetrievedSupport == TRUE and NewSupportLimit <> NULL)
{
lvNewResultLimits->Append(NewSupportLimit)
ResultStiffenerOnFreeEdge->SetSupportLimits(lvNewResultLimits)
}
}
}
}
// Limit for all Profile types
// Compute Start Limit
let SourceStartLimit, NewStartLimit(Feature)
SourceProfile->GetLimitingObject(1, SourceStartLimit)
let SourceStartLimitOrientation, NewStartLimitOrientation(Integer)
SourceStartLimitOrientation = -1
let bRetrievedStartLimit(Boolean)
bRetrievedStartLimit = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceStartLimit, SourceStartLimitOrientation, NewStartLimit, NewStartLimitOrientation)
if(bRetrievedStartLimit == FALSE)
{
let SourceStartLimit_Function(SldFunction)
let SourceStartLimit_Panel(SldPanel)
set SourceStartLimit_Function = SourceStartLimit
set SourceStartLimit_Panel = SourceStartLimit
if(SourceStartLimit_Function <> NULL or SourceStartLimit_Panel <> NULL)
{
iCopySpecification->RetrieveNewObject(SourceStartLimit, NewStartLimit)
}
else
{
let NewLimit(Feature)
if(CopyMode == 1)
{
set NewLimit = new("Plane", SourceStartLimit.Name + "_" + iCopySpecification.Name, Destination)
let SourceSupportWireFrame, NewSupportWireFrame(Wireframe)
set SourceSupportWireFrame = SourceStartLimit
set NewSupportWireFrame = symmetry(SourceSupportWireFrame , SymmetryPlane)
set NewLimit = NewSupportWireFrame
}
else if(CopyMode == 2)
{
set NewLimit = new("Plane", SourceStartLimit.Name + "_" + iCopySpecification.Name, Destination)
let SourceSupportWireFrame, NewSupportWireFrame(Wireframe)
set SourceSupportWireFrame = SourceStartLimit
let SourcePlane(Plane)
set SourcePlane = SourcePlaneWF
set NewSupportWireFrame = translate(SourceSupportWireFrame , TranslateDirection, TranslateDistance)
set NewLimit = NewSupportWireFrame
}
if(NewLimit <> NULL)
set NewStartLimit = NewLimit
}
}
// Compute End Limit
let SourceEndLimit, NewEndLimit(Feature)
SourceProfile->GetLimitingObject(2, SourceEndLimit)
let SourceEndLimitOrientation, NewEndLimitOrientation(Integer)
SourceEndLimitOrientation = -1
let bRetrievedEndLimit(Boolean)
bRetrievedEndLimit = iCopySpecification->ComputeCandidatePlaneFromProjectData(SourceEndLimit, SourceEndLimitOrientation, NewEndLimit, NewEndLimitOrientation)
if(bRetrievedEndLimit == FALSE)
{
let SourceEndLimit_Function(SldFunction)
let SourceEndLimit_Panel(SldPanel)
set SourceEndLimit_Function = SourceEndLimit
set SourceEndLimit_Panel = SourceEndLimit
if(SourceEndLimit_Function <> NULL or SourceEndLimit_Panel <> NULL)
{
iCopySpecification->RetrieveNewObject(SourceEndLimit, NewEndLimit)
}
else
{
let NewLimit(Feature)
if(CopyMode == 1)
{
set NewLimit = new("Plane", SourceEndLimit.Name + "_" + iCopySpecification.Name, Destination)
let SourceSupportWireFrame, NewSupportWireFrame(Wireframe)
set SourceSupportWireFrame = SourceEndLimit
set NewSupportWireFrame = symmetry(SourceSupportWireFrame , SymmetryPlane)
set NewLimit = NewSupportWireFrame
}
else if(CopyMode == 2)
{
set NewLimit = new("Plane", SourceEndLimit.Name + "_" + iCopySpecification.Name, Destination)
let SourceSupportWireFrame, NewSupportWireFrame(Wireframe)
set SourceSupportWireFrame = SourceEndLimit
let SourcePlane(Plane)
set SourcePlane = SourcePlaneWF
set NewSupportWireFrame = translate(SourceSupportWireFrame , TranslateDirection, TranslateDistance)
set NewLimit = NewSupportWireFrame
}
if(NewLimit <> NULL)
set NewEndLimit = NewLimit
}
}
// Set Start and End Limit
if(NewStartLimit <> NULL and NewEndLimit <> NULL)
{
let rc_ProfileLimit(Boolean)
rc_ProfileLimit = ResultProfile->SetLimitingObjects(NewStartLimit, NewEndLimit)
if(rc_ProfileLimit == FALSE)
{
ResultProfile->InvertProfile()
ResultProfile->SetLimitingObjects(NewStartLimit, NewEndLimit)
}
}
else
{
if(NewStartLimit <> NULL)
{
ResultProfile->SetLimitingObject(1, NewStartLimit)
}
if(NewEndLimit <> NULL)
{
ResultProfile->SetLimitingObject(2, NewEndLimit)
}
}
// Reroute Profile Opening
let lvSourceOpenings, lvResultOpenings(List)
let OpeningType(Integer)
set OpeningType = 0
SourceProfile->GetOpenings(lvSourceOpenings, OpeningType)
ResultProfile->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(SldOpeningPr)
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 SourcePanel(Feature)
set SourcePanel = SourceProfile.Owner
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)
}
}
}
}
else if(SourceOpeningType == 2) // Standard Opening
{
let PositionStrategy(String)
PositionStrategy = SourceOpening.PositionStrategy
if(PositionStrategy == "CATStrPosMidDistOffsetProfile")
{
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)
}
}
}
if(PositionStrategy == "CATStrPosOffsetOffsetProfile")
{
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(bRetrievedU == TRUE)
{
ResultOpening->SetURef(NewURef)
ResultOpening->SetUOffsetSideOrientation(NewURefOrientation)
}
}
}
}
}
}
}
}
if(TranslationLine <> NULL)
TranslationLine->Delete()
}
| |||||||||||