Drawings
This section describes how to program drawing functions using Creo.JS.
Overview of Drawings in Creo.JS
This section describes the functions that deal with drawings. You can create drawings of all Creo Parametric models using the functions in Creo.JS. You can annotate the drawing, manipulate dimensions, and use layers to manage the display of different items.
Unless otherwise specified, Creo.JS functions that operate on drawings use world units.
Creating Drawings from Templates
Drawing templates simplify the process of creating a drawing using Creo.JS. Creo Parametric can create views, set the view display, create snap lines, and show the model dimensions based on the template. Use templates to:
•  Define layout views
•  Set view display
•  Place notes
•  Place symbols
•  Define tables
•  Show dimensions
Method Introduced:
  • pfcBaseSession.CreateDrawingFromTemplate()
  • Use the method pfcBaseSession.CreateDrawingFromTemplate() to create a drawing from the drawing template and to return the created drawing. The input parameters are:
    •  Name—New drawing name
    •  Template—Name of an existing template
    •  DrawingModel—Name and type of the solid model to use while populating template views
    •  Options—Sequence of options defined by the enumerated type pfcDrawingCreateOption to create the drawing. The options are as follows:
      DRAWINGCREATE_DISPLAY_DRAWING—Display the new drawing.
      DRAWINGCREATE_SHOW_ERROR_DIALOG—Display the error dialog box.
      DRAWINGCREATE_WRITE_ERROR_FILE—Write the errors to a file.
      DRAWINGCREATE_PROMPT_UNKNOWN_PARAMS—Prompt the user on encountering unknown parameters
    Drawing Creation Errors
    The exception pfcXToolkitDrawingCreateErrors is thrown if an error is encountered when creating a drawing from a template. This exception contains a list of errors which occurred during drawing creation.
    Note
    When this exception type is encountered, the drawing is actually created, but some of the contents failed to generate correctly.
    The exception message will list the details for each error including its type, sheet number, view name, and (if applicable) item name. The types of errors are as follows:
    •  DWGCREATE_ERR_SAVED_VIEW_DOESNT_EXIST—Saved view does not exist.
    •  DWGCREATE_ERR_X_SEC_DOESNT_EXIST—Specified cross section does not exist.
    •  DWGCREATE_ERR_EXPLODE_DOESNT_EXIST—Exploded state did not exist.
    •  DWGCREATE_ERR_MODEL_NOT_EXPLODABLE—Model cannot be exploded.
    •  DWGCREATE_ERR_SEC_NOT_PERP—Cross section view not perpendicular to the given view.
    •  DWGCREATE_ERR_NO_RPT_REGIONS—Repeat regions not available.
    •  DWGCREATE_ERR_FIRST_REGION_USED—Repeat region was unable to use the region specified.
    •  DWGCREATE_ERR_NOT_PROCESS_ASSEM— Model is not a process assembly view.
    •  DWGCREATE_ERR_NO_STEP_NUM—The process step number does not exist.
    •  DWGCREATE_ERR_TEMPLATE_USED—The template does not exist.
    •  DWGCREATE_ERR_NO_PARENT_VIEW_FOR_PROJ—There is no possible parent view for this projected view.
    •  DWGCREATE_ERR_CANT_GET_PROJ_PARENT—Could not get the projected parent for a drawing view.
    •  DWGCREATE_ERR_SEC_NOT_PARALLEL—The designated cross section was not parallel to the created view.
    •  DWGCREATE_ERR_SIMP_REP_DOESNT_EXIST—The designated simplified representation does not exist.
    Obtaining Drawing Models
    This section describes how to obtain drawing models.
    Methods Introduced:
  • pfcBaseSession.RetrieveModel()
  • pfcBaseSession.GetModel()
  • pfcBaseSession.GetModelFromDescr()
  • pfcBaseSession.ListModels()
  • pfcBaseSession.ListModelsByType()
  • The method pfcBaseSession.RetrieveModel() retrieves the drawing specified by the model descriptor. Model descriptors are data objects used to describe a model file and its location in the system. The method returns the retrieved drawing.
    The method pfcBaseSession.GetModel() returns a drawing based on its name and type, whereas pfcBaseSession.GetModelFromDescr() returns a drawing specified by the model descriptor. The model must be in session.
    Use the method pfcBaseSession.ListModels() to return a list of objects in a session.
    Use the method pfcBaseSession.ListModelsByType() to return a list of all the drawings of a particular type in session.
    Drawing Information
    Methods and Properties Introduced:
  • pfcModel2D.ListModels()
  • pfcModel2D.GetCurrentSolid()
  • pfcModel2D.ListSimplifiedReps()
  • pfcModel2D.TextHeight
  • The method pfcModel2D.ListModels() returns a list of all the solid models used in the drawing.
    The method pfcModel2D.GetCurrentSolid() returns the current solid model of the drawing.
    The method pfcModel2D.ListSimplifiedReps() returns the simplified representations of a solid model that are assigned to the drawing.
    The property pfcModel2D.TextHeight returns the text height of the drawing.
    Drawing Operations
    Methods Introduced:
  • pfcModel2D.AddModel()
  • pfcModel2D.DeleteModel()
  • pfcModel2D.ReplaceModel()
  • pfcModel2D.SetCurrentSolid()
  • pfcModel2D.AddSimplifiedRep()
  • pfcModel2D.DeleteSimplifiedRep()
  • pfcModel2D.Regenerate()
  • pfcModel2D.CreateDrawingDimension()
  • pfcModel2D.CreateView()
  • The method pfcModel2D.AddModel() adds a new solid model to the drawing.
    The method pfcModel2D.DeleteModel() removes a model from the drawing. The model to be deleted should not appear in any of the drawing views.
    The method pfcModel2D.ReplaceModel() replaces a model in the drawing with a related model. The relationship should be by family table or interchange assembly.You can replace models that are shown in drawing views and regenerates the view.
    The method pfcModel2D.SetCurrentSolid() assigns the current solid model for the drawing. Before calling this method, the solid model must be assigned to the drawing using the methods pfcModel2D.AddModel(). To see the changes to parameters and fields reflecting the change of the current solid model, regenerate the drawing using the method pfcSheetOwner.RegenerateSheet().
    The method pfcModel2D.AddSimplifiedRep() associates the drawing with the simplified representation of an assembly
    The method pfcModel2D.DeleteSimplifiedRep() removes the association of the drawing with an assembly simplified representation. The simplified representation to be deleted should not appear in any of the drawing views.
    Use the method pfcModel2D.Regenerate() to regenerate the drawing draft entities and appearance.
    The method pfcModel2D.CreateDrawingDimension() creates a new drawing dimension based on the data object that contains information about the location of the dimension. This method returns the created dimension. Refer to the section Drawing Dimensions.
    The method pfcModel2D.CreateView() creates a new drawing view based on the data object that contains information about how to create the view. The method returns the created drawing view. Refer to the section Creating Drawing Views.
    Drawing Sheets
    A drawing sheet is represented by its number. Drawing sheets in Creo.JS are identified by the same sheet numbers seen by a Creo Parametric user.
    Note
    These identifiers may change if the sheets are moved as a consequence of adding, removing or reordering sheets.
    Drawing Sheet Information
    Methods and Properties Introduced
  • pfcSheetOwner.GetSheetTransform()
  • pfcSheetOwner.GetSheetInfo()
  • pfcSheetOwner.GetSheetScale()
  • pfcSheetOwner.GetSheetFormat()
  • pfcSheetOwner.GetSheetFormatDescr()
  • pfcSheetOwner.GetSheetBackgroundView
  • pfcSheetOwner.NumberOfSheets
  • pfcSheetOwner.CurrentSheetNumber
  • pfcSheetOwner.GetSheetUnits()
  • The method pfcSheetOwner.GetSheetTransform() returns the transformation matrix for the sheet specified by the sheet number. This transformation matrix includes the scaling needed to convert screen coordinates to drawing coordinates (which use the designated drawing units).
    The method pfcSheetOwner.GetSheetInfo() returns sheet data including the size, orientation, and units of the sheet specified by the sheet number.
    Use the method pfcSheetOwner.GetSheetInfo() and the class pfcSheetInfo.
    The method pfcSheetOwner.GetSheetScale() returns the scale of the drawing on a particular sheet based on the drawing model used to measure the scale. If no models are used in the drawing then the default scale value is 1.0.
    The method pfcSheetOwner.GetSheetFormat() returns the drawing format used for the sheet specified by the sheet number. It returns a null value if no format is assigned to the sheet.
    The method pfcSheetOwner.GetSheetFormatDescr() returns the model descriptor of the drawing format used for the specified drawing sheet.
    The method pfcSheetOwner.GetSheetBackgroundView returns the view object representing the background view of the sheet specified by the sheet number.
    The property pfcSheetOwner.NumberOfSheets returns the number of sheets in the model.
    The property pfcSheetOwner.CurrentSheetNumber returns the current sheet number in the model.
    Note
    The sheet numbers range from 1 to n, where n is the number of sheets.
    The method pfcSheetOwner.GetSheetUnits() returns the units used by the sheet specified by the sheet number.
    Drawing Sheet Operations
    Methods Introduced:
  • pfcSheetOwner.AddSheet()
  • pfcSheetOwner.DeleteSheet()
  • pfcSheetOwner.ReorderSheet()
  • pfcSheetOwner.RegenerateSheet()
  • pfcSheetOwner.SetSheetScale()
  • pfcSheetOwner.SetSheetFormat()
  • The method pfcSheetOwner.AddSheet() adds a new sheet to the model and returns the number of the new sheet.
    The method pfcSheetOwner.DeleteSheet() removes the sheet specified by the sheet number from the model.
    Use the method pfcSheetOwner.ReorderSheet() to reorder the sheet from a specified sheet number to a new sheet number.
    Note
    The sheet number of other affected sheets also changes due to reordering or deletion.
    The method pfcSheetOwner.RegenerateSheet() regenerates the sheet specified by the sheet number.
    Note
    You can regenerate a sheet only if it is displayed.
    Use the method pfcSheetOwner.SetSheetScale() to set the scale of a model on the sheet based on the drawing model to scale and the scale to be used. Pass the value of the DrawingModel parameter as null to select the current drawing model.
    Use the method pfcSheetOwner.SetSheetFormat() to apply the specified format to a drawing sheet based on the drawing format, sheet number of the format, and the drawing model.
    The sheet number of the format is specified by the FormatSheetNumber parameter. This number ranges from 1 to the number of sheets in the format. Pass the value of this parameter as null to use the first format sheet.
    The drawing model is specified by the DrawingModel parameter. Pass the value of this parameter as null to select the current drawing model.
    Drawing Views
    A drawing view is represented by the class pfcView2D. All model views in the drawing are associative, that is, if you change a dimensional value in one view, other drawing views are updated accordingly. The model automatically reflects any dimensional changes that you make to a drawing. In addition, corresponding drawings also reflect any changes that you make to a model such as the addition or deletion of features and dimensional changes.
    Creating Drawing Views
    Method Introduced:
  • pfcModel2D.CreateView()
  • The method pfcModel2D.CreateView() creates a new view in the drawing. Before calling this method, the drawing appear in a window.
    The class pfcView2DCreateInstructions contains details on how to create the view.
    General Drawing Views
    The class pfcGeneralViewCreateInstructions contains details on how to create general drawing views.
    Methods and Properties Introduced:
  • pfcGeneralViewCreateInstructions.Create()
  • pfcGeneralViewCreateInstructions.ViewModel
  • pfcGeneralViewCreateInstructions.Location
  • pfcGeneralViewCreateInstructions.SheetNumber
  • pfcGeneralViewCreateInstructions.Orientation
  • pfcGeneralViewCreateInstructions.Exploded
  • pfcGeneralViewCreateInstructions.Scale
  • pfcGeneralViewCreateInstructions.ViewScale
  • The method pfcGeneralViewCreateInstructions.Create() creates the pfcGeneralViewCreateInstructions data object used for creating general drawing views.
    Use the property pfcGeneralViewCreateInstructions.ViewModel to assign the solid model to display in the created general drawing view.
    Use the property pfcGeneralViewCreateInstructions.Location to assign the location in a drawing sheet to place the created general drawing view.
    Use the property pfcGeneralViewCreateInstructions.SheetNumber to set the number of the drawing sheet in which the general drawing view is created.
    The property pfcGeneralViewCreateInstructions.Orientation assigns the orientation of the model in the general drawing view in the form of the pfcTransform3D data object. The transformation matrix must only consist of the rotation to be applied to the model. It must not consist of any displacement or scale components. If necessary, set the displacement to {0, 0, 0} using the property pfcTransform3D.SetOrigin, and remove any scaling factor by normalizing the matrix.
    Use the property pfcGeneralViewCreateInstructions.Exploded to set the created general drawing view to be an exploded view.
    Use the property pfcGeneralViewCreateInstructions.Scale to assign a scale to the created general drawing view. This value is optional, if not assigned, the default drawing scale is used.
    Use the property pfcGeneralViewCreateInstructions.ViewScale to assign a scale to the created general drawing view. This value is optional, if not assigned, the default drawing scale is used.
    Projected Drawing Views
    The classpfcProjectionViewCreateInstructions contains details on how to create general drawing views.
    Methods and Properties Introduced:
  • pfcProjectionViewCreateInstructions.Create()
  • pfcProjectionViewCreateInstructions.ParentView
  • pfcProjectionViewCreateInstructions.Location
  • pfcProjectionViewCreateInstructions.Exploded
  • The method pfcProjectionViewCreateInstructions.Create() creates the pfcProjectionViewCreateInstructions data object used for creating projected drawing views.
    Use the property pfcProjectionViewCreateInstructions.ParentView to assign the parent view for the projected drawing view.
    Use the property pfcProjectionViewCreateInstructions.Location to assign the location of the projected drawing view. This location determines how the drawing view is oriented.
    Use the property pfcProjectionViewCreateInstructions.Exploded to set the created projected drawing view to be an exploded view.
    Obtaining Drawing Views
    Methods and Properties Introduced:
  • pfcSelection.SelView2D
  • pfcModel2D.List2DViews()
  • pfcModel2D.GetViewByName()
  • pfcModel2D.GetViewDisplaying()
  • pfcSheetOwner.GetSheetBackgroundView
  • The property pfcSelection.SelView2D returns the selected drawing view, if the user selected an item from a drawing view. It returns a null value if the selection does not contain a drawing view.
    The method pfcModel2D.List2DViews() lists and returns the drawing views found. This method does not include the drawing sheet background views returned by the property pfcSheetOwner.GetSheetBackgroundView.
    The method pfcModel2D.GetViewByName() returns the drawing view based on the name. This method returns a null value if the specified view does not exist.
    The method pfcModel2D.GetViewDisplaying() returns the drawing view that displays a dimension. This method returns a null value if the dimension is not displayed in the drawing.
    Note
    This method works for solid and drawing dimensions.
    The method pfcSheetOwner.GetSheetBackgroundView returns the drawing sheet background views.
    Drawing View Information
    Methods and Properties Introduced:
  • pfcChild.DBParent
  • pfcView2D.GetSheetNumber()
  • pfcView2D.IsBackground
  • pfcView2D.GetModel()
  • pfcView2D.Scale
  • pfcView2D.GetIsScaleUserdefined()
  • pfcView2D.Outline
  • pfcView2D.GetLayerDisplayStatus()
  • pfcView2D.IsViewdisplayLayerDependent
  • pfcView2D.Display
  • pfcViewDisplay.CableStyle
  • pfcViewDisplay.Create()
  • pfcViewDisplay.RemoveQuiltHiddenLines
  • pfcViewDisplay.ShowConceptModel
  • pfcViewDisplay.ShowWeldXSection
  • pfcViewDisplay.Style
  • pfcViewDisplay.TangentStyle
  • pfcView2D.GetTransform
  • pfcView2D.Name
  • pfcView2D.GetSimpRep()
  • The inherited property pfcChild.DBParent, when called on a pfcView2D object, provides the drawing model which owns the specified drawing view. The return value of the method can be cascaded to a pfcModel2D object.
    Note
    The property pfcChild.OId is reserved for internal use.
    The method pfcView2D.GetSheetNumber() returns the sheet number of the sheet that contains the drawing view.
    The property pfcView2D.IsBackground returns a value that indicates whether the view is a background view or a model view.
    The method pfcView2D.GetModel() returns the solid model displayed in the drawing view.
    The property pfcView2D.Scale returns the scale of the drawing view.
    The method pfcView2D.GetIsScaleUserdefined() specifies if the drawing has a user-defined scale.
    The property pfcView2D.Outline returns the position of the view in the sheet in world units.
    The method pfcView2D.GetLayerDisplayStatus() returns the display status of the specified layer in the drawing view.
    The property pfcView2D.IsViewdisplayLayerDependent returns a value that indicates if the display is dependent on the layer.
    The property pfcView2D.Display returns an output structure that describes the display settings of the drawing view.
    The property pfcViewDisplay.Style returns the display style for hidden lines.
    The property pfcViewDisplay.TangentStyle returns the display style for tangent lines.
    The property pfcViewDisplay.CableStyle returns the display style for cables.
    The property pfcViewDisplay.RemoveQuiltHiddenLines returns the display style for quilt hidden lines.
    The property pfcViewDisplay.ShowConceptModel returns the display style for skeleton model.
    The property pfcViewDisplay.ShowWeldXSection returns the display style for weld cross sections.
    The property pfcView2D.GetTransform returns a matrix that describes the transform between 3D solid coordinates and 2D world units for that drawing view. The transformation matrix is a combination of the following factors:
    •  The location of the view origin with respect to the drawing origin.
    •  The scale of the view units with respect to the drawing units
    •  The rotation of the model with respect to the drawing coordinate system.
    The property pfcView2D.Name returns the name of the specified view in the drawing.
    The simplified representations of assembly and part can be used as drawing models to create general views. Use the method pfcView2D.GetSimpRep() to retrieve the simplified representation for the specified view in the drawing.
    Drawing Views Operations
    Methods Introduced:
  • pfcView2D.Translate()
  • pfcView2D.Delete()
  • pfcView2D.Regenerate()
  • pfcView2D.SetLayerDisplayStatus()
  • The method pfcView2D.Translate() moves the drawing view by the specified transformation vector.
    The method pfcView2D.Delete() deletes a specified drawing view. Set the DeleteChildren parameter to true to delete the children of the view. Set this parameter to false or null to prevent deletion of the view if it has children.
    The method pfcView2D.Regenerate() erases the displayed view of the current object, regenerates the view from the current drawing, and redisplays the view.
    The method pfcView2D.SetLayerDisplayStatus() sets the display status for the layer in the drawing view.
    Drawing Dimensions
    This section describes the Creo.JS methods that give access to the types of dimensions that can be created in the drawing mode. They do not apply to dimensions created in the solid mode, either those created automatically as a result of feature creation, or reference dimension created in a solid. A drawing dimension or a reference dimension shown in a drawing is represented by the class pfcDimension2D.
    Obtaining Drawing Dimensions
    Methods and Properties Introduced:
  • pfcModelItemOwner.ListItems()
  • pfcModelItemOwner.GetItemById()
  • pfcModelItemOwner.GetItemByName()
  • pfcSelection.SelItem
  • The method pfcModelItemOwner.ListItems() returns a list of drawing dimensions specified by the parameter Type or returns null if no drawing dimensions of the specified type are found. This method lists only those dimensions created in the drawing.
    The input parameter Type is defined by the enumerated data type pfcModelItemType and it has the following valid values:
    •  ITEM_FEATURE—Feature
    •  ITEM_SURFACE—Surface
    •  ITEM_EDGE—Edge
    •  ITEM_COORD_SYS—Coordinate system
    •  ITEM_AXIS—Axis
    •  ITEM_POINT—Point
    •  ITEM_QUILT—Quilt
    •  ITEM_CURVE—Curve
    •  ITEM_LAYER—Layer
    •  ITEM_NOTE—Note
    •  ITEM_SIMPREP—Simplified representation
    •  ITEM_SOLID_GEOMETRY—Solid geometry
    •  ITEM_TABLE—Table
    •  ITEM_DTL_ENTITY—Detail entity
    •  ITEM_DTL_NOTE—Detail note
    •  ITEM_DTL_GROUP—Detail group
    •  ITEM_DTL_SYM_DEFINITION—Detail system definition
    •  ITEM_DTL_SYM_INSTANCE-Detail system instance
    •  ITEM_DTL_OLE_OBJECT—Detail OLE object
    •  ITEM_EXPLODED_STATE—Exploded state
    •  ITEM_EDGE_START—Start of edge
    •  ITEM_LOG_EDGE
    •  ITEM_EDGE_END—End of edge
    •  ITEM_XSEC—Cross section
    •  ITEM_LAYER_STATE-Layer state
    •  ITEM_COMBINED_STATE—Combined state
    •  ITEM_STYLE_STATE
    •  ITEM_RP_MATERIAL
    •  ITEM_VIEW—View
    •  ITEM_SURF_FIN—Surface finish
    •  ITEM_ANNOT_PLANE—Annotation plane
    •  ITEM_ANNOTATION_ELEM—Annotation Element
    •  ITEM_SET_DATUM_TAG—Datum tag
    •  ITEM_DIMENSION—Dimension
    •  ITEM_REF_DIMENSION—Reference dimension
    Set the parameter Type to the type of drawing dimension to retrieve. If this parameter is set to null, then all the dimensions in the drawing are listed.
    The method pfcModelItemOwner.GetItemById() returns a drawing dimension based on the type and the integer identifier. The method returns only those dimensions created in the drawing. It returns a null if a drawing dimension with the specified attributes is not found.
    The method pfcModelItemOwner.GetItemByName() returns a drawing dimension based on the type and string name.
    The property pfcSelection.SelItem returns the value of the selected drawing dimension.
    Creating Drawing Dimensions
    Methods Introduced:
  • pfcDrawingDimCreateInstructions.Create()
  • pfcModel2D.CreateDrawingDimension()
  • pfcEmptyDimSense.Create()
  • pfcPointDimenSense.Create()
  • pfcSplinePointDimSense.Create()
  • pfcTangentIndexDimSense.Create()
  • pfcLinAOCTangentDimensionSense.Create()
  • pfcAngularDimSense.Create()
  • pfcPointToAngleDimSense.Create()
  • The method pfcDrawingDimCreateInstructions.Create() creates an instructions object that describes how to create a drawing dimension using the method pfcModel2D.CreateDrawingDimension().
    The parameters of the instruction object are:
    •  Attachments—The entities that the dimension is attached to. The selections should include the drawing model view.
    •  IsRefDimension—True if the dimension is a reference dimension, otherwise null or false.
    •  OrientationHint—Describes the orientation of the dimensions in cases where this cannot be deduced from the attachments themselves.
    •  Senses—Gives more information about how the dimension attaches to the entity, such as to what part of the entity and in what direction the dimension runs. The types of dimension senses are as follows:
      DIMSENSE_NONE
      DIMSENSE_POINT
      DIMSENSE_SPLINE_PT
      DIMSENSE_TANGENT_INDEX
      DIMSENSE_LINEAR_TO_ARC_OR_CIRCLE_TANGENT
      DIMSENSE_ANGLE
      DIMSENSE_POINT_TO_ANGLE
    •  TextLocation—The location of the dimension text, in world units.
    The method pfcModel2D.CreateDrawingDimension() creates a dimension in the drawing based on the instructions data object that contains information needed to place the dimension. It takes as input an array of pfcSelection objects and an array of pfcDimensionSense structures that describe the required attachments. The method returns the created drawing dimension.
    The method pfcEmptyDimSense.Create() creates an empty dimension sense object. In this case no information such as location or direction is needed to describe the attachment points. For example, if there is a single attachment which is a straight line, the dimension is the length of the straight line. If the attachments are two parallel lines, the dimension is the distance between them.
    The method pfcPointDimSense.Create() creates a new dimension sense object to be used in creating a drawing dimension. The input parameterPointType is defined by the enumerated data type pfcDimensionPointType and the valid values are:
    •  DIMPOINT_END1— The first end of the entity
    •  DIMPOINT_END2—The second end of the entity
    •  DIMPOINT_CENTER—The center of an arc or circle
    •  DIMPOINT_NONE—No information such as location or direction of the attachment is specified. This is similar to setting the PointType to DIMSENSE_NONE.
    •  DIMPOINT_MIDPOINT—The mid-point of the entity
    The method pfcSplinePointDimSense.Create() creates a new spline point dimension sense object. This means that the attachment is to a point on a spline.
    Use the property pfcSplinePointDimSense.SplinePointIndex specifies the spline point index.
    The method pfcTangentIndexDimensionSense.Create() creates a new dimension sense associated with the type DIMSENSE_TANGENT_INDEX. The attachment is to a tangent of the entity, which is an arc or a circle.
    The method pfcLinAOCTangentDimensionSense.Create() creates a new dimension sense associated with the type DIMSENSE_LINEAR_TO_ARC_OR_CIRCLE_TANGENT. The dimension is the perpendicular distance between the a line and a tangent to an arc or a circle that is parallel to the line. The sense field is set to the value of the parameter TangentType.
    The values forTangentType and a description of the location of the tangent for each value, follow:
    •  DIMLINAOCTANGENT_LEFT0—The tangent is left of the line, and is on the same side, of the center of the arc or circle, as the line.
    •  DIMLINAOCTANGENT_RIGHT0—The tangent is right of the line, and is on the same side, of the center of the arc or circle, as the line.
    •  DIMLINAOCTANGENT_LEFT1—The tangent is left of the line, and is on the opposite side of the line.
    •  DIMLINAOCTANGENT_RIGHT1— The tangent is right of the line, and is on the opposite side of the line.
    The method pfcAngularDimSense.Create() creates a new dimension sense associated with the type DIMSENSE_ANGLE. The dimension is the angle between two straight entities. The sense field is set to the value of the parameter Options.
    Use the property pfcAngularDimSense.Options to determine the location of the angle dimension.
    The values for Options are as follows:
    •  IsFirst—Is set to TRUE if the angle dimension starts from the specified entity in a counterclockwise direction. Is set to FALSE if the dimension ends at the specified entity. The value is TRUE for one entity and FALSE for the other entity forming the angle.
    •  ShouldFlip—If the value of ShouldFlip is FALSE, and the direction of the specified entity is away from the vertex of the angle, then the dimension attaches directly to the entity. If the direction of the entity is away from the vertex of the angle, then the dimension is attached to the witness line. The witness line is in line with the entity but in the direction opposite to the vertex of the angle. If the value of ShouldFlip is TRUE then the above cases are reversed.
    The method pfcPointToAngleDimSense.Create() creates a new dimension sense associated with the type DIMSENSE_POINT_TO_ANGLE. The dimension is the angle between a line entity and the tangent to a curved entity. The curve attachment is of the type DIMSENSE_POINT_TO_ANGLE and the line attachment is of the type DIMSENSE POINT. In this case both the angle and the angle_sense fields must be set. The field sense shows which end of the curve the dimension is attached to and the field angle_sense shows the direction in which the dimension rotates and to which side of the tangent it attaches.
    Drawing Dimensions Information
    Methods and Properties Introduced:
  • pfcDrawing.IsDimensionAssociative
  • pfcDimension.IsReference()
  • pfcDimension2D.IsDisplayed()
  • pfcDrawing.GetDimensionAttachPoints()
  • pfcDrawing.GetDimensionSenses()
  • pfcDrawing.GetDimensionOrientHint()
  • pfcDrawing.GetBaselineDimension()
  • pfcDrawing.SetDimensionLocation
  • pfcDrawing.GetDimensionView()
  • pfcDimension.Tolerance()
  • pfcDrawing.IsDimensionToleranceDisplayed()
  • The property pfcDrawing.IsDimensionAssociative returns whether the dimension or reference dimension in a drawing is associative.
    The method pfcDimension.IsReference() determines whether the drawing dimension is a reference dimension.
    The method pfcDimension2D.IsDisplayed() determines whether the dimension appears in the drawing.
    The dimension senses array returned by the method pfcDrawing.GetDimensionSenses() gives more information on how these attachments are interpreted.
    The method pfcDrawing.GetDimensionSenses() returns an array of dimension senses, describing how the dimension is attached to each attachment returned by the method pfcDrawing.GetDimensionAttachPoints().
    The method pfcDrawing.GetDimensionOrientHint() returns the orientation hint for placing the drawing dimensions. The orientation hint determines how Creo Parametric will orient the dimension with respect to the attachment points.
    Note
    These methods described above are applicable only for dimensions created in the drawing mode. It does not support dimensions created at intersection points of entities.
    The method pfcDrawing.GetBaselineDimension() returns an ordinate baseline drawing dimension. It returns a null value if the dimension is not an ordinate dimension.
    Note
    The method updates the display of the dimension only if it is currently displayed.
    The property pfcDrawing.SetDimensionLocation returns the placement location of the dimension.
    The method pfcDrawing.GetDimensionView() returns the drawing view in which the dimension is displayed. This method applies to dimensions stored in the solid or in the drawing.
    The method pfcDimension.Tolerance() retrieves the upper and lower tolerance limits of the drawing dimension in the form of the pfcDimTolerance object. A null value indicates a nominal tolerance.
    Use the method pfcDrawing.IsDimensionToleranceDisplayed() determines whether or not the dimension’s tolerance is displayed in the drawing.
    Drawing Dimensions Operations
    Methods Introduced:
  • pfcDrawing.ConvertOrdinateDimensionToLinear()
  • pfcDrawing.ConvertLinearDimensionToOrdinate()
  • pfcDrawing.ConvertLinearDimensionToBaseline()
  • pfcDrawing.SwitchDimensionView()
  • pfcDimension2D.SetTolerance()
  • pfcDrawing.EraseDimension()
  • pfcModel2D.SetViewDisplaying()
  • The method pfcDrawing.ConvertOrdinateDimensionToLinear() converts an ordinate drawing dimension to a linear drawing dimension. The drawing containing the dimension must appear.
    The method pfcDrawing.ConvertLinearDimensionToOrdinate() converts a linear drawing dimension to an ordinate baseline dimension.
    The method pfcDrawing.ConvertLinearDimensionToBaseline() converts a location on a linear drawing dimension to an ordinate baseline dimension. The method returns the newly created baseline dimension.
    Note
    The method updates the display of the dimension only if it is currently displayed.
    The method pfcDrawing.SwitchDimensionView() changes the view where a dimension created in the drawing is displayed.
    The method pfcDimension2D.SetTolerance() assigns the upper and lower tolerance limits of the drawing dimension.
    The method pfcDrawing.EraseDimension() permanently erases the dimension from the drawing.
    The method pfcModel2D.SetViewDisplaying() changes the view where a dimension created in a solid model is displayed.
    Drawing Tables
    A drawing table in Creo.JS is represented by the class pfcTable. It is a child of the pfcModelItem class.
    Some drawing table methods operate on specific rows or columns. The row and column numbers in Creo.JS begin with 1 and range up to the total number of rows or columns in the table. Some drawing table methods operate on specific table cells. The class pfcTableCell is used to represent a drawing table cell.
    Creating Drawing Cells
    Method Introduced:
  • pfcTableCell.Create()
  • The method pfcTableCell.Create() creates the pfcTableCell object representing a cell in the drawing table.
    Some drawing table methods operate on specific drawing segment. A multisegmented drawing table contains 2 or more areas in the drawing. Inserting or deleting rows in one segment of the table can affect the contents of other segments. Table segments are numbered beginning with 0. If the table has only a single segment, use 0 as the segment id in the relevant methods.
    Selecting Drawing Tables and Cells
    Methods and Properties Introduced:
  • pfcBaseSession.Select()
  • pfcSelection.SelItem
  • pfcSelection.SelTableCell
  • pfcSelection.SelTableSegment
  • Tables may be selected using the method pfcBaseSession.Select(). Pass the filter dwg_table to select an entire table and the filter table_cell to prompt the user to select a particular table cell.
    The property pfcSelection.SelItem returns the selected table handle. It is a model item that can be cast to a pfcTable object.
    The property pfcSelection.SelTableCell returns the row and column indices of the selected table cell.
    The property pfcSelection.SelTableSegment returns the table segment identifier for the selected table cell. If the table consists of a single segment, this method returns the identifier 0.
    Creating Drawing Tables
    Methods Introduced:
  • pfcTableCreateInstructions.Create()
  • pfcTableOwner.CreateTable()
  • The method pfcTableCreateInstructions.Create() creates the pfcTableCreateInstructions data object that describes how to construct a new table using the method pfcTableOwner.CreateTable().
    The parameters of the instructions data object are:
    •  Origin—This parameter stores a three dimensional point specifying the location of the table origin. The origin is the position of the top left corner of the table.
    •  RowHeights—Specifies the height of each row of the table.
    •  ColumnData—Specifies the width of each column of the table and its justification.
    •  SizeTypes—Indicates the scale used to measure the column width and row height of the table.
    The method pfcTableOwner.CreateTable() creates a table in the drawing specified by the pfcTableCreateInstructions data object.
    Retrieving Drawing Tables
    Methods and Properties Introduced
  • pfcTableRetrieveInstructions.Create()
  • pfcTableRetrieveInstructions.FileName
  • pfcTableRetrieveInstructions.Path
  • pfcTableRetrieveInstructions.Version
  • pfcTableRetrieveInstructions.Position
  • pfcTableRetrieveInstructions.ReferenceSolid
  • pfcTableRetrieveInstructions.ReferenceRep
  • pfcTableOwner.RetrieveTable()
  • pfcTableOwner.RetrieveTableByOrigin()
  • The method pfcTableOwner.RetrieveTable() retrieves a table specified by the pfcTableRetrieveInstructions data object from a file on the disk. It returns the retrieved table. The data object contains information on the table to retrieve and is returned by the method pfcTableRetrieveInstructions.Create().
    The method pfcTableRetrieveInstructions.Create() creates the pfcTableRetrieveInstructions data object that describes how to retrieve a drawing table using the methods pfcTableOwner.RetrieveTable() and pfcTableOwner.RetrieveTableByOrigin(). The method returns the created instructions data object.
    The parameters of the instruction object pfcTableRetrieveInstructions are:
    •  FileName—Name of the file containing the drawing table.
    •  Position—Coordinates of the point on the drawing sheet, where the retrieved table must be placed. You must specify the value in screen coordinates.
    You can also set the parameters for pfcTableRetrieveInstructions data object using the following properties:
    •  pfcTableRetrieveInstructions.FileName—Sets the name of the drawing table. You must not specify the extension.
    •  pfcTableRetrieveInstructions.Path—Sets the path to the drawing table file. The path must be specified relative to the working directory.
    •  pfcTableRetrieveInstructions.Version—Sets the version of the drawing table that must be retrieved. If you specify NULL the latest version of the drawing table is retrieved.
    •  pfcTableRetrieveInstructions.Position—Sets the coordinates of the point on the drawing sheet, where the table must be placed. You must specify the value in screen coordinates.
    •  pfcTableRetrieveInstructions.ReferenceSolid—Sets the model from which data must be copied into the drawing table. If this argument is passed as NULL, an empty table is created.
    •  pfcTableRetrieveInstructions.ReferenceRep—Sets the handle to the simplified representation in a solid, from which data must be copied into the drawing table. If this argument is passed as NULL, and the argument solid is not NULL, then data from the solid model is copied into the drawing table.
    The method pfcTableOwner.RetrieveTable() retrieves a table specified by the pfcTableRetrieveInstructions data object from a file on the disk. It returns the retrieved table. The upper-left corner of the table is placed on the drawing sheet at the position specified by the pfcTableRetrieveInstructions data object.
    The method pfcTableOwner.RetrieveTableByOrigin() also retrieves a table specified by the pfcTableRetrieveInstructions data object from a file on the disk. The origin of the table is placed on the drawing sheet at the position specified by the pfcTableRetrieveInstructions data object. Tables can be created with different origins by specifying the option Direction, in the Insert Table dialog box.
    Drawing Tables Information
    Methods Introduced:
  • pfcTableOwner.ListTables()
  • pfcTableOwner.GetTable()
  • pfcTable.GetRowCount()
  • pfcTable.GetColumnCount()
  • pfcTable.CheckIfIsFromFormat()
  • pfcTable.GetRowSize()
  • pfcTable.GetColumnSize()
  • pfcTable.GetText()
  • pfcTable.GetCellNote()
  • The method pfcTableOwner.ListTables() returns an array of tables found in the model.
    The method pfcTableOwner.GetTable() returns a table specified by the table identifier in the model. It returns a null value if the table is not found.
    The method pfcTable.GetRowCount() returns the number of rows in the table.
    The method pfcTable.GetColumnCount() returns the number of columns in the table.
    The method pfcTable.CheckIfIsFromFormat() checks if the drawing table was created using the format. The method returns a true value if the table was created by applying the drawing format.
    The method pfcTable.GetRowSize() returns the height of the drawing table row specified by the segment identifier and the row number.
    The method pfcTable.GetColumnSize() returns the width of the drawing table column specified by the segment identifier and the column number.
    The method pfcTable.GetText() returns the array of text in a drawing table cell. Set the value of the parameter Mode to DWGTABLE_NORMAL to get the text as displayed on the screen. Set it to DWGTABLE_FULL to get symbolic text, which includes the names of parameter references in the table text.
    The method pfcTable.GetCellNote() returns the detail note item contained in the table cell.
    Drawing Tables Operations
    Methods Introduced:
  • pfcTable.Erase()
  • pfcTable.Display()
  • pfcTable.RotateClockwise()
  • pfcTable.InsertRow()
  • pfcTable.InsertColumn()
  • pfcTable.MergeRegion()
  • pfcTable.SubdivideRegion()
  • pfcTable.DeleteRow()
  • pfcTable.DeleteColumn()
  • pfcTable.SetText()
  • pfcTableOwner.DeleteTable()
  • The method v erases the specified table temporarily from the display. It still exists in the drawing. The erased table can be displayed again using the method pfcTable.Display(). The table will also be redisplayed by a window repaint or a regeneration of the drawing. Use these methods to hide a table from the display while you are making multiple changes to the table.
    The method pfcTable.RotateClockwise() rotates a table clockwise by the specified amount of rotation.
    The method pfcTable.InsertRow() inserts a new row in the drawing table. Set the value of the parameter RowHeight to specify the height of the row. Set the value of the parameter InsertAfterRow to specify the row number after which the new row has to be inserted. Specify 0 to insert a new first row.
    The method pfcTable.InsertColumn() inserts a new column in the drawing table. Set the value of the parameter ColumnWidth to specify the width of the column. Set the value of the parameter InsertAfterColumn to specify the column number after which the new column has to be inserted. Specify 0 to insert a new first column.
    The method pfcTable.MergeRegion() merges table cells within a specified range of rows and columns to form a single cell. The range is a rectangular region specified by the table cell on the upper left of the region and the table cell on the lower right of the region.
    The method pfcTable.SubdivideRegion() removes merges from a region of table cells that were previously merged. The region to remove merges is specified by the table cell on the upper left of the region and the table cell on the lower right of the region.
    The methods pfcTable.DeleteRow() and pfcTable.DeleteColumn() delete any specified row or column from the table. The methods also remove the text from the affected cells.
    The method pfcTable.SetText() sets text in the table cell.
    Use the method pfcTableOwner.DeleteTable() to delete a specified drawing table from the model permanently. The deleted table cannot be displayed again.
    Note
    Many of the above methods provide a parameter Repaint If this is set to true the table is repainted after the change. If set to false or null Creo Parametric delays the repaint, allowing you to perform several operations before showing changes on the screen.
    Drawing Table Segments
    Drawing tables can be constructed with one or more segments. Each segment can be independently placed. The segments are specified by an integer identifier starting with 0.
    Methods and Properties Introduced:
  • pfcSelection.SelTableSegment
  • pfcTable.GetSegmentCount()
  • pfcTable.GetSegmentSheet()
  • pfcTable.MoveSegment()
  • pfcTable.GetInfo()
  • The property pfcSelection.SelTableSegment returns the value of the segment identifier of the selected table segment. It returns a null value if the selection does not contain a segment identifier.
    The method pfcTable.GetSegmentCount() returns the number of segments in the table.
    The method pfcTable.GetSegmentSheet() determines the sheet number that contains a specified drawing table segment.
    The v pfcTable.MoveSegment() moves a drawing table segment to a new location. Pass the co-ordinates of the target position in the format x, y, z=0.
    Note
    Set the value of the parameter Repaint to true to repaint the drawing with the changes. Set it to false or null to delay the repaint.
    To get information about a drawing table pass the value of the segment identifier as input to the method pfcTable.GetInfo(). The method returns the table information including the rotation, row and column information, and the 3D outline.
    Repeat Regions
    Methods Introduced:
  • pfcTable.IsCommentCell()
  • pfcTable.GetCellComponentModel()
  • pfcTable.GetCellReferenceModel
  • pfcTable.GetCellTopModel
  • pfcTableOwner.UpdateTables
  • The methods pfcTable.IsCommentCell(), pfcTable.GetCellComponentModel(), pfcTable.GetCellReferenceModel, and pfcTableOwner.UpdateTables apply to repeat regions in drawing tables.
    The method pfcTable.IsCommentCell() indicates whether a cell in a repeat region contains a comment.
    The method pfcTable.GetCellComponentModel() returns the path to the assembly component model that is being referenced by a cell in a repeat region of a drawing table. It does not return a valid path if the cell attribute is set to NO DUPLICATE or NO DUPLICATE/LEVEL.
    The property pfcTable.GetCellReferenceModel returns the reference component that is being referred to by a cell in a repeat region of a drawing table, even if cell attribute is set to NO DUPLICATE or NO DUPLICATE/LEVEL.
    The property pfcTable.GetCellTopModel returns the top model that is being referred to by a cell in a repeat region of a drawing table, even if cell attribute is set to NO DUPLICATE or NO DUPLICATE/LEVEL.
    Use the property pfcTableOwner.UpdateTables to update the repeat regions in all the tables to account for changes to the model. It is equivalent to the command Table, Repeat Region, Update.
    Detail Items
    The methods described in this section operate on detail items.
    In Creo.JS you can create, delete and modify detail items, control their display, and query what detail items are present in the drawing. The types of available detail items are as follows:
    •  Draft Entities—Contain graphical items created in Creo Parametric. The items are as follows:
      Arc
      Ellipse
      Line
      Point
      Polygon
      Spline
    •  Notes—Textual annotations
    •  Symbol Definitions—Contained in the drawing’s symbol gallery.
    •  Symbol Instances—Instances of a symbol placed in a drawing.
    •  Draft Groups—Groups of detail items that contain notes, symbol instances, and draft entities.
    •  OLE objects—Object Linking and Embedding (OLE) objects embedded in the Creo Parametric drawing file.
    Listing Detail Items
    Methods Introduced:
  • pfcModelItemOwner.ListItems()
  • pfcDetailItemOwner.ListDetailItems()
  • pfcModelItemOwner.GetItemById()
  • pfcDetailItemOwner.CreateDetailItem()
  • The method pfcModelItemOwner.ListItems() returns a list of detail items specified by the parameter Type or returns null if no detail items of the specified type are found.
    The values of the parameter Type for detail items follow:
    •  ITEM_DTL_ENTITY—Detail Entity
    •  ITEM_DTL_NOTE—Detail Note
    •  ITEM_DTL_GROUP—Draft Group
    •  ITEM_DTL_SYM_DEFINITION—Detail Symbol Definition
    •  ITEM_DTL_SYM_INSTANCE—Detail Symbol Instance
    •  ITEM_DTL_OLE_OBJECT—Drawing embedded OLE object
    If this parameter is set to null, then all the model items in the drawing are listed.
    If the model has multiple bodies, the method pfcModelItemOwner.ListItems() returns the exception pfcXToolkitMultibodyUnsupported.
    The method pfcDetailItemOwner.ListDetailItems() also lists the detail items in the model. Pass the type of the detail item and the sheet number that contains the specified detail items.
    Set the input parameter Type to the type of detail item to be listed. Set it to null to return all the detail items. The input parameter SheetNumber determines the sheet that contains the specified detail item. Pass null to search all the sheets. This argument is ignored if the parameter Type is set to DETAIL_SYM_DEFINITION.
    The method returns an array of detail items and returns a null if no items matching the input values are found.
    The method pfcModelItemOwner.GetItemById() returns a detail item based on the type of the detail item and its integer identifier. The method returns a null if a detail item with the specified attributes is not found.
    Creating a Detail Item
    Methods Introduced:
  • pfcDetailItemOwner.CreateDetailItem()
  • pfcDetailGroupInstructions.Create()
  • The method pfcDetailItemOwner.CreateDetailItem() creates a new detail item based on the instruction data object that describes the type and content of the new detail item. The instructions data object is returned by the method pfcDetailGroupInstructions.Create(). The method returns the newly created detail item.
    Detail Entities
    A detail entity in Creo.JS is represented by the class pfcDetailEntityItem. It is a child of the pfcDetailItem class.
    The classpfcDetailEntityInstructions contains specific information used to describe a detail entity item.
    Instructions
    Methods and Properties Introduced:
  • pfcDetailEntityInstructions.Create()
  • pfcDetailEntityInstructions.Geometry
  • pfcDetailEntityInstructions.IsConstruction
  • pfcDetailEntityInstructions.Color
  • pfcDetailEntityInstructions.FontName
  • pfcDetailEntityInstructions.Width
  • pfcDetailEntityInstructions.View
  • The method pfcDetailEntityInstructions.Create() creates an instructions object that describes how to construct a detail entity, for use in the methods pfcDetailItemOwner.CreateDetailItem(), pfcDetailSymbolDefItem.CreateDetailItem(), and pfcDetailEntityItem.Modify().
    The instructions object is created based on the curve geometry and the drawing view associated with the entity. The curve geometry describes the trajectory of the detail entity in world units. The drawing view can be a model view returned by the method pfcModel2D.List2DViews() or a drawing sheet background view returned by the method pfcSheetOwner.GetSheetBackgroundView. The background view indicates that the entity is not associated with a particular model view.
    The method returns the created instructions object.
    Note
    Changes to the values of a pfcDetailEntityInstructions object do not take effect until that instructions object is used to modify the entity using pfcDetailEntityItem.Modify().
    The property pfcDetailEntityInstructions.Geometry returns the geometry of the detail entity item.
    The property pfcDetailEntityInstructions.IsConstruction returns a value that specifies whether the entity is a construction entity.
    The property pfcDetailEntityInstructions.Color returns the color of the detail entity item.
    The property pfcDetailEntityInstructions.FontName returns the line style used to draw the entity. The method returns a null value if the default line style is used.
    The property pfcDetailEntityInstructions.Width returns the value of the width of the entity line. The method returns a null value if the default line width is used.
    The property pfcDetailEntityInstructions.View returns the drawing view associated with the entity. The view can either be a model view or a drawing sheet background view.
    Detail Entities Information
    Method and Property Introduced:
  • pfcDetailEntityItem.GetInstructions()
  • pfcDetailEntityItem.SymbolDef
  • The method pfcDetailEntityItem.GetInstructions() returns the instructions data object that is used to construct the detail entity item.
    The property pfcDetailEntityItem.SymbolDef returns the symbol definition that contains the entity. This property returns a null value if the entity is not a part of a symbol definition.
    Detail Entities Operations
    Methods Introduced:
  • pfcDetailEntityItem.Draw()
  • pfcDetailEntityItem.Erase()
  • pfcDetailEntityItem.Modify()
  • The method pfcDetailEntityItem.Draw() temporarily draws a detail entity item, so that it is removed during the next draft regeneration.
    The method pfcDetailEntityItem.Erase() undraws a detail entity item temporarily, so that it is redrawn during the next draft regeneration.
    The method pfcDetailEntityItem.Modify() modifies the definition of an entity item using the specified instructions data object.
    OLE Objects
    An object linking and embedding (OLE) object is an external file, such as a document, graphics file, or video file that is created using an external application and which can be inserted into another application, such as Creo Parametric. You can create and insert supported OLE objects into a two-dimensional Creo Parametric file, such as a drawing, report, format file, notebook, or diagram. The functions described in this section enable you to identify and access OLE objects embedded in drawings.
    Methods and Properties Introduced:
  • pfcDetailOLEObject.ApplicationType()
  • pfcDetailOLEObject.Outline
  • pfcDetailOLEObject.Path
  • pfcDetailOLEObject.Sheet
  • The method pfcDetailOLEObject.ApplicationType() returns the type of the OLE object as a string, for example, Microsoft Word Document.
    The property pfcDetailOLEObject.Outline returns the extent of the OLE object embedded in the drawing.
    The property pfcDetailOLEObject.Path returns the path to the external file for each OLE object, if it is linked to an external file.
    The property pfcDetailOLEObject.Sheet returns the sheet number for the OLE object.
    Detail Notes
    A detail note in Creo.JS is represented by the classpfcDetailNoteItem. It is a child of the pfcDetailItem class.
    The classpfcDetailNoteInstructions contains specific information that describes a detail note.
    The class pfcDetailNoteInstructions and all the methods under this interface are deprecated.
    Instructions
    Methods and Properties Introduced:
  • pfcDetailNoteInstructions.Create()
  • pfcDetailNoteInstructions.TextLines
  • pfcDetailNoteInstructions.IsDisplayed
  • pfcDetailNoteInstructions.IsReadOnly
  • pfcDetailNoteInstructions.IsMirrored
  • pfcDetailNoteInstructions.Horizontal
  • pfcDetailNoteInstructions.Vertical
  • pfcDetailNoteInstructions.Color
  • pfcDetailNoteInstructions.Leader
  • pfcDetailNoteInstructions.TextAngle
  • The method pfcDetailNoteInstructions.Create() creates a data object that describes how a detail note item should be constructed when passed to the methods pfcDetailItemOwner.CreateDetailItem(), pfcDetailSymbolDefItem.CreateDetailItem(), or DetailNoteItem.Modify(). The parameter inTextLines specifies the array of text line data objects that describe the contents of the note.
    Note
    Changes to the values of apfcDetailNoteInstructions object do not take effect until that instructions object is used to modify the note using pfcDetailNoteItem.Modify().
    For creating a detail note item, the method pfcDetailItemOwner.CreateDetailItem() is deprecated, as it uses the deprecated interface pfcDetailNoteInstructions. Use the methods pfcDetailItemOwner.CreateFreeNote(), pfcDetailItemOwner.CreateOffsetNote(), pfcDetailItemOwner.CreateOnItemNote(), or pfcDetailItemOwner.CreateLeaderNote() instead.
    The property pfcDetailNoteInstructions.TextLines returns the description of text line contents in the note.
    The property pfcDetailNoteInstructions.IsDisplayed returns a boolean indicating if the note is currently displayed.
    The property pfcDetailNoteInstructions.IsReadOnly determines whether the note can be edited by the user.
    The property pfcDetailNoteInstructions.IsMirrored determines whether the note is mirrored.
    The property pfcDetailNoteInstructions.Horizontal returns the value of the horizontal justification of the note.
    The property pfcDetailNoteInstructions.Vertical returns the value of the vertical justification of the note.
    The property pfcDetailNoteInstructions.Color returns the color of the detail note item. The property returns a null value to represent the default drawing color.
    The property pfcDetailNoteInstructions.Leader returns the locations of the detail note item and information about the leaders.
    The property pfcDetailNoteInstructions.TextAngle returns the value of the angle of the text used in the note. The property returns a null value if the angle is 0.0.
    Detail Notes Information
    Methods and Properties Introduced:
  • pfcDetailNoteItem.GetInstructions()
  • pfcDetailNoteItem.SymbolDef
  • pfcDetailNoteItem.GetLineEnvelope()
  • pfcDetailNoteItem.GetModelReference()
  • The method pfcDetailNoteItem.GetInstructions() returns an instructions data object that describes how to construct the detail note item. This method takes a ProBoolean argument, GiveParametersAsNames, which determines whether symbolic representations of parameters and drawing properties in the note text should be displayed, or the actual text seen by the user should be displayed.
    Note
    Creo Parametric does not resolve and replace symbolic callouts for notes which are not displayed. Therefore, if the note is not displayed or is hidden in a layer, the text retrieved may contain symbolic callouts, even when GiveParametersAsNames is false.
    The property pfcDetailNoteItem.SymbolDef returns the symbol definition that contains the note. The property returns a null value if the note is not a part of a symbol definition.
    The method pfcDetailNoteItem.GetLineEnvelope() determines the screen coordinates of the envelope around the detail note. This envelope is defined by four points. The following figure illustrates how the point order is determined.
    Image
    The ordering of the points is maintained even if the notes are mirrored or are at an angle.
    The method pfcDetailNoteItem.GetModelReference() returns the model referenced by the parameterized text in a note. The model is referenced based on the line number and the text index where the parameterized text appears.
    Details Notes Operations
    Methods Introduced:
  • pfcDetailNoteItem.Draw()
  • pfcDetailNoteItem.Show()
  • pfcDetailNoteItem.Erase()
  • pfcDetailNoteItem.Remove()
  • pfcDetailNoteItem.KeepArrowTypeAsIs()
  • pfcDetailNoteItem.Modify()
  • The method pfcDetailNoteItem.Draw() temporarily draws a detail note item, so that it is removed during the next draft regeneration.
    The method pfcDetailNoteItem.Show() displays the note item, such that it is repainted during the next draft regeneration.
    The method pfcDetailNoteItem.Erase() undraws a detail note item temporarily, so that it is redrawn during the next draft regeneration.
    The method pfcDetailNoteItem.Remove() undraws a detail note item permanently, so that it is not redrawn during the next draft regeneration.
    The method pfcDetailNoteItem.KeepArrowTypeAsIs() allows you to keep arrow type of the leader note as it is, after a note is modified. You must call this method before the method pfcDetailNoteItem.Modify() is called.
    The method pfcDetailNoteItem.Modify() modifies the definition of an existing detail note item based on the instructions object that describes the new detail note item.
    Detail Groups
    A detail group in Creo.JS is represented by the classpfcDetailGroupItem. It is a child of the pfcDetailItem class.
    The classpfcDetailGroupInstructions contains information used to describe a detail group item.
    Instructions
    Method and Properties Introduced:
  • pfcDetailGroupInstructions.Create()
  • pfcDetailGroupInstructions.Name
  • pfcDetailGroupInstructions.Elements
  • pfcDetailGroupInstructions.IsDisplayed
    The method pfcDetailGroupInstructions.Create() creates an instruction data object that describes how to construct a detail group for use in pfcDetailItemOwner.CreateDetailItem() and pfcDetailGroupItem.Modify().
    Note
    Changes to the values of a pfcDetailGroupInstructions object do not take effect until that instructions object is used to modify the group using pfcDetailGroupItem.Modify().
    The property pfcDetailGroupInstructions.Name returns the name of the detail group.
    The property pfcDetailGroupInstructions.Elements returns the array of the detail items(notes, groups and entities) contained in the group. The property pfcDetailGroupInstructions.IsDisplayed returns whether the detail group is displayed in the drawing.
    Detail Groups Information
    Method Introduced:
  • pfcDetailGroupItem.GetInstructions()
  • The method pfcDetailGroupItem.GetInstructions() gets a data object that describes how to construct a detail group item. The method returns the data object describing the detail group item.
    Detail Groups Operations
    Methods Introduced:
  • pfcDetailGroupItem.Draw()
  • pfcDetailGroupItem.Erase()
  • pfcDetailGroupItem.Modify()
  • The method pfcDetailGroupItem.Draw() temporarily draws a detail group item, so that it is removed during the next draft generation.
    The method pfcDetailGroupItem.Erase() temporarily undraws a detail group item, so that it is redrawn during the next draft generation.
    The method pfcDetailGroupItem.Modify() changes the definition of a detail group item based on the data object that describes how to construct a detail group item.
    Detail Symbols
    Detail Symbol Definitions
    A detail symbol definition in Creo.JS is represented by the classpfcDetailSymbolDefItem. It is a child of the pfcDetailItem class.
    The class pfcDetailSymbolDefInstructions contains information that describes a symbol definition. It can be used when creating symbol definition entities or while accessing existing symbol definition entities.
    Instructions
    Method and Properties Introduced:
  • pfcDetailSymbolDefInstructions.Create()
  • pfcDetailSymbolDefInstructions.SymbolHeight
  • pfcDetailSymbolDefInstructions.HasElbow
  • pfcDetailSymbolDefInstructions.IsTextAngleFixed
  • pfcDetailSymbolDefInstructions.ScaledHeight
  • pfcDetailSymbolDefInstructions.Attachments
  • pfcDetailSymbolDefInstructions.FullPath
  • pfcDetailSymbolDefInstructions.Reference
  • The method pfcDetailSymbolDefInstructions.Create() creates an instruction data object that describes how to create a symbol definition based on the path and name of the symbol definition. The instructions object is passed to the methods pfcDetailItemOwner.CreateDetailItem() and pfcDetailSymbolDefItem.Modify().
    Note
    Changes to the values of a pfcDetailSymbolDefInstructions object do not take effect until that instructions object is used to modify the definition using the method pfcDetailSymbolDefItem.Modify().
    The property pfcDetailSymbolDefInstructions.SymbolHeight returns the value of the height type for the symbol definition. The symbol definition height options are as follows:
    •  SYMDEF_FIXED—Symbol height is fixed.
    •  SYMDEF_VARIABLE—Symbol height is variable.
    •  SYMDEF_RELATIVE_TO_TEXT—Symbol height is determined relative to the text height.
    The property pfcDetailSymbolDefInstructions.HasElbow determines whether the symbol definition includes an elbow.
    The property pfcDetailSymbolDefInstructions.IsTextAngleFixed returns whether the text of the angle is fixed.
    The property pfcDetailSymbolDefInstructions.ScaledHeight returns the height of the symbol definition in inches.
    The property pfcDetailSymbolDefInstructions.Attachments returns the value of the array of the possible instance attachment points for the symbol definition.
    The property pfcDetailSymbolDefInstructions.FullPath returns the value of the complete path of the symbol definition file.
    The property pfcDetailSymbolDefInstructions.Reference returns the text reference information for the symbol definition. It returns a null value if the text reference is not used. The text reference identifies the text item used for a symbol definition which has a height type of SYMDEF_TEXT_RELATED.
    Detail Symbol Definitions Information
    Methods Introduced:
  • pfcDetailSymbolDefItem.ListDetailItems()
  • pfcDetailSymbolDefItem.GetInstructions()
  • The method pfcDetailSymbolDefItem.ListDetailItems() lists the detail items in the symbol definition based on the type of the detail item.
    The method pfcDetailSymbolDefItem.GetInstructions() returns an instruction data object that describes how to construct the symbol definition.
    Detail Symbol Definitions Operations
    Methods Introduced:
  • pfcDetailSymbolDefItem.CreateDetailItem()
  • pfcDetailSymbolDefItem.Modify()
  • The method pfcDetailSymbolDefItem.CreateDetailItem() creates a detail item in the symbol definition based on the instructions data object. The method returns the detail item in the symbol definition.
    The method pfcDetailSymbolDefItem.Modify() modifies a symbol definition based on the instructions data object that contains information about the modifications to be made to the symbol definition.
    Retrieving Symbol Definitions
    Methods Introduced:
  • pfcDetailItemOwner.RetrieveSymbolDefItem()
  • Creo Parametric symbols exist in two different areas: the user-defined area and the system symbols area.
    The method pfcDetailItemOwner.RetrieveSymbolDefItem retrieves a symbol definition from the user-defined location designated by the configuration option pro_symbol_dir. The symbol definition should have been previously saved to a file using Creo Parametric.
    The method pfcDetailItemOwner.RetrieveSymbolDefItem also retrieves a symbol definition from the system directory. The system area contains symbols provided by Creo Parametric with the Detail module (such as the Welding Symbols Library).
    The input parameters of this method follow:
    •  FileName—Name of the symbol definition file.
    •  Source—Source of the symbol definition file. The input parameter Source is defined by the enumerated type pfcDetailSymbolDefItemSource. The valid values which are supported are listed below:
      DTLSYMDEF_SRC_SYSTEM—Specifies the system symbol definition directory.
      DTLSYMDEF_SRC_PATH—Specifies the absolute path to a directory containing the symbol definition.
    •  FilePath—Path to the symbol definition file. It is relative to the path specified by the option pro_symbol_dir in the configuration file. A null value indicates that the function should search the current directory.
    •  Version—Numerical version of the symbol definition file. A null value retrieves the latest version.
    •  UpdateUnconditionally—True if Creo should update existing instances of this symbol definition, or false to quit the operation if the definition exists in the model.
    The method returns the retrieved symbol definition.
    Detail Symbol Instances
    A detail symbol instance in Creo.JS is represented by the class pfcDetailSymbolInstItem. It is a child of the pfcDetailItem class.
    The classpfcDetailSymbolInstInstructions contains information that describes a symbol instance. It can be used when creating symbol instances and while accessing existing groups.
    Instructions
    Method and Properties Introduced:
  • pfcDetailSymbolInstInstructions.Create()
  • pfcDetailSymbolInstInstructions.IsDisplayed
  • pfcDetailSymbolInstInstructions.Color
  • pfcDetailSymbolInstInstructions.SymbolDef
  • pfcDetailSymbolInstInstructions.AttachOnDefType
  • pfcDetailSymbolInstInstructions.DefAttachment
  • pfcDetailSymbolInstInstructions.InstAttachment
  • pfcDetailSymbolInstInstructions.Angle
  • pfcDetailSymbolInstInstructions.ScaledHeight
  • pfcDetailSymbolInstInstructions.TextValues
  • pfcDetailSymbolInstInstructions.CurrentTransform
  • pfcDetailSymbolInstInstructions.SetGroups
  • The method pfcDetailSymbolInstInstructions.Create() creates a data object that contains information about the placement of a symbol instance.
    Note
    Changes to the values of a pfcDetailSymbolInstInstructions object do not take effect until that instructions object is used to modify the instance using pfcDetailSymbolInstItem.Modify().
    The property pfcDetailSymbolInstInstructions.IsDisplayed returns a value that specifies whether the instance of the symbol is displayed.
    The property pfcDetailSymbolInstInstructions.Color returns the color of the detail symbol instance. A null value indicates that the default drawing color is used.
    The property pfcDetailSymbolInstInstructions.SymbolDef returns the symbol definition used for the instance.
    The property pfcDetailSymbolInstInstructions.AttachOnDefType returns the attachment type of the instance. The property returns a null value if the attachment represents a free attachment. The attachment options are as follows:
    •  SYMDEFATTACH_FREE—Attachment on a free point.
    •  SYMDEFATTACH_LEFT_LEADER—Attachment via a leader on the left side of the symbol.
    •  SYMDEFATTACH_RIGHT_LEADER— Attachment via a leader on the right side of the symbol.
    •  SYMDEFATTACH_RADIAL_LEADER—Attachment via a leader at a radial location.
    •  SYMDEFATTACH_ON_ITEM—Attachment on an item in the symbol definition.
    •  SYMDEFATTACH_NORMAL_TO_ITEM—Attachment normal to an item in the symbol definition.
    The property pfcDetailSymbolInstInstructions.DefAttachment returns the value that represents the way in which the instance is attached to the symbol definition.
    The property pfcDetailSymbolInstInstructions.InstAttachment returns the value of the attachment of the instance that includes location and leader information.
    The property pfcDetailSymbolInstInstructions.Angle returns the value of the angle at which the instance is placed. The property returns a null value if the value of the angle is 0 degrees.
    The property pfcDetailSymbolInstInstructions.ScaledHeight returns the height of the symbol instance in the owner drawing or model coordinates. This value is consistent with the height value shown for a symbol instance in the Properties dialog box in the Creo Parametric User Interface.
    Note
    The scaled height obtained using the above property is partially based on the properties of the symbol definition assigned using the property pfcDetailSymbolInstInstructions.SymbolDef. Changing the symbol definition may change the calculated value for the scaled height.
    The property pfcDetailSymbolInstInstructions.TextValues returns the array of variant text values used while placing the symbol instance.
    The property pfcDetailSymbolInstInstructions.CurrentTransform returns the coordinate transformation matrix to place the symbol instance.
    The property pfcDetailSymbolInstInstructions.SetGroupspfcDetailSymbolGroupOption
    •  DETAIL_SYMBOL_GROUP_INTERACTIVE—Symbol groups are interactively selected for display. This is the default value in the GRAPHICS mode.
    •  DETAIL_SYMBOL_GROUP_ALL—All non-exclusive symbol groups are included for display.
    •  DETAIL_SYMBOL_GROUP_NONE—None of the non-exclusive symbol groups are included for display.
    •  DETAIL_SYMBOL_GROUP_CUSTOM—Symbol groups specified by the application are displayed.
    Refer to the section Detail Symbol Groups for more information on detail symbol groups.
    Detail Symbol Instances Information
    Method Introduced:
  • pfcDetailSymbolInstItem.GetInstructions()
  • The method pfcDetailSymbolInstItem.GetInstructions() returns an instructions data object that describes how to construct a symbol instance. This method takes a ProBoolean argument, GiveParametersAsNames, which determines whether symbolic representations of parameters and drawing properties in the symbol instance should be displayed, or the actual text seen by the user should be displayed.
    Detail Symbol Instances Operations
    Methods Introduced:
  • pfcDetailSymbolInstItem.Draw()
  • pfcDetailSymbolInstItem.Erase()
  • pfcDetailSymbolInstItem.Show()
  • pfcDetailSymbolInstItem.Remove()
  • pfcDetailSymbolInstItem.Modify()
  • The method pfcDetailSymbolInstItem.Draw() draws a symbol instance temporarily to be removed on the next draft regeneration.
    The method pfcDetailSymbolInstItem.Erase() undraws a symbol instance temporarily from the display to be redrawn on the next draft generation.
    The method pfcDetailSymbolInstItem.Show() displays a symbol instance to be repainted on the next draft regeneration.
    The method pfcDetailSymbolInstItem.Remove() deletes a symbol instance permanently.
    The method pfcDetailSymbolInstItem.Modify() modifies a symbol instance based on the instructions data object that contains information about the modifications to be made to the symbol instance.
    Detail Symbol Groups
    A detail symbol group in Creo.JS is represented by the class pfcDetailSymbolGroup. It is a child of the pfcObject class. A detail symbol group is accessible only as a part of the contents of a detail symbol definition or instance.
    The class pfcDetailSymbolGroupInstructions contains information that describes a symbol group. It can be used when creating new symbol groups, or while accessing or modifying existing groups.
    Instructions
    Method and Properties Introduced:
  • pfcDetailSymbolGroupInstructions.Create()
  • pfcDetailSymbolGroupInstructions.Items
  • pfcDetailSymbolGroupInstructions.Name
  • The method pfcDetailSymbolGroupInstructions.Create() creates the pfcDetailSymbolGroupInstructions data object that stores the name of the symbol group and the list of detail items to be included in the symbol group.
    Note
    Changes to the values of the pfcDetailSymbolGroupInstructions data object do not take effect until this object is used to modify the instance using the method pfcDetailSymbolGroup.Modify().
    The property pfcDetailSymbolGroupInstructions.Items returns the list of detail items included in the symbol group.
    The property pfcDetailSymbolGroupInstructions.Name returns the name of the symbol group.
    Detail Symbol Group Information
    Methods Introduced:
  • pfcDetailSymbolGroup.GetInstructions()
  • pfcDetailSymbolGroup.ParentGroup()
  • pfcDetailSymbolGroup.ParentDefinition()
  • pfcDetailSymbolGroup.ListChildren()
  • pfcDetailSymbolDefItem.ListSubgroups()
  • pfcDetailSymbolDefItem.IsSubgroupLevelExclusive()
  • pfcDetailSymbolInstItem.ListGroups()
  • The method pfcDetailSymbolGroup.GetInstructions() returns the pfcDetailSymbolGroupInstructions data object that describes how to construct a symbol group.
    The method pfcDetailSymbolGroup.ParentGroup() returns the parent symbol group to which a given symbol group belongs.
    The method pfcDetailSymbolGroup.ParentDefinition() returns the symbol definition of a given symbol group.
    The method pfcDetailSymbolGroup.ListChildren() lists the subgroups of a given symbol group.
    The method pfcDetailSymbolDefItem.ListSubgroups() lists the subgroups of a given symbol group stored in the symbol definition at the indicated level.
    The method pfcDetailSymbolDefItem.IsSubgroupLevelExclusive() identifies if the subgroups of a given symbol group stored in the symbol definition at the indicated level are exclusive or independent. If groups are exclusive, only one of the groups at this level can be active in the model at any time. If groups are independent, any number of groups can be active.
    The method pfcDetailSymbolInstItem.ListGroups() lists the symbol groups included in a symbol instance. The pfcSymbolGroupFilter argument determines the types of symbol groups that can be listed. It takes the following values:
    •  DTLSYMINST_ALL_GROUPS—Retrieves all groups in the definition of the symbol instance.
    •  DTLSYMINST_ACTIVE_GROUPS—Retrieves only those groups that are actively shown in the symbol instance.
    •  DTLSYMINST_INACTIVE_GROUPS—Retrieves only those groups that are not shown in the symbol instance.
    Detail Symbol Group Operations
    Methods Introduced:
  • pfcDetailSymbolGroup.Delete()
  • pfcDetailSymbolGroup.Modify()
  • pfcDetailSymbolDefItem.CreateSubgroup()
  • pfcDetailSymbolDefItem.SetSubgroupLevelExclusive
  • pfcDetailSymbolDefItem.SetSubgroupLevelIndependent()
  • The method pfcDetailSymbolGroup.Delete() deletes the specified symbol group from the symbol definition. This method does not delete the entities contained in the group.
    The method pfcDetailSymbolGroup.Modify() modifies the specified symbol group based on the pfcDetailSymbolGroupInstructions data object that contains information about the modifications that can be made to the symbol group.
    The method pfcDetailSymbolDefItem.CreateSubgroup() creates a new subgroup in the symbol definition at the indicated level below the parent group.
    The property pfcDetailSymbolDefItem.SetSubgroupLevelExclusive makes the subgroups of a symbol group exclusive at the indicated level in the symbol definition.
    Note
    After you set the subgroups of a symbol group as exclusive, only one of the groups at the indicated level can be active in the model at any time.
    The method pfcDetailSymbolDefItem.SetSubgroupLevelIndependent() makes the subgroups of a symbol group independent at the indicated level in the symbol definition.
    Note
    After you set the subgroups of a symbol group as independent, any number of groups at the indicated level can be active in the model at any time.
    Detail Attachments
    A detail attachment in Creo.JS is represented by the class pfcAttachment. It is used for the following tasks:
    •  The way in which a drawing note or a symbol instance is placed in a drawing.
    •  The way in which a leader on a drawing note or symbol instance is attached.
    Method Introduced:
  • pfcAttachment.GetType()
  • The method pfcAttachment.GetType() returns the pfcAttachmentType object containing the types of detail attachments. The detail attachment types are as follows:
    •  ATTACH_FREE—The attachment is at a free point possibly with respect to a given drawing view.
    •  ATTACH_PARAMETRIC—The attachment is to a point on a surface or an edge of a solid.
    •  ATTACH_OFFSET—The attachment is offset to another drawing view, to a model item, or to a 3D model annotation.
    •  ATTACH_TYPE_UNSUPPORTED—The attachment is to an item that cannot be represented in PFC at the current time. However, you can still retrieve the location of the attachment.
    Free Attachment
    The ATTACH_FREE detail attachment type is represented by the pfcFreeAttachment. It is a child of the pfcAttachment class.
    Methods and Properties Introduced:
  • pfcFreeAttachment.AttachmentPoint
  • pfcFreeAttachment.View
  • pfcFreeAttachment.Create()
  • The property pfcFreeAttachment.AttachmentPoint returns the attachment point. This location is in screen coordinates for drawing items, symbol instances and surface finishes on flat-to-screen annotation planes, and in model coordinates for symbols and surface finishes on 3D model annotation planes.
    The property pfcFreeAttachment.View sets the drawing view.
    The method pfcFreeAttachment.Create() creates a data object used for representing a free attachment. A free attachment is relative to a fixed location, or relative to a fixed location with respect to a drawing view.
    Parametric Attachment
    The ATTACH_PARAMETRIC detail attachment type is represented by the pfcParametricAttachment. It is a child of the pfcAttachment class.
    Method and Property Introduced:
  • pfcParametricAttachment.AttachedGeometry
  • pfcParametricAttachment.Create()
  • The property pfcParametricAttachment.AttachedGeometry returns the pfcSelection object representing the item to which the detail attachment is attached. This includes the drawing view in which the attachment is made.
    The method pfcParametricAttachment.Create() creates a data object, used for attaching a detail item to an item. The input parameter inAttachedGeometry specifies the selection representing the item to attach to. This should include the drawing model view. The attachment will occur at the selected parameters
    Offset Attachment
    The ATTACH_OFFSET detail attachment type is represented by the classpfcOffsetAttachment. It is a child of the pfcAttachment class.
    Methods and Properties Introduced:
  • pfcOffsetAttachment.AttachedGeometry
  • pfcOffsetAttachment.AttachmentPoint
  • pfcOffsetAttachment.Create()
  • The property pfcOffsetAttachment.AttachedGeometry returns the pfcSelection object representing the item to which the detail attachment is attached. This includes the drawing view where the attachment is made, if the offset reference is in a model.
    The property pfcOffsetAttachment.AttachmentPoint returns the attachment point. This location is in screen coordinates for drawing items, symbol instances and surface finishes on flat-to-screen annotation planes, and in model coordinates for symbols and surface finishes on 3D model annotation planes. The distance from the attachment point to the location of the item to which the detail attachment is attached is saved as the offset distance.
    The method pfcOffsetAttachment.Create() creates a data object, used for attaching a detail item, offset to a reference point or axis. The input arguments are:
    •  inAttachedGeometry— Specifies the selection representing the item to attach to. This should include the drawing model view. The attachment will occur at the selected parameters
    •  inAttachmentPoint—Specifies the attachment point, in screen coordinates.
    Unsupported Attachment
    The ATTACH_TYPE_UNSUPPORTED detail attachment type is represented by the classpfcUnsupportedAttachment. It is a child of the pfcAttachment class.
    Property Introduced:
  • pfcUnsupportedAttachment.AttachmentPoint
  • The property pfcUnsupportedAttachment.AttachmentPoint returns the attachment point. This location is in screen coordinates for drawing items, symbol instances and surface finishes on flat-to-screen annotation planes, and in model coordinates for symbols and surface finishes on 3D model annotation planes.