User's Guide > Drawings > Detail Attachments and Leaders
Detail Attachments and Leaders
Functions Introduced:
ProDtlattachAlloc()
ProDtlattachGet()
ProDtlattachSet()
ProDtlattachFree()
ProDtlattachArrowtypeGet()
ProDtlattachArrowtypeSet()
ProDtlattachIsMissingGet()
ProDtlattachIsSuppressedGet()
The opaque data structure ProDtlattach is used for two tasks:
The way in which a drawing note or a symbol instance is attached to the drawing.
The way in which a leader on a drawing note or symbol instance is attached.
Each note and symbol instance must contain one ProDtlattach to describe its attachment in the drawing, and may contain any number of ProDtlattach objects describing the leaders.
ProDtlattachAlloc() allocates and initializes the memory for a detail attachment. The inputs are:
type—The type of attachment to the drawing view. The detail attachment types are as follows:
FREE—The attachment is to a 2D location in the drawing view.
PARAMETRIC—The attachment is to a point on a surface or an edge of a solid.
OFFSET—The attachment is offset to another drawing view, to a model item, or to a 3D model annotation.
Note:
 
You cannot attach a symbol to 3D model annotation using the OFFSET attachment type.
view—The drawing view. If the type is FREE, the attachment is relative to the drawing view, that is the attachment moves when the drawing view is moved. This is NULL, if the detail attachment is not related to the drawing view, but is placed at a specified location in the drawing sheet, or if the attachment is offset to a model item or to a 3D model annotation.
location—If the type is FREE or OFFSET, this argument provides the location of the attachment. 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 this location to the location of the item to which the detail item is attached (given by the argument attach_point) is saved as the offset distance for an OFFSET attachment.
attach_point—If the type is PARAMETRIC or OFFSET, this ProSelection structure provides the location of the item to which the detail item is attached. This includes the drawing view in which the attachment is made. If you are building this structure using ProSelectionAlloc(), set the location using ProSelectionUvParamSet(), and the drawing view using ProSelectionViewSet().
Use the function ProDtlattachSet() to set the above ProDtlattach information for an existing attachment.
The function ProDtlattachGet() unpacks the above information for an existing attachment. The output arguments are:
type—The type of attachment to the drawing view. The detail attachment types are as follows:
FREE—The attachment is to a 2D location in the drawing view.
PARAMETRIC—The attachment is to a point on a surface or an edge of a solid in a drawing view.
OFFSET—The attachment is offset to another drawing view, to a model item, or to a 3D model annotation.
UNIMPLEMENTED—The attachment is to an item that is not currently supported in Creo TOOLKIT. However, you can still retrieve the location and the view to which the attachment is connected.
SUPPRESSED—The attachment is to an item, which is missing from the drawing or part.
view—If the type is FREE or UNIMPLEMENTED, this argument specifies the drawing view. This is NULL, if the detail attachment is not related to the drawing view, but is placed at a specified location in the drawing sheet, or if the attachment is offset to a model item or to a 3D model annotation.
location—If the type is FREE, OFFSET, or UNIMPLEMENTED, this argument specifies the location of the attachment. 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 this location to the location of the item to which the detail item is attached (given by the argument attach_point) is saved as the offset distance for an OFFSET attachment.
attach_point —If the type is PARAMETRIC or OFFSET, this argument provides the location of the item to which the detail item is attached. This includes the drawing view in which the attachment is made.
ProDtlattachFree() frees an attachment that was allocated with ProDtlattachAlloc().
The function ProDtlattachArrowtypeGet() returns the type of arrowhead used for the leaders attached to a drawing note or symbol instance. Use the function ProDtlattachArrowtypeSet() to assign the type of arrowhead.
Note:
 
The functions ProDtlattachArrowtypeGet() and ProDtlattachArrowtypeSet() are applicable only for ProDtlattach leader attachment objects obtained using the functions ProDtlsyminstdataLeadersCollect() and ProDtlnotedataLeadersCollect().
The function ProDtlattachIsMissingGet() determines whether an attachment is missing. An attachment is considered missing only if it was suppressed and is permanently unavailable. This can occur in the following cases:
No attachment information exists.
The attachment belongs to a drawing view that has been deleted.
The attachment references geometry in a solid model that was removed from the drawing.
The function returns a ProBoolean:
PRO_B_TRUE–If the attachment is missing.
PRO_B_FALSE–If the attachment exists or is not permanently removed.
The function ProDtlattachIsSuppressedGet() returns whether the attachment is suppressed. The input argument to this function is attach, which specifies the leader attachment structure.
The output argument to this function is_supp is set to true if the attachment is suppressed.
這是否有幫助?