[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]

3D Documentation - Customizable Subactions

Subactions to generate and modify secondary references

The 3D Documentation commands to
offer the functionality to create and modify secondary references. To allow this the above commands use a common build-in subaction. This UI-less subaction lets the user incrementally select the secondary references and return them to the main dialog.

It is possible to implement command specific subactions. Those subactions must have the names as listed here:

When entering the subaction the "DEFAULT" variable contains a list with:
  1. A list containing pairs with SEL_ITEM of reference and the corresponding identifier string, i.e.
    (list (list REF1-SEL_ITEM "Type1") (list REF2-SEL_ITEM "Type1") (list REF3-SEL_ITEM "Type2")).
  2. The SEL_ITEM of the selected annotation_3d

The subactions must return a list of pairs defining

  1. The SEL_ITEM of the reference element
  2. A string defining an identification
Example for a valid return value: (list (list FACE1 IDENTIFIER) (list EDGE1 IDENTIFIER))

If there is no subaction available the build-in subaction is used.

The following code demonstrates how to implement a specific subaction for welding and surface symbols:
(sd-defdialog 'doc3d_define_secondary_references_doc3d_create_symbol_welding
  :dialog-title "Welding 2nd Refs"
  :dialog-type    :subaction
  :initial-variable 'FACE1
  :variables
 '(
    (CURRENT_SECONDARY_REFS
      :initial-value (first DEFAULT)
    )
    (FACE1
      :value-type :face
      :title "First Face"
      :prompt-text "Specify the first face."
      :initial-value (first (first CURRENT_SECONDARY_REFS))
    )
    (FACE2
      :value-type :face
      :title "Second Face"
      :prompt-text "Specify the second face."
      :initial-value (first (second CURRENT_SECONDARY_REFS))
    )
    (IDENTIFIER
      :title "Identifier"
      :value-type :string
      :initial-value (if (second (first CURRENT_SECONDARY_REFS))
                       (second (first CURRENT_SECONDARY_REFS))
                       "Welding"
                     )
      :prompt-text "Enter a describing text for the secondary references of this welding symbol"
    )
    (ACCEPT
      :toggle-type :grouped-toggle
      :push-action (sd-accept-dialog)
      :title "Accept"
    )
    (ABORT
      :toggle-type :grouped-toggle
      :push-action (sd-abort-dialog)
      :title "Cancel"
    )
  )
  :ok-action '(list (list FACE1 IDENTIFIER) (list FACE2 IDENTIFIER))
)

(sd-defdialog 'doc3d_define_secondary_references_doc3d_create_symbol_surface
  :dialog-title "Surface 2nd Refs"
  :dialog-type    :subaction
  :initial-variable 'PART1
  :variables
 '(
   (CURRENT_SECONDARY_REFS
      :initial-value (first DEFAULT)
    )
    (THIS_ANNO
      :initial-value (second DEFAULT)
    )
    (PART1
      :value-type :part
      :initial-value (if (first (first CURRENT_SECONDARY_REFS))
                       (first (first CURRENT_SECONDARY_REFS))  
                       (when THIS_ANNO 
                         (sd-inq-parent-obj THIS_ANNO)
                       )
                     )
      :title "Part"
      :prompt-text "Specify a part to be used as a secondary reference for the surface symbol."
    )
    (IDENTIFIER
      :initial-value (if (second (first CURRENT_SECONDARY_REFS))
                       (second (first CURRENT_SECONDARY_REFS))
                       "Surface"
                     )
      :title "Identifier"
      :value-type :string
      :prompt-text "Enter a describing text for the secondary references of this surface symbol"
    )
    (ACCEPT
      :toggle-type :grouped-toggle
      :push-action (sd-accept-dialog)
      :title "Accept"
    )
    (ABORT
      :toggle-type :grouped-toggle
      :push-action (sd-abort-dialog)
      :title "Cancel"
    )
  )
  :ok-action '(list (list PART1 IDENTIFIER))
)

;;(sd-defdialog 'doc3d_define_secondary_references_doc3d_text
;;  .. no overload here - use build in subaction.
;;)
[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]
© 2023 Parametric Technology GmbH
(a subsidiary of PTC Inc.), All Rights Reserved