SfmOpening (Object)

Defines Edition Techniques for Openings created using sketch and 3D Object.

Properties


Property CreationMode( iMode)
Returns or Sets the Opening Creation Mode. 0 for 3D Mode. 1 for Sketch Mode. 2 for StandardOpening Mode.
Example:
This example gets the Creation Mode for existing Opening.
 'Get the Existing Opening
 Dim OpeningPlate As SfmOpening
 Set OpeningPlate = part1.FindObjectByName("Opening_028")
 Dim Sel As Selection
 Set Sel = CATIA.ActiveDocument.Selection
 Sel.Add OpeningPlate 
 Dim OpenFact As SfmOpening
 Set OpenFact = Sel.FindObject("CATIASfmOpening")
 Dim CreationMode As Long
 CreationMode = OpenFact.CreationMode
 
Property Direction( iDirection)
Returns or Sets the Direction for a Wire Element Case.
Example:
This example modifies the direction of existing opening.
 'Get the element to be used as direction element.
 Set Dir = part1.FindObjectByName("Line.4")
 Set DirRef = part1.CreateReferenceFromObject(Dir)
 Opening1.Direction = DirRef
 
Property IntersectingElement( iIntersectingElement)
Returns or Sets the Intersecting Element to Create a Opening.
Example:
This example sets the intersecting element for the existing opening, after changing it's mode to sketch mode.
 'Get the Creation Mode for Existing Opening. The Existing Opening is created using 3D Mode.
  CreationMode = Opening1.CreationMode
 'Set the Creation Mode for Existing Opening to sketch mode
 Opening1.CreationMode = 1
 'Assign a new sketch to the existing opening
 Set Sketch = part1.FindObjectByName("Sketch.4")
 Set sketchref = part1.CreateReferenceFromObject(Sketch)
 Opening1.IntersectingElement = sketchref
 
Property MoldedSurface( iMoldedSurface)
Returns or Sets the Molded Surface for the Opening.
Example:
This example modifies the molded surface for the existing opening.
 'Get the Surface to be used as molded surface for the opening
 Dim GSDSurf As Reference
 Set GSDSurf = part1.FindObjectByName("Fill.1")
 Set GSDSurfref = part1.CreateReferenceFromObject(GSDSurf)
 Opening1.MoldedSurface = GSDSurfref
 

Methods


Func GetDirection() As
Gets the Direction for Opening in the form of Vector.
Parameters:
oDirection
[out] Direction vector
Returns:
S_OK if everything ran ok
Example:
This Example Gets the Direction for the Opening.
 Dim Dir() As Variant
 Dir = OpeningPlate.GetDirection
 Dim x, y, z As Double
 x = Dir(0)
 y = Dir(1)
 z = Dir(2)
 
Func IsAPlateOpening() As
Determines if it is a Plate Opening or a Profile one.
Parameters:
oStatus
[out] oStatus=0, if the Opening is on Plate oStatus=1, if the Opening is Not on Plate
Returns:
S_OK if everything ran ok
Example:
This Example Checks weather the opening is a Plate Opening.
 'Get the Existing Opening in the Part Document
 Dim OpeningPlate As SfmOpening
 Set OpeningPlate = part1.FindObjectByName("Opening_028")
 Dim Sel As Selection
 Set Sel = CATIA.ActiveDocument.Selection
 Sel.Add OpeningPlate 
 Dim OpenFact As SfmOpening
 Set OpenFact = Sel.FindObject("CATIASfmOpening")
 'Get the Status of Opening
 Dim status As Long
 status = OpenFact.IsAPlateOpening
 
Sub SetMasterMode()
Sets Master mode on Copy Pasted Opening. It breaks the dependency by duplicating the sketch.
Returns:
S_OK if everything ran ok
Example:
This Example Sets Master Mdoe on a Copy Pasted Opening.
 Dim OpeningMaster As SfmOpening
 Set OpeningMaster = part1.FindObjectByName("Opening_035")
 Dim Sel As Selection
 Set Sel = CATIA.ActiveDocument.Selection
 Sel.Add OpeningMaster 
 Dim OpenFact As SfmOpening
 Set OpenFact = Sel.FindObject("CATIASfmOpening")
 OpenFact.SetMasterMode