SchemeExt:Component:box

From DocR23

Jump to: navigation, search

Contents

Action

Returns the box of a component of an assembly in the context of the assembly's root model.

Filename

scm/scmext/kern/asm_scm.cpp

APIs

asmi_component_get_box

Syntax

(component:box comp [create_box=#f] [box_mode="default"] [opts])

Argument Types

Argument Scheme Data Type
comp component
create_box boolean
box_mode string | integer
opts acis-options

Returns

pair

Description

Returns the component's box in the context of the assembly's root model. The argument create_box is set to #f if unspecified; if it is #t, a solid block representing the component's box is created.

Arguments

  • comp specifies the component whose box is queried.
  • create_box specifies the creation of a block representing the box.
  • box_mode specifies the string or integer used to control which box type is returned. The box_mode argument includes these values:
0 "tight"
1 "loose"
2 "quick"
3 "default"
4 "default_pre_R12"
5 "exact"
  • opts contains journaling and versioning information.

Example

; component:box
; Create a model in the active part.
(define part_model (model:create))
;; part_model
(solid:block 0 0 0 10 10 10)
;; #[entity 1 1]
; Make a new part and set it active.
(define subasm_part (part:new))
;; subasm_part
(env:set-active-part subasm_part)
;; ()
; Create a model containing an assembly.
(define subasm_model (model:create))
;; subasm_model
(model:create-assembly)
;; ()
; Create the transform to be used on part_model.
(define part_transf (transform:translation (gvector 1 0 0)))
;; part_transf
; Create a model reference for part_model within the assembly.
(define part_model_ref (model:add-model-ref part_model part_transf))
;; part_model_ref
; Make a new part and set it active.
(define asm_part (part:new))
;; asm_part
(env:set-active-part asm_part)
;; ()
; Create a model containing an assembly.
(define asm_model (model:create))
;; asm_model
(model:create-assembly)
;; ()
; Create the transform to be used on part_model.
(define subasm_transf (transform:translation (gvector 0 0 10)))
;; subasm_transf
; Create a model reference for subasm_model within the assembly.
(define subasm_model_ref (model:add-model-ref subasm_model subasm_transf))
;; subasm_model_ref
; Get the component of asm_model associated with the block.
(define comp (component (list subasm_model_ref part_model_ref)))
;; comp
; Get the box of the component.
(component:box comp)
;; (#[ position 1 0 10 ] . #[ position 11 10 20 ])
Personal tools