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

3D Documentation Events

The following constants identify standard Creo Elements/Direct Modeling events which are available for use. These constants can be used as parameters for the event functions.

Show Docuplane Events

*DOC3D-PRE-SHOW-DOCUPLANE-EVENT*
Processed within the SHOW DOCUPLANE command immediatly after the docuplane is selected (before any other things are done)
Following KEYWORD/VALUE pairs are passed to the function called by the event:
:DOCUPLANE - {SEL_ITEM} - the docuplane that is currently shown
:VIEWPORT - {STRING} - the name of the viewport where the SHOW command is performed
:SECTION - {STRING} - t if the CROSS SECTION mode is used, nilotherwise
:ORIGIN - {GPNT3D} - the position of the origin of the docuplane that is currently shown
:SCALE - {NUMBER} - the scale value of the docuplane that is currently shown

*DOC3D-POST-SHOW-DOCUPLANE-EVENT*
Processed within the SHOW DOCUPLANE command after the docuplane is selected and after the SHOW action is done.
This event uses the same KEYWORD/VALUE pairs as described above.

*DOC3D-END-SHOW-DOCUPLANE-EVENT*
Processed within the SHOW DOCUPLANE command after clicking OK. This event uses the same KEYWORD/VALUE pairs as described above.

Examples:

  (sd-unsubscribe-event doc3d::*DOC3D-PRE-SHOW-DOCUPLANE-EVENT*
    'change-viewport-name)

  (defun change-viewport-name (&rest arg-list)
    (let ((viewport-name (getf arg-list :viewport))
          (docuplane     (getf arg-list :docuplane))
          (section       (getf arg-list :section))
          (scale         (getf arg-list :scale))
         )

      (sd-vp-add-title-postfix 
        viewport-name 
        (format nil "SHOW of Docuplane '~A'~A~A." 
          (sd-inq-docuplane-props docuplane :values :name)
          (if (= scale 1.0)
            ""
            (format nil " (Scale ~A)" scale)
          )
          (if section
            " (sectioned)"
            ""
          )
        )
      )
    )
  )

  (sd-subscribe-event doc3d::*DOC3D-PRE-SHOW-DOCUPLANE-EVENT*
    'change-viewport-name)

  ;; -------------------------------------------------------------------------
  (sd-unsubscribe-event doc3d::*DOC3D-END-SHOW-DOCUPLANE-EVENT*
    'reset-viewport-name)

  (defun reset-viewport-name (&rest arg-list)
    (let ((viewport-name (getf arg-list :viewport)))
      (sd-vp-remove-title-postfix viewport-name)
    )
  )
  (sd-subscribe-event doc3d::*DOC3D-END-SHOW-DOCUPLANE-EVENT*
    'reset-viewport-name)
  ;; -------------------------------------------------------------------------

  (sd-unsubscribe-event doc3d::*DOC3D-POST-SHOW-DOCUPLANE-EVENT*
    'show-docuplane-info)

  (defun show-docuplane-info (&rest arg-list)
    (let ((viewport-name (getf arg-list :viewport))
          (docuplane     (getf arg-list :docuplane))
          (section       (getf arg-list :section))
          (scale         (getf arg-list :scale))
          (origin        (getf arg-list :origin))
         )
      (display "Additional information:")
      (display (format nil "Docuplane: '~A'" (sd-inq-docuplane-props docuplane :values :name)))
      (display (format nil "Section: ~A" (if section "Yes" "No")))
      (display (format nil "Origin: ~A"  origin))
      (display (format nil "Scale: ~A"   scale))
    )
  )

  (sd-subscribe-event doc3d::*DOC3D-POST-SHOW-DOCUPLANE-EVENT*
    'show-docuplane-info)
[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]
© 2019 Parametric Technology GmbH
(a subsidiary of PTC Inc.), All Rights Reserved