ds:get-active-patch
List of: Scheme Extensions
Subjects: Deformable Surfaces
Contents: ACIS Deformable Modeling

Action: Gets the tag identifier number of the currently active patch within the patch hierarchy of the given deformable model.

Filename: adm/ds_scm/dsscm.cxx

APIs: api_dm_get_attrib_dm2acis

Syntax: (ds:get-active-patch owner)

Arg Types: owner entity

Returns: integer

Description: Returns the tag identifier number for the active patch within the deformable model patch hierarchy associated with the input owner.


Making the query on an owner without a deformable model causes a deformable model to be added to the entity and a tag identifier value is returned.


owner ACIS face or edge on which the deformable model lives.

Example: ; ds:get-active-patch

; Add to a square test face a parabolic crv-load

; and use it.

; Build a test square spline face.

; (6x6 control points, x and y side length = 36)

(define dsmodel1 (ds:test-face 6 6 36 36 0))

;; dsmodel1

; Don't display entity / ds test face exists

(define erase (entity:erase dsmodel1))

;; erase

; Render the loads and constraints.

(ds:set-draw-state dsmodel1 1


(+ ds-draw-cstrns ds-draw-loads))

;; ()


; Add a pt-cstrn at the center of the parent and

; track it.

(define cc1 (ds:add-pt-cstrn dsmodel1


1 "position" (par-pos 0.5 0.5)))

;; cc1

(ds:set-pt-xyz dsmodel1 cc1 0


(position 18 18 10))

;; 8

; Compute a new deformable model position

(ds:solve dsmodel1 1 1)

;; ()


; Add a patch to the parent shape.

; The new patch becomes the active shape.

(define patch1 (ds:add-patch dsmodel1 1 1


(par-pos 0.3 0.3) (par-pos 0.5 0.5)


(par-pos 0.7 0.7) 3))

;; patch1


; Add and track a pt-cstrn on the patch.

(define cc2 (ds:add-pt-cstrn dsmodel1


1 "position" (par-pos 0.5 0.5)))

;; cc2

(ds:set-pt-xyz dsmodel1 cc2 0


(position 18 18 36))

;; 8

; Compute a new deformable model position

(ds:solve dsmodel1 1 -3)

;; ()


; Find the tag identifier value of the active patch

(ds:get-active-patch dsmodel1)

;; 8
PDF/ADM/05SCD.PDF
HTM/DATA/ADM/ADM/05SCD/0006.HTM