Cross Sections
The methods in this section enable you to create, access, modify, and delete cross sections.
Listing Cross Sections
Methods Introduced:
The method pfcSolid.Solid.ListCrossSections returns a sequence of cross section objects represented by the Xsection interface. The method pfcSolid.Solid.GetCrossSection searches for a cross section given its name.
The method pfcXSection.XSection.GetName returns the name of the cross section in the Creo application. The method pfcXSection.XSection.SetName modifies the cross section name.
The method pfcXSection.XSection.GetXSecType returns the type of cross section as a XSecCutType object, that is planar or offset, and the type of item intersected by the cross section.
The method pfcXSection.XSecType.GetType returns the type of intersection for the cross section using the enumerated type XSecCutType. The valid values are:
•  XSEC_PLANAR
•  XSEC_OFFSET
The method pfcXSection.XSecType.GetObjectType returns the type of item intersected by the cross section using the enumerated type XSecCutobjType. The valid values are:
•  XSECTYPE_MODEL—Specifies that the cross section was created on solid geometry.
•  XSECTYPE_QUILTS—Specifies that the cross section was created on one quilt surface.
•  XSECTYPE_MODELQUILTS—Specifies that the cross section was created on solid geometry and all quilt surfaces.
•  XSECTYPE_ONEPART—Specifies that the cross section was created on one component in the assembly.
The method pfcXSection.XSection.Delete deletes a cross section.
The method pfcXSection.XSection.Display forces a display of the cross section in the window.
The method pfcXSection.XSection.Regenerate regenerates a cross section.
Extracting Cross-Sectional Geometry
Methods Introduced:
Superseded Methods:
The geometry of a cross section in an assembly is divided into components. Each component corresponds to one of the parts in the assembly that is intersected by the cross section, and describes the geometry of that intersection. A component can have disjoint geometry if the cross section intersects a given part instance in more than one place.
A cross section in a part has a single component.
The components of a cross section are identified by consecutive integer identifiers that always start at 0.
In Creo 7.0.0.0 and later, the method wfcXSection.WXSection.CollectGeometry is deprecated. Use the method wfcXSection.WXSection.CollectCutComponents instead.
The method wfcXSection.WXSection.CollectCutComponents returns the object wfcXSection.XSectionCutComponent that contains the geometry of all cut components in a specified cross section. A sequence item is created for each body. If no bodies are created, the method returns one XSectionCutComponent object for each component. wfcXSection.XSectionCutComponents retrieves information from the wfcXSection.XSectionCutComponent object.
Note
The method returns only items containing solid geometry (nonquilt and nonfacetrep) components that intersect their nonhidden, nonsuppressed parts and are inside view borders. If the input argument drawing view is null, the method returns all nonempty components.
The method wfcXSection.WXSection.GetExcludedItems returns paths to the exclude or include components and bodies of the specified cross section using the object wfcXSection.XSectionExcludeItems.
The method wfcXSection.XSectionCutComponentItem.GetType returns the type of item - body or quilt.
The method wfcXSection.XSectionCutComponentItem.GetId returns the Id of the body or the quilt being cut.
The method wfcXSection.XSectionCutComponentItem.GetGeometry returns the surface geometry created by the cross section by cutting specific body or quilt.
The method wfcXSection.XSectionCutComponentItem.SetXHatchStyle sets the cross section xhatch style of the body. If the xhatch style exists in the session, it will be set.
The method wfcXSection.XSectionCutComponentItem.GetXHatchStyle returns the cross section xhatch style of the body.
The method wfcXSection.XSectionCutComponent.GetCutItems returns the items (body or quilt) that are cut on the component.
The method wfcXSection.XSectionCutComponent.GetPath returns the path to the component being cut by the cross section.
The method wfcXSection.XSectionCutComponent.SetXHatchStyle sets the cross section xhatch style on the component. If the xhatch style exists in the session, it will be set.
The method wfcXSection.XSectionCutComponent.GetXHatchStyle returns the cross section xhatch style of the component.
The method wfcXSection.XSectionExcludeItems_Create creates the interface for excluded items using the wfcXSection.XSectionExcludeItems object. The input arguments follow:
•  Items—The component or bodies selections.
•  ExcludeTrue if excluded, False if not.
The methods wfcXSection.XSectionExcludeItems.GetExclude and wfcXSection.XSectionExcludeItems.SetExclude get and set the flag to exclude or include items in the cross section.
The methods wfcXSection.XSectionExcludeItems.GetItems and wfcXSection.XSectionExcludeItems.SetItems get and set the items to exclude or include in the cross section.
The method wfcXSection.XSectionGeometry.GetGeometry returns the geometry of all components in the specified cross section as Surface object. Use the methods wfcXSection.XSectionGeometry.GetMemberIdTable and wfcXSection.XSectionGeometry.GetQuiltId to get the component and quilt identifiers in the specified cross section.
The method wfcXSection.WXSection.GetPlane returns the plane geometry for a specified cross section.
The method wfcXSection.WXSection.GetOffsetXSectionData returns the parameters for a specified offset cross section.
The method wfcXSection.WXSection.GetFlip returns a boolean value that indicates the direction in which the cross section has been clipped. The value Falseindicates that the cross section has been clipped in the direction of the positive normal to the cross section plane. True indicates that the cross section has been clipped in the opposite direction of the positive normal.
The method wfcXSection.WXSection.GetComponents returns an array of paths to the assembly components that have been included or excluded for the specified cross section.
The methods wfcXSection.WXSection.GetName and wfcXSection.WXSection.SetName enable you to retrieve and rename the name of a cross section in an assembly, respectively.
The method wfcXSection.XSectionComponents.GetExclude specifies if the assembly components were excluded or not.
The method wfcXSection.XSectionComponents.SetExclude specifies if the assembly components are to be excluded or not.
The methods wfcXSection.XSectionComponents.GetComponents and wfcXSection.XSectionComponents.SetComponents get and set the sequence of components that have been included or excluded for the specified cross section definition.
The method wfcXSection.ZoneXSectionGeometry.GetGeometries returns the geometry information of a zone feature in the specified cross section as wfcXSection.XSectionGeometries object.
The method wfcXSection.OffsetXSectionData.GetXSectionLines returns information about the line segment entities in the cross section as a wfcSectionEntityLine object.
The method wfcXSection.OffsetXSectionData.GetPlaneData returns information about the entity datum plane.
The method wfcXSection.OffsetXSectionData.GetOneSided returns true if the cross section lies on one side of the entity plane. The method returns false if the cross section is both-sided.
If the output argument of the method wfcXSection.OffsetXSectionData.GetFlip is False, the Creo application removes material from the left of the cross section entities if the viewing direction is from the positive side of the entity plane and if wfcXSection.OffsetXSectionData.GetOneSided is true, the Creo application removes only the material from positive side of the entity plane.
Creating and Modifying Cross Sections
Methods Introduced:
The method wfcSolid.WSolid.CreateParallelXSection creates a cross section feature parallel to a given plane.
From Creo 7.0.0.0 and later, the method wfcSolid.WSolid.CreatePlanarXSection is deprecated. Use the method wfcSolid.WSolid.CreatePlanarXSectionWithOptions instead.
The method wfcSolid.WSolid.CreatePlanarXSectionWithOptions creates a cross section feature through a datum plane and also makes the cross section visible. The input arguments follow:
•  Name —Name of the cross section.
•  Plane —The cutting plane. The cutting plane must belong to the model.
•  CutObjectType—Type of the object that will be cut by the cross section. It is specified by the enumerated type pfcXSection.XSecCutobjType.
•  QuiltOrPart—Specifies the selection of the quilt or component.
•  Flip—Direction in which the cross section will be clipped. The value 1 indicates that the cross section will be clipped in the direction of the positive normal to the cutting plane. -1 indicates that the cross section will be clipped in the opposite direction of the positive normal.
•  ExcludeItems—Selection of selected bodies or parts to be included or excludes from the cross section defined by the class wfcXSection.XSectionExcludeItems.
•  Data—Reserved for future use.
Note
•  The legacy cross sections, that is, the cross sections created in Pro/ENGINEER, Creo Elements/Pro, and in releases prior to Creo Parametric 2.0 are not supported.
•  The methods wfcSolid.WSolid.CreateParallelXSection and wfcSolid.WSolid.CreatePlanarXSection automatically convert the legacy cross sections to new cross section features as defined in Creo Parametric 2.0 onward, before creating any new cross section feature.
Use the method wfcModel.WModel.CanCreateSectionFeature to check if new cross section features can be created in the specified model. The method returns false if the specified model has legacy cross sections.
The method wfcModel.WModel.ConvertOldXSectionsToNew converts the legacy cross sections to new cross section features as defined in Creo Parametric2.0 onward for the specified model.
Use the method wfcXSection.WXSection.IsFeature to check whether the cross section is a feature.
The method wfcXSection.WXSection.GetFeature returns a Feature object representing the cross section feature. You must use this method only if wfcModel.WModel.CanCreateSectionFeature returns true.
Use the method wfcXSection.XSectionComponents_Create to create the object wfcXSection.XSectionComponents that contains interface for excluding or including components from a specified cross section. Pass the following values to this object:
•  Components—Specify the sequence of components to exclude or include from a cross section definition.
•  Exclude—Specify the value as true to exclude components and false to include.
Mass Properties of Cross Sections
Method Introduced:
The method wfcXSection.WXSection.GetMassProperty calculates the mass properties of the cross-section in the specified coordinate system. The method needs the name of a coordinate system datum whose X- and Y-axes are parallel to the cross section. The output from this method also refers to the coordinate system datum.
Note
•  The method wfcXSection.WXSection.GetMassProperty is not supported for offset and quilt type of cross-sections.
•  The following methods can be called on MassProperty object returned by wfcXSection.WXSection.GetMassProperty:
  pfcSolid.Solid.MassProperty
  pfcSolid.MassProperty.GetSurfaceArea
  pfcSolid.MassProperty.SetSurfaceArea
  pfcSolid.MassProperty.GetGravityCenter
  pfcSolid.MassProperty.SetGravityCenter
  pfcSolid.MassProperty.GetCoordSysInertia
  pfcSolid.MassProperty.SetCoordSysInertia
Line Patterns of Cross Section Components
Methods Introduced:
  • wfcXSection.WXSection.GetCompXSectionHatches
  • wfcXSection.WXSection.SetCompXSectionHatches
  • wfcXSection.wfcXSection.XSectionHatch_Create
  • wfcXSection.XSectionHatch.GetAngle
  • wfcXSection.XSectionHatch.SetAngle
  • wfcXSection.XSectionHatch.GetSpacing
  • wfcXSection.XSectionHatch.SetSpacing
  • wfcXSection.XSectionHatch.GetOffset
  • wfcXSection.XSectionHatch.SetOffset
  • wfcXSection.XSectionHatchStyle.GetType
  • wfcXSection.XSectionHatchStyle.SetType
  • wfcXSection.XSectionHatchStyle.GetOldHatches
  • wfcXSection.XSectionHatchStyle.SetOldHatches
  • wfcXSection.XSectionHatchStyle.GetNewHatches
  • wfcXSection.XSectionHatchStyle.SetNewHatches
  • wfcXSection.XSectionNewHatch_Create
  • wfcXSection.XSectionNewHatch.GetAngle
  • wfcXSection.XSectionNewHatch.SetAngle
  • wfcXSection.XSectionNewHatch.GetXOrigin
  • wfcXSection.XSectionNewHatch.SetXOrigin
  • wfcXSection.XSectionNewHatch.GetYOrigin
  • wfcXSection.XSectionNewHatch.SetYOrigin
  • wfcXSection.XSectionNewHatch.GetXDelta
  • wfcXSection.XSectionNewHatch.SetXDelta
  • wfcXSection.XSectionNewHatch.GetYDelta
  • wfcXSection.XSectionNewHatch.SetYDelta
  • wfcXSection.XSectionNewHatch.GetDash
  • wfcXSection.XSectionNewHatch.SetDash
  • wfcXSection.XSectionNewHatch.GetColor
  • wfcXSection.XSectionNewHatch.SetColor
  • wfcXSection.XSectionOldHatch_Create
  • wfcXSection.XSectionOldHatch.GetAngle
  • wfcXSection.XSectionOldHatch.SetAngle
  • wfcXSection.XSectionOldHatch.GetSpacing
  • wfcXSection.XSectionOldHatch.SetSpacing
  • wfcXSection.XSectionOldHatch.GetOffset
  • wfcXSection.XSectionOldHatch.SetOffset
  • wfcXSection.XSectionOldHatch.GetFont
  • wfcXSection.XSectionOldHatch.SetFont
  • wfcXSection.XSectionOldHatch.GetColor
  • wfcXSection.XSectionOldHatch.SetColor
  • The method wfcXSection.WXSection.GetCompXSectionHatches returns the line patterns of a cross section as a XSectionHatches object. The input arguments to the method are the ID of the cross section component and the drawing view containing the cross section component. The information related to line patterns is obtained from XSectionHatch. Use the method wfcXSection.WXSection.SetCompXSectionHatches to set the line patterns for a cross section.
    The method wfcXSection.wfcXSection.XSectionHatch_Create creates a data object that contains information about the line patterns.
    Use the methods wfcXSection.XSectionHatch.GetAngle and wfcXSection.XSectionHatch.SetAngle to get and set the angle in the line patterns.
    The methods wfcXSection.XSectionHatch.GetSpacing and wfcXSection.XSectionHatch.SetSpacing get and set the distance between the line patterns.
    The methods wfcXSection.XSectionHatch.GetOffset and wfcXSection.XSectionHatch.SetOffset get and set the offset of the first line in the pattern.
    The methods wfcXSection.XSectionHatchStyle.GetType and wfcXSection.XSectionHatchStyle.SetType get and set the type of the hatch style.
    The methods wfcXSection.XSectionHatchStyle.GetOldHatches and wfcXSection.XSectionHatchStyle.SetOldHatches get and set the old line hatch object sequence using the object wfcXSection.XSectionOldHatches.
    The methods wfcXSection.XSectionHatchStyle.GetNewHatches and wfcXSection.XSectionHatchStyle.SetNewHatches get and set the new line hatch object sequence using the object wfcXSection.XSectionNewHatches.
    The method wfcXSection.XSectionNewHatch_Create creates the interface for new line pattern hatching using the wfcXSection.XSectionNewHatch object. The input arguments follow:
    •  Angle—Angle for new line pattern.
    •  Color—Color for new line pattern.
    The methods wfcXSection.XSectionNewHatch.GetAngle and wfcXSection.XSectionNewHatch.SetAngle get and set the angle for new line pattern.
    The methods wfcXSection.XSectionNewHatch.GetXOrigin and wfcXSection.XSectionHatchStyle.SetXOrigin get and set the X origin for the new line pattern.
    The methods wfcXSection.XSectionNewHatch.GetYOrigin and wfcXSection.XSectionNewHatch.SetYOrigin get and set the Y origin for the new line pattern.
    The methods wfcXSection.XSectionNewHatch.GetXDelta and wfcXSection.XSectionNewHatch.SetXDelta get and set the X delta for the new line pattern.
    The methods wfcXSection.XSectionNewHatch.GetYDelta and wfcXSection.XSectionNewHatch.SetYDelta get and set the Y delta for the new line pattern.
    The methods wfcXSection.XSectionNewHatch.GetDash and wfcXSection.XSectionNewHatch.SetDash get and set the dash for the new line pattern.
    The methods wfcXSection.XSectionNewHatch.GetColor and wfcXSection.XSectionNewHatch.SetColor get and set the color for the new line pattern.
    The method wfcXSection.XSectionOldHatch_Create creates the interface for old line pattern hatching using the wfcXSection.XSectionOldHatch object. The input argument Angle is the angle for old line pattern.
    The methods wfcXSection.XSectionOldHatch.GetAngle and wfcXSection.XSectionOldHatch.SetAngle get and set the angle for old line pattern.
    The methods wfcXSection.XSectionOldHatch.GetSpacing and wfcXSection.XSectionOldHatch.SetSpacing get and set the spacing for the old line pattern.
    The methods wfcXSection.XSectionOldHatch.GetOffset and wfcXSection.XSectionOldHatch.SetOffset get and set the offset for the old line pattern.
    The methods wfcXSection.XSectionOldHatch.GetFont and wfcXSection.XSectionOldHatch.SetFont get and set the font for the old line pattern.
    The methods wfcXSection.XSectionOldHatch.GetColor and wfcXSection.XSectionOldHatch.SetColor get and set the color for the old line pattern.