Scheme Extensions

 

 

Technical Article


Scheme is a public domain programming language, based on the LISP language, that uses an interpreter to run commands. ACIS provides extensions (written in C++) to the native Scheme language that can be used by an application to interact with ACIS through its Scheme Interpreter. The C++ source files for ACIS Scheme extensions are provided with the product. Spatials Scheme based demonstration application, Scheme ACIS Interface Driver Extension (Scheme AIDE), also uses these Scheme extensions and the Scheme Interpreter.

assembly?

Action
Determines if a scheme-object is an assembly.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(assembly? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is an assembly; otherwise, it returns #f.

Arguments
object specifies a scheme-object that is to be queried as being an assembly.
; assembly?
; Create a new model.
(define asm_model (model:create))
;; asm_model
; Is asm_model an assembly?
(assembly? asm_model)
;; #f
; Put an assembly in the model.
(model:create-assembly)
;; ()
(part:entities)
;; (#[entity 1 1])
; Is the entity an assembly?
(assembly? (entity 1 1))
;; #t

[Top]


asm-example:export

Action
Exports one or more assembly models from a customer assembly to an ASAT file.

Filename
scm/scmext/kern/asm_example_scm.cpp

APIs
None

Syntax
(asm-example:export type file [models=active] [text=#t])

Arg Types
type integer
file string
models (model...)
text boolean

Returns
boolean

Description
This extension exports in Monolithic mode; that is, all models are exported to the same file. Only top-level (primary) models need to be specified; the routine automatically saves any sub-models upon which the primary models depend.

The text argument is a boolean that switches between text and binary mode.

Arguments
type specifies the customer decoration type. Specify 1 for instance decorations or 2 for component properties.

file specifies the export file name.

models specifies the models to be exported.

text controls whether the file is imported in text (#t) or binary (#f) mode.
; asm-example:export

[Top]


asm-example:import

Action
Imports one or more assembly models from an ASAT file to a customer assembly.

Filename
scm/scmext/kern/asm_example_scm.cpp

APIs
None

Syntax
(asm-example:import type file [text=#t])

Arg Types
type integer
file string
text boolean

Returns
(model...)

Description
This scheme extension returns a list of primary models. Each imported model is bound to an entity manager.

If the text argument is #t, the file being restored is understood to be in text mode, as opposed to binary.

Arguments
type specifies the customer decoration type. Specify 1 for instance decorations or 2 for component properties.

file specifies the import file name.

text controls whether the file is imported in text (#t) or binary (#f) mode.
; asm-example:import

[Top]


component?

Action
Determines if a scheme-object is a component.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(component? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is a component; otherwise, it returns #f.

Arguments
object specifies a scheme-object that is to be queried as being a component.
; component?
; 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 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 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
; Get the component associated with the part_model reference.
(define part_model_comp (component part_model_ref))
;; part_model_comp
; Is it a component?
(component? part_model_comp)
;; #t
; Is the part_model reference a component?
(component? part_model_ref)
;; #f

[Top]


component

Action
Returns a component object.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_get_component_handle

Syntax
(component {path_mref_list | path_mref | comp_list | comp_model} [opts])

Arg Types
path_mref_list (entity...)
path_mref entity
comp_list (component...)
comp_model model
opts acis-options

Returns
component

Description
This extension gets the handle for the component (that is, the path through the folded assembly tree) in one of three ways:
Lists must be in the order tip-to-tail, with the highest (nearest the root of the assembly tree) item appearing first. Because a component is just a path through the folded (model-reference) assembly tree, a tip-to-tail list of components (paths) can be concatenated to form a new component (path).

CAUTION:  This extension is intended to be used only by experts working with the folded assembly tree (for example, in a translation application). Most customers should instead use the component interface, for example, model:components to walk the assembly tree.

Arguments
path_mref_list specifies a path of model references.

path_mref specifies a single model reference.

comp_list specifies a list of components.

comp_model specifies an assembly model.

opts contains journaling and versioning information.
; component
; 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

[Top]


component:add-property

Action
Adds a property to the specified component.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
api_asm_component_add_property

Syntax
(component:add-property comp prop [prop_owning_model] [opts])

Arg Types
comp component
prop entity
prop_owning_model model
opts acis-options

Returns
Unspecified

Description
This extension attaches a property attribute to an ATTRIB_COMPONENT_PROPERTY_OWNER entity (which points to the component) in the component's root model. If no ATTRIB_COMPONENT_PROPERTY_OWNER exists for the component, one is created. Refer to the section Properties in Assembly Modeling for more details.

Note:   Adding a property to the root component of a part model (with no assembly) is not allowed.

This action is equivalent to modifying the part; part-modeling operations should be used to change the contents of the part instead. Modifying the root component of an assembly model is allowed, however. Note also that the property attribute must be created and this extension must be called while the history stream of the component's root model is active. This is necessary because this extension attaches the property attribute to an entity in the root model.

Arguments
comp specifies the component to which the property is added.

prop specifies the property attribute to be added.

prop_owning_model specifies the model that owns the property.

opts contains journaling and versioning information.
; component:add-property

[Top]


component:box

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])

Arg Types
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.
; 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 ])

[Top]


component:color

Action
Returns the color, defined at the assembly level, of the specified component within an assembly.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_find_color

Syntax
(component:color comp [opts])

Arg Types
comp component
opts acis-options

Returns
color

Description
A color property of the component is returned only if it has been set at the assembly level.

Arguments
comp specifies the component whose color is queried.

opts contains journaling and versioning information.
; component:color
; 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
; Confirm that no color has been applied to the component.
(component:color comp)
;; ()

[Top]


component:component-entities

Action
Returns a list of component-entities for a component.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_component_entities

Syntax
(component:component-entities comp [opts])

Arg Types
comp component
opts acis-options

Returns
(component-entity...)

Description
This is a text-based interface to the extraction of component-entities. These can also be extracted interactively via a pointer device (for example, pick-asm:face).

Arguments
comp specifies the component whose component-entities are to be found.

opts contains journaling and versioning information.
; component:component-entities
; 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 component-entities associated with the block component.
(component:component-entities comp)
;; (#[component-entity 1 3])

[Top]


component:entities

Action
Returns a list of part-modeling entities contained within a component's model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_entities

Syntax
(component:entities comp [opts])

Arg Types
comp component
opts acis-options

Returns
(entity...)

Description
This extension does not include the model's assembly entity, if any, in the list. This is the preferred query function for client code to use to obtain the part data associated with a particular component within the assembly tree, as it correctly takes into account suppressed and over-ridden models.

Arguments
comp specifies the component whose part-modeling entities are to be found.

opts contains journaling and versioning information.
; component:entities
; 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 entities associate with the block component.
(component:entities comp)
;; (#[entity 1 1])

[Top]


component:get-rel-transform

Action
Queries the relative transform between two components of the same assembly.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_relative_transform

Syntax
(component:get-rel-transform origin target [include_units_rescaling=#t] [opts])

Arg Types
origin component
target component
include_units_rescaling boolean
opts acis-options

Returns
transform

Description
The component origin, when transformed by the returned transform, will appear at the position and with the same orientation as the component target, in the coordinate system of the former. The argument include_units_rescaling determines whether the transform includes the rescaling necessary to account for a difference in units between the component model and the root assembly.

Arguments
origin specifies the start component in determining the transform.

target specifies the end component in determining the transform.

include_units_rescaling specifies whether differences in units are considered.

opts contains journaling and versioning information.
; component:get-rel-transform
; 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 comp1 (component (list subasm_model_ref part_model_ref)))
;; comp1
; Get the component of asm_model associated with the subassembly.
(define comp2 (component subasm_model_ref))
;; comp2
; Get and print the transform of comp1 relative to comp2.
(transform:print (component:get-rel-transform comp2 comp1))
;; no rotation no reflection no shear not identity
;; translation part:
;; 1.000000 0.000000 0.000000
;; affine part:
;; 1.000000 0.000000 0.000000
;; 0.000000 1.000000 0.000000
;; 0.000000 0.000000 1.000000
;; scaling part:
;; 1.000000
;; Steps to reconstruct transf...
;; 1.) Translate (1.000000, 0.000000, 0.000000)
;; #[transform 129417072]

[Top]


component:get-transform

Action
Queries the transform that positions and orients a component within the root assembly.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_transform

Syntax
(component:get-transform comp [include_units_rescaling=#t] [opts])

Arg Types
comp component
include_units_rescaling boolean
opts acis-options

Returns
transform

Description
The returned transform is the composition of the transforms of all model references that define the component.

The include_units_rescaling argument determines whether the transform includes the rescaling necessary to account for differences in units between the component model and the root assembly. The default value is #t.

Arguments
comp specifies the model whose components are queried.

include_units_rescaling specifies the filter string used to control which components are returned.

opts contains journaling and versioning information.
; component:get-transform
; 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 and print the transform associated with comp.
(transform:print (component:get-transform comp))
;; no rotation no reflection no shear not identity
;; translation part:
;; 1.000000 0.000000 10.000000
;; affine part:
;; 1.000000 0.000000 0.000000
;; 0.000000 1.000000 0.000000
;; 0.000000 0.000000 1.000000
;; scaling part:
;; 1.000000
;; Steps to reconstruct transf...
;; 1.) Translate (1.000000, 0.000000, 10.000000)
;; #[transform 129413624]

[Top]


component:has-color-modifications

Action
Queries whether there are color properties that affect the specified component of an assembly model, its child components, and its parents.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_has_color_modifications

Syntax
(component:has-color-modifications comp [opts])

Arg Types
comp component
opts acis-options

Returns
(boolean...)

Description
The result is a three-member list that contains boolean values representing child, self, and parent modifications, in that order.

Arguments
comp specifies the component queried for color modifications.

opts contains journaling and versioning information.
; component:has-color-modifications
; 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 comp1 (component (list subasm_model_ref part_model_ref)))
;; comp1
; Color the component red.
(component:set-color comp1 (color:rgb 1 0 0))
;; ()
; Get the component of asm_model associated with the subassembly.
(define comp2 (component subasm_model_ref))
;; comp2
; Ask for its color modifications.
(component:has-color-modifications comp2)
;; (#t #f #f)

[Top]


component:has-hiding-modifications

Action
Queries whether there are properties that affect the visibility (but not existence) of the specified component of an assembly model, its child components, and its parents.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_has_hiding_modifications

Syntax
(component:has-hiding-modifications comp [opts])

Arg Types
comp component
opts acis-options

Returns
(boolean...)

Description
This extension queries whether there are properties that affect the visibility (but not existence) of the specified component of an assembly model, its child components, and its parents. The result is a three-member list that contains boolean values representing child, self, and parent modifications, in that order.

Arguments
comp specifies the component queried for hiding modifications.

opts contains journaling and versioning information.
; component:has-hiding-modifications
; 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 comp1 (component (list subasm_model_ref part_model_ref)))
;; comp1
; Hide the component.
(component:hide comp1)
;; ()
; Get the component of asm_model associated with the subassembly.
(define comp2 (component subasm_model_ref))
;; comp2
; Ask for its hiding modifications.
(component:has-hiding-modifications comp2)
;; (#t #f #f)

[Top]


component:has-material-modifications

Action
Queries whether there are material properties that affect the specified component of an assembly model, its child components, and its parents.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_has_material_modifications

Syntax
(component:has-material-modifications comp [opts])

Arg Types
comp component
opts acis-options

Returns
(boolean...)

Description
This extension queries whether there are material properties that affect the specified component of an assembly model, its child components, and its parents. The result is a three-member list that contains boolean values representing child, self, and parent modifications, in that order.

Arguments
comp specifies the component queried for material modifications.

opts contains journaling and versioning information.
; component:has-material-modifications
; 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 comp1 (component (list subasm_model_ref part_model_ref)))
;; comp1
; Set the component's transparency to 50%.
(component:set-transparency comp1 0.5)
;; ()
; Get the component of asm_model associated with the subassembly.
(define comp2 (component subasm_model_ref))
;; comp2
; Ask for its material modifications.
(component:has-material-modifications comp2)
;; (#t #f #f)

[Top]


component:has-physical-modifications

Action
Queries whether there are physical properties (such as suppression) that affect the specified component of an assembly model, its child components, and its parents.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_has_physical_modifications

Syntax
(component:has-physical-modifications comp [opts])

Arg Types
comp component
opts acis-options

Returns
(boolean...)

Description
A physical property is one that changes one or more components of the assembly in such a way that the (un-instanced) B-Rep model equivalent to the assembly would be different.

The result is a three-member list that contains boolean values representing child, self, and parent modifications, in that order.

Arguments
comp specifies the component queried for physical modifications.

opts contains journaling and versioning information.
; component:has-physical-modifications
; 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 comp1 (component (list subasm_model_ref part_model_ref)))
;; comp1
; Suppress the component.
(component:suppress comp1)
;; ()
; Get the component of asm_model associated with the subassembly.
(define comp2 (component subasm_model_ref))
;; comp2
; Ask for its physical modifications.
(component:has-physical-modifications comp2)
;; (#t #f #f)

[Top]


component:hidden?

Action
Queries whether the specified component of an assembly model is hidden.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_is_hidden

Syntax
(component:hidden? comp [opts])

Arg Types
comp component
opts acis-options

Returns
boolean

Description
This extension queries whether the specified component of an assembly model is hidden.

Arguments
comp specifies the component queried for hiding.

opts contains journaling and versioning information.
; component:hidden?
; 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
; Hide the component.
(component:hide comp)
;; ()
(component:hidden? comp)
;; #t
; Unhide the component.
(component:unhide comp)
;; ()
(component:hidden? comp)
;; #f

[Top]


component:hide

Action
Hides the specified component of an assembly model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_hide

Syntax
(component:hide comp [prop_owning_model] [opts])

Arg Types
comp component
prop_owning_model model
opts acis-options

Returns
Unspecified

Description
This extension hides the specified component of an assembly model. If the property-owning model is not specified, the root model of the component is used.

Arguments
comp specifies the component to be hidden.

prop_owning_model specifies the model that owns the property (hiding).

opts contains journaling and versioning information.
; component:hide
; 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
; Hide the component.
(component:hide comp)
;; ()

[Top]


component:massprops

Action
Queries the mass properties of a component.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_mass_props

Syntax
(component:massprops comp [mp_opts] [opts])

Arg Types
comp component
mp_opts massprops-options
opts acis-options

Returns
massprops

Description
The argument comp represents the component whose mass properties are desired. The optional mp_opts argument encapsulates all options affecting the calculation.

This extension finds the mass properties requested by the user. These include the volume, center of gravity (centroid), inertia tensor, principal moments, and principal axes of the given body. Options controlling the calculation are specified by means of an (optional) massprops-options object, the results are returned in the form of a massprops object. (Refer to the documentation of these two Scheme data types for details on setting options and retrieving the calculated results, respectively.)

When the massprops-options argument is omitted, the following default behavior is followed:

  1. projection-plane information is selected internally
  2. volume, centroid, and inertia are all calculated
  3. the requested relative accuracy is one-percent
  4. sheets are treated as having zero thickness
  5. errors are thrown when voids or open, one-sided sheets are encountered

You should provide a configured massprops-options object; unless alternate behavior is preferred.

Arguments
comp specifies the component whose mass properties are queried.

mp_opts specifies the options object used to configure non-default behavior.

opts contains journaling and versioning information.
; component:massprops
; 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 massprops of the component.
(component:massprops comp)
;; #[massprops:
;; level = "volume-centroid-and-inertia",
;; volume = 1000,
;; rel accy vol achieved = 0,
;; centroid = (6 5 15),
;; inertia = (266667 30000 90000)
;; (30000 277667 75000)
;; (90000 75000 77666.7)]

[Top]


component:model

Action
Returns the raw model associated with the specified component.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_unmodified_model

Syntax
(component:model comp [opts])

Arg Types
comp component
opts acis-options

Returns
model

Description
A raw model differs from the actual model of a component by properties that are applied to the component or its subcomponents at higher levels of the assembly tree. For example, if the front left wheel of a car were suppressed, the components of the actual front axle assembly (with only one wheel) would be different from the components of the raw front axle assembly (with two wheels).

Arguments
comp specifies the component to be queried.

opts contains journaling and versioning information.
; component:model
; 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 raw model associated with comp.
(component:model comp)
;; #[model 1]

[Top]


component:model-ref-path

Action
Returns the path of model references, through the folded assembly tree, that corresponds to a particular component.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_path

Syntax
(component:model-ref-path comp [opts])

Arg Types
comp component
opts acis-options

Returns
(entity...)

Description
This extension allows client code to generate a unique identifier for the component, based on the combination of the component's root model and the list of model references. No two components in memory will have identical paths, so users may use identifiers for the elements of the path (assigned by the user) to uniquely identify the corresponding component.

Arguments
comp specifies the component to be queried.

opts contains journaling and versioning information.
; component:model-ref-path
; 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 model-ref path associated with comp.
(component:model-ref-path comp)
;; (#[entity 2 3] #[entity 2 2])

[Top]


component:modified?

Action
Queries whether a component has been modified by properties applied higher in the assembly tree.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_is_model_modified

Syntax
(component:modified? comp [opts])

Arg Types
comp component
opts acis-options

Returns
boolean

Description
Queries whether a component has been modified by properties applied higher in the assembly tree.

Arguments
comp specifies the component to be queried.

opts contains journaling and versioning information.
; component:modified?
; 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 associated with asm_model.
(define comp1 (component asm_model))
;; comp1
; Get the component of asm_model associated with the subassembly.
(define comp2 (component subasm_model_ref))
;; comp2
; Get the component of asm_model associated with the block.
(define comp3 (component (list subasm_model_ref part_model_ref)))
;; comp3
; Apply a color to comp2.
(component:set-color comp2 (color:rgb 0 0 1))
;; ()
; Ask whether comp1 is modified.
(component:modified? comp1)
;; #f
; Ask whether comp2 is modified.
(component:modified? comp2)
;; #t
; Ask whether comp3 is modified.
(component:modified? comp3)
;; #t

[Top]


component:name

Action
Returns the name associated with a component.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_name

Syntax
(component:name comp [opts])

Arg Types
comp component
opts acis-options

Returns
string

Description
This extension returns the name associated with a component.

Arguments
comp specifies the component whose name is desired.

opts contains journaling and versioning information.
; component:name
; 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
; Set the component's name.
(component:set-name comp "block component")
;; ()
; Verify the component's name.
(component:name comp)
;; "block component"

[Top]


component:parent

Action
Returns the parent component for the specified component.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_parent

Syntax
(component:parent comp [opts])

Arg Types
comp component
opts acis-options

Returns
component

Description
This extension returns the parent component of a specified component.

Arguments
comp specifies the component to be queried.

opts contains journaling and versioning information.
; component:parent
; 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 parent component of comp.
(component:parent comp)
;; #[component 2 3]

[Top]


component:remove-color

Action
Removes the assembly-level color attribute of the specified component within an assembly.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_remove_color

Syntax
(component:remove-color comp [prop_owning_model] [opts])

Arg Types
comp component
prop_owning_model model
opts acis-options

Returns
Unspecified

Description
This extension removes the assembly-level color attribute of the specified component within an assembly. If the property-owning model is not specified, the root model of the component is used.

Arguments
comp specifies the component whose color attribute is to be removed.

prop_owning_model specifies the model that owns the property (color).

opts contains journaling and versioning information.
; component:remove-color
; 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
; Color the component red.
(component:set-color comp (color:rgb 1 0 0))
;; ()
; Get the component's color.
(component:color comp)
;; #[ color 1 0 0 ]
; Remove the component's color.
(component:remove-color comp)
;; ()
; Get the component's color.
(component:color comp)
;; ()

[Top]


component:root-model

Action
Returns the root model of a specified component.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_root_model

Syntax
(component:root-model comp [opts])

Arg Types
comp component
opts acis-options

Returns
model

Description
The root model of a component is the model corresponding to the root assembly in which the component occurs.

Arguments
comp specifies the component to be queried.

opts contains journaling and versioning information.
; component:root-model
; 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 root model associated with comp.
(component:root-model comp)
;; #[model 3]

[Top]


component:set-color

Action
Sets the color, at the assembly level, of the specified component within an assembly.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_set_color

Syntax
(component:set-color comp color [prop_owning_model] [opts])

Arg Types
comp component
color color
prop_owning_model model
opts acis-options

Returns
Unspecified

Description
This extension sets the color, at the assembly level, of the specified component within an assembly. If the property-owning model is not specified, it defaults to the root model of the component.

Arguments
comp specifies the component to which the color is applied.

color specifies the applied color.

prop_owning_model specifies the model that owns the property (color).

opts contains journaling and versioning information.
; component:set-color
; 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
; Color the component red.
(component:set-color comp (color:rgb 1 0 0))
;; ()

component:set-name

Action
Associates a name with a component.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_set_name

Syntax
(component:set-name comp name [opts])

Arg Types
comp component
name string
opts acis-options

Returns
Unspecified

Description
This extension associates a name with a component.

Arguments
comp specifies the component to be named.

name specifies the name to be associated with the component.

opts contains journaling and versioning information.
; component:set-name
; 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
; Set the component's name.
(component:set-name comp "block component")
;; ()

[Top]


component:set-transparency

Action
Sets the transparency, at the assembly level, of the specified component within an assembly.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_set_transparency

Syntax
(component:set-transparency comp transp [prop_owning_model] [opts])

Arg Types
comp component
transp real
prop_owning_model model
opts acis-options

Returns
Unspecified

Description
The transparency value must be between 0 (transparent) and 1 (opaque). If the property-owning model is not specified, the root model of the component is used.

Arguments
comp specifies the component whose transparency is set.

transp specifies the new transparency value.

prop_owning_model specifies the model that owns the property (transparency).

opts contains journaling and versioning information.
; component:set-transparency
; 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
; Set the component's transparency to 50%.
(component:set-transparency comp 0.5)
;; ()

[Top]


component:sub-components

Action
Returns a list of the sub-components of a component of a model by walking the underlying model's assembly tree.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_sub_components

Syntax
(component:sub-components comp [which="sub"] [opts])

Arg Types
comp component
which string
opts acis-options

Returns
(component...)

Description
This is a preferred query function for client code to use to unfold the assembly tree, as it correctly takes into account suppressed and over-ridden models. The filter string which may be used to specify the components to be returned:

"all" all components of the specified model, including the component corresponding to the model, are returned.
"sub" all proper sub-components of the specified model are returned
"immediate" only the immediate sub-components of the model's component are returned
"leaf" all sub-components that correspond to part models are returned

If a filter string is not given, all components are returned.

Arguments
comp specifies the component whose sub-components are queried.

which specifies the filter string used to control which components are returned.

opts contains journaling and versioning information.
; component:sub-components
; 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 corresponding to asm_model.
(define comp (component asm_model))
;; comp
; Get its immediate sub-components.
(component:sub-components comp "immediate")
;; (#[component 2 3])
; Get its leaf sub-components.
(component:sub-components comp "leaf")
;; (#[component 3 3])

[Top]


component:suppress

Action
Suppresses the specified component of an assembly model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_suppress

Syntax
(component:suppress comp [prop_owning_model] [opts])

Arg Types
comp component
prop_owning_model model
opts acis-options

Returns
Unspecified

Description
If the property-owning model is not specified, the root model of the component is used.

Arguments
comp specifies the component suppressed.

prop_owning_model specifies the model that owns the property (suppression).

opts contains journaling and versioning information.
; component:suppress
; 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
; Suppress the component.
(component:suppress comp)
;; ()

[Top]


component:suppressed?

Action
Queries whether the specified component of an assembly model is suppressed.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_is_suppressed

Syntax
(component:suppressed? comp [opts])

Arg Types
comp component
opts acis-options

Returns
boolean

Description
This extension queries whether the specified component of an assembly model is suppressed.

Arguments
comp specifies the component queried for suppression.

opts contains journaling and versioning information.
; component:suppressed?
; 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
; Confirm that the component is not suppressed.
(component:suppressed? comp)
;; #f

[Top]


component:transparency

Action
Returns the transparency, defined at the assembly level, for the specified component within an assembly.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_find_transparency

Syntax
(component:transparency comp [opts])

Arg Types
comp component
opts acis-options

Returns
real

Description
The returned transparency value ranges from 0 (transparent) to 1 (opaque).

Arguments
comp specifies the model whose transparency is queried.

opts contains journaling and versioning information.
; component:transparency
; 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
; Confirm that the component is opaque.
(component:transparency comp)
;; 1

[Top]


component:unhide

Action
Removes the hiding property from the specified component of an assembly model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_unhide

Syntax
(component:unhide comp [prop_owning_model] [opts])

Arg Types
comp component
prop_owning_model model
opts acis-options

Returns
Unspecified

Description
This extension removes the hiding property from the specified component of an assembly model. If the property-owning model is not specified, the root model of the component is used.

Arguments
comp specifies the component to be unhidden.

prop_owning_model specifies the model that owns the property (hiding).

opts contains journaling and versioning information.
; component:unhide
; 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
; Hide the component.
(component:hide comp)
;; ()
(component:hidden? comp)
;; #t
; Unhide the component.
(component:unhide comp)
;; ()
(component:hidden? comp)
;; #f

[Top]


component:units-ratio

Action
Queries the ratio between a component model's units and those of the root assembly.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_get_transform

Syntax
(component:units-ratio comp [opts])

Arg Types
comp component
opts acis-options

Returns
real

Description
This extension queries the ratio between a component model's units and those of the root assembly.

Arguments
comp specifies the component whose units is queried.

opts contains journaling and versioning information.
; component:units-ratio

[Top]


component:unsuppress

Action
Removes the suppression property from the specified component of an assembly model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_unsuppress

Syntax
(component:unsuppress comp [prop_owning_model] [opts])

Arg Types
comp component
prop_owning_model model
opts acis-options

Returns
Unspecified

Description
This extension removes the suppression property from the specified component of an assembly model. If the property-owning model is not specified, the root model of the component is used.

Arguments
comp specifies the component to be unsuppressed.

prop_owning_model specifies the model that owns the property (suppression).

opts contains journaling and versioning information.
; component:unsuppress
; 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
; Suppress the component.
(component:suppress comp)
;; ()
(component:suppressed? comp)
;; #t
; Unsuppress the component.
(component:unsuppress comp)
;; ()
(component:suppressed? comp)
;; #f

[Top]


component-entity?

Action
Determines if a scheme-object is a component entity.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(component-entity? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is a component entity; otherwise, it returns #f.

Arguments
object specifies a scheme-object that is to be queried as being a component entity.
(view:gl)
#[view 1902562]
; component-entity?
; 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 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 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
; Is the model reference a component-entity?
(component-entity? part_model_ref)
;; #f
; Pick one of the faces of the part_model component.
(define part_model_comp_ent (pick-asm:face (read-event) 1))
;; part_model_comp_ent
; Have we picked a component-entity?
(component-entity? part_model_comp_ent)
;; #t

[Top]


component-entity

Action
Returns the component entity corresponding to the specified component and entity.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_get_component_entity_handle

Syntax
(component-entity comp ent [opts])

Arg Types
comp component
ent entity
opts acis-options

Returns
component-entity

Description
This extension returns the component entity corresponding to the specified component and entity.

Arguments
comp specifies the input component.

ent specifies the input entity.

opts contains journaling and versioning information.
; component-entity
; 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 comp1 (component (list subasm_model_ref part_model_ref)))
;; comp1
; Get the component-entity associate with the block component.
(define comp-ent (car (component:component-entities comp1)))
;; comp-ent
; Decompose comp-ent into its component and entity.
(define ent (component-entity:entity comp-ent))
;; ent
(define comp2 (component-entity:component comp-ent))
; Recompose the component entity
(component-entity comp2 ent)
;; #[component-entity 1 3]
; Show that it's the same as comp-ent
comp-ent
;; #[component-entity 1 3]

[Top]


component-entity:component

Action
Returns the component corresponding to the specified component entity.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_entity_handle_decompose

Syntax
(component-entity:component comp_ent [opts])

Arg Types
comp_ent component-entity
opts acis-options

Returns
component

Description
This extension returns the component corresponding to the specified component entity.

Arguments
comp_ent specifies the component entity whose component is queried.

opts contains journaling and versioning information.
; component-entity:component
; 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 component-entity associate with the block component.
(define comp-ent (car (component:component-entities comp)))
;; comp-ent
; Get the component part of the component-entity.
(component-entity:component comp-ent)
;; #[component 1 3]
; See that it's the same as comp.
comp
;; #[component 1 3]

[Top]


component-entity:entity

Action
Returns the entity corresponding to the specified component entity.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_component_entity_handle_decompose

Syntax
(component-entity:entity comp_ent [opts])

Arg Types
comp_ent component-entity
opts acis-options

Returns
entity

Description
This extension returns the entity corresponding to the specified component entity.

Arguments
comp_ent specifies the component entity whose entity is queried.

opts contains journaling and versioning information.
; component-entity:entity
; 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 component-entity associate with the block component.
(define comp-ent (car (component:component-entities comp)))
;; comp-ent
; Get the entity part of the component-entity.
(component-entity:entity comp-ent)
;; #[entity 1 1]
; See that it's the same as the block.
(model:entities part_model)
;; (#[entity 1 1])

[Top]


component-entity:set-highlight

Action
Sets highlighting for a component entity or list of component entities.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(component-entity:set-highlight comp_ent_list on)

Arg Types
comp_ent_list component-entity | (component-entity...)
on boolean

Returns
(component-entity...)

Description
This extension sets highlighting for a component entity or list of component entities. The argument comp_ent_list specifies a component entity or list of component entities to be highlighted or unhighlighted. This extension returns the input component entity list.

Setting the argument on to #t activates highlighting for the specified component entities; setting it to #f deactivates highlighting. The highlight color is initialized to white.

Note:  In order for highlighting to be visible, the default color of the highlight must be different from the color of the entity.

Arguments
comp_ent_list specifies the component entity or list of component entities to highlight or unhighlight.

on is the flag for indicating highlighting (#t) or unhighlighting (#f).
; component-entity:set-highlight
; Create a model in the active part.
(view:gl)
#[view 32376490]
(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 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 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
; Pick one of the faces of the part_model component.
(define part_model_comp_ent (pick-asm:face (read-event) 1))
;; part_model_comp_ent
; Set highlighting "on" for the face.
(component-entity:set-highlight part_model_comp_ent #t)
;; #[component-entity 1 2]
; Set highlighting "off" for the face.
(component-entity:set-highlight part_model_comp_ent #f)
;; #[component-entity 1 2]

[Top]


env:asm-cleanup

Action
Deletes all unneeded models and handle objects according to the specified cleanup options.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_cleanup

Syntax
(env:asm-cleanup [ent_opt=#t comp_opt=#t comp_ent_opt=#t] [opts])

Arg Types
ent_opt boolean
comp_opt boolean
comp_ent boolean
opts acis-options

Returns
Unspecified

Description
An object is considered unneeded if it is not being held by any other object. (Refer to the section Use Counting and Holding Objects in Assembly Modeling.) This extension recursively asks the global model manager to search for and delete any model objects that are not being held. This extension also calls cleanup on each model object, which removes unneeded handles from the model objects. This procedure is performed recursively until only objects that are being held remain.

The logical arguments ent_opt, comp_opt, and comp_ent_opt control which types of handle are cleaned up. The default behavior is to clean up all three types: entity handles, component handles, and component-entity handles.

Arguments
ent_opt specifies that the entity handles are to be cleaned up if set to #t.

comp_opt specifies that the component handles are to be cleaned up if set to #t.

comp_ent_opt specifies that the component-entity handles are to be cleaned up if set to #t.

opts contains journaling and versioning information.
; env:asm-cleanup

[Top]


env:asm-cleanup-handles

Action
Deletes all unneeded handles of all models, according to the specified cleanup options.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_cleanup_handles

Syntax
(env:asm-cleanup-handles [ent_opt=#t comp_opt=#t comp_ent_opt=#t] [opts])

Arg Types
ent_opt boolean
comp_opt boolean
comp_ent_opt boolean
opts acis-options

Returns
Unspecified

Description
An object is considered unneeded if it is not being held by any other object. (Refer to the section Use Counting and Holding Objects in Assembly Modeling.) This extension recursively asks the global model manager to call cleanup on each model object, which removes unneeded handles from the model object. This procedure is performed recursively until only handles that are being held remain.

The logical arguments ent_opt, comp_opt, and comp_ent_opt control which type of objects are to be cleaned up. The default behavior is to clean up all three types: entity handles, component handles, and component-entity handles.

Arguments
ent_opt specifies that the entity handles are to be cleaned up if set to #t.

comp_opt specifies that the component handles are to be cleaned up if set to #t.

comp_ent_opt specifies that the component-entity handles are to be cleaned up if set to #t.

opts contains journaling and versioning information.
; env:asm-cleanup-handles

[Top]


env:asm-cleanup-models

Action
Deletes all unneeded model objects.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_cleanup_models

Syntax
(env:asm-cleanup-models [opts])

Arg Types
opts acis-options

Returns
Unspecified

Description
An object is considered unneeded if it is not being held by any other object. (Refer to the section Use Counting and Holding Objects in Assembly Modeling.) This extension recursively asks the global model manager to search for and delete any model objects that are not being held. This procedure is performed recursively until only model objects that are being held remain.

Note: This extension does not attempt to clean up handle objects.

Arguments
opts contains journaling and versioning information.
; env:asm-cleanup-models

[Top]


env:asm-clear-all

Action
Clears all assembly modeling and part modeling data.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(env:asm-clear-all)

Arg Types
None

Returns
Unspecified
Description
Clears all assembly modeling and part modeling data.
Arguments
None
; env:asm-clear-all

[Top]


model?

Action
Determines if a scheme-object is a model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(model? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is a model; otherwise, it returns #f.

Arguments
object specifies a scheme-object that is to be queried as being a model.
; model?
; assembly?
; Create a new model.
(define asm_model (model:create))
;; asm_model
; Is asm_model a model?
(model? asm_model)
;; #t
; Put an assembly in the model.
(model:create-assembly)
;; ()
(part:entities)
;; (#[entity 1 1])
; Is the entity a model?
(model? (entity 1 1))
;; #f

[Top]


model:add-model-ref

Action
Creates a new model reference object and adds it to an assembly model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_add_model_ref

Syntax
(model:add-model-ref ref_model tform [owning_model=active] [opts])

Arg Types
ref_model model
tform transform
owning_model model
opts acis-options

Returns
entity

Description
The supplied transform determines the location and orientation of the model reference within the assembly, in the assembly model's coordinate system and units. This transform may only involve rotation and translation; reflection, shear, and scaling transforms are not valid.

If owning_model is unspecified, the model associated with the active part owns the new model reference.

Arguments
ref_model specifies the model to which the model reference refers.

tform specifies the transform defining the location and orientation of the model reference.

owning_model specifies the assembly model that is to own the model reference.

opts contains journaling and versioning information.
; model:add-model-ref
; 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 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 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
; Get all model references.
(model:model-refs)
;; (#[entity 2 2])

[Top]


model:cleanup

Action
Deletes a model and its handle objects, if unneeded, according to the specified cleanup options.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_cleanup

Syntax
(model:cleanup [model=active] [ent_opt=#t comp_opt=#t comp_ent_opt=#t] [opts])

Arg Types
model model
ent_opt boolean
comp_opt boolean
comp_ent_opt boolean
opts acis-options

Returns
Unspecified

Description
An object is considered unneeded if it is not being held by any other object. (Refer to the section Use Counting and Holding Objects in Assembly Modeling.) This extension tests a single model object to see if it is being held. If it is not being held, the model object is deleted. If the model object is being held (and thus, is not deleted), the extension attempts to clean up the handles owned by that object.

The logical arguments ent_opt, comp_opt, and comp_ent_opt control which types of handle are cleaned up. The default behavior is to clean up all three types: entity handles, component handles, and component-entity handles.

If the model is unspecified, the model associated with the active part is used.

Arguments
model specifies the model to be cleaned.

ent_opt specifies that the entity handles are to be cleaned up if set to #t.

comp_opt specifies that the component handles are to be cleaned up if set to #t.

comp_ent_opt specifies that the component-entity handles are to be cleaned up if set to #t.

opts contains journaling and versioning information.
; model:cleanup

[Top]


model:cleanup-handles

Action
Deletes all unneeded handle objects belonging to a model, according to specified cleanup options.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_cleanup_handles

Syntax
(model:cleanup-handles [model=active] [ent_opt=#t comp_opt=#t comp_ent_opt=#t] [opts])

Arg Types
model model
ent_opt boolean
comp_opt boolean
comp_ent_opt boolean
opts acis-options

Returns
Unspecified

Description
An object is considered unneeded if it is not being held by any other object. (Refer to the section Use Counting and Holding Objects in Assembly Modeling.)

The logical arguments ent_opt, comp_opt, and comp_ent_opt control which type of objects are cleaned up. The default behavior is to clean up all three types: entity handles, component handles, and component-entity handles.

If the model is unspecified, the model associated with the active part is used.

Arguments
model specifies the model to be cleaned.

ent_opt specifies that the entity handles are to be cleaned up if set to #t.

comp_opt specifies that the component handles are to be cleaned up if set to #t.

comp_ent_opt specifies that the component-entity handles are to be cleaned up if set to #t.

opts contains journaling and versioning information.
; model:cleanup-handles

[Top]


model:cleanup-model

Action
Deletes a model object, if it is unneeded.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_cleanup_model

Syntax
(model:cleanup-model [model=active] [opts])

Arg Types
model model
opts acis-options

Returns
Unspecified

Description
An object is considered unneeded if it is not being held by any other object. (Refer to the section Use Counting and Holding Objects in Assembly Modeling.) This extension tests a single model object to see if it is being held. If it is not being held, the model object is deleted.

Note that this extension does not attempt to clean up handle objects.

If the model is unspecified, the model associated with the active part is used.

Arguments
model specifies the model to be deleted.

opts contains journaling and versioning information.
; model:cleanup-model

[Top]


model:components

Action
Gets the components of the specified model, or the model associated with the active part, according to the specified request filter.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_get_components

Syntax
(model:components [model=active] [which="all"] [opts])

Arg Types
model model
which string
opts acis-options

Returns
(component...)

Description
This is a preferred query function for client code to use to unfold the assembly tree, as it correctly takes into account suppressed and otherwise over-ridden models. The filter string which may be used to specify the components to be returned:

 
"all" all components of the specified model, including the component corresponding to the model, are returned
"sub" all proper sub-components of the specified model are returned
"immediate" only the immediate sub-components of the model's component are returned
"leaf" all sub-components that correspond to part models are returned. If the model is unspecified, the model associated with the active part is used. 
If a filter string is not given, all components are returned.

Arguments
model specifies the model whose components are queried.

which specifies the filter string used to control which components are returned.

opts contains journaling and versioning information.
; model:components
; 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 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 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
; Get all components - the component corresponding to part_model_ref
; and the one corresponding to asm_model itself.
(model:components asm_model "all")
;; (#[component 2 2] #[component 1 2])
; Get only the subcomponents of asm_model.
(model:components asm_model "sub")
;; (#[component 1 2])

[Top]


model:create

Action
Creates a model object.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_create

Syntax
(model:create [part=active make_assembly=#f] [opts])

Arg Types
part part
make_assembly boolean
opts acis-options

Returns
model

Description
If the part is unspecified, the model is associated with the active part. If the entity manager associated with a part does not already exist, a new acis_scm_entity_mgr is created. An assembly entity is created in the model if make_assembly is #t.

Arguments
part specifies the part to which the model is associated.

make_assembly causes an assembly to be created in the model when set to #t.

opts contains journaling and versioning information.
; model:create
; Create a model in the active part, together with an assembly
(define asm_part (env:active-part))
;; asm_part
(define asm_model (model:create asm_part #t))
;; asm_model
; Does the model have an assembly?
(model:has-assembly asm_model)
;; #t
; Is there an assembly among the active part's entities?
(define ents (part:entities))
;; ents
(assembly? (car ents))
;; #t

[Top]


model:create-assembly

Action
Creates an assembly entity within a model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_create_assembly

Syntax
(model:create-assembly [model=active] [opts])

Arg Types
model model
opts acis-options

Returns
Unspecified

Description
This changes a part model into an assembly model. If the model is unspecified, the model associated with the active part is used.

Arguments
model specifies the model to which the assembly entity will be added.
opts contains journaling and versioning information.
; model:create-assembly
; Create a new model in the active part.
(define asm_model (model:create))
;; asm_model
; Put an assembly in the model.
(model:create-assembly)
;; ()

[Top]


model:del-assembly

Action
Deletes the assembly entity within a model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_del_assembly

Syntax
(model:del-assembly [model=active] [opts])

Arg Types
model model
opts acis-options

Returns
Unspecified

Description
This changes an assembly model into a part model. If the model is unspecified, the model associated with the active part is used.

Arguments
model specifies the model from which the assembly entity will be removed.

opts contains journaling and versioning information.
; model:del-assembly
; Create a new model in the active part.
(define asm_model (model:create))
;; asm_model
; Put an assembly in the model.
(model:create-assembly)
;; ()
; There is now an assembly entity associated with the active part.
(part:entities)
;; (#[entity 1 1])
; Delete the assembly.
(model:del-assembly)
;; ()
; There is now no entity associated with the active part.
(part:entities)
;; ()

[Top]


model:entities

Action
Queries a model for the entities managed by its entity manager.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_get_entities

Syntax
(model:entities [model=active] [opts])

Arg Types
model model
opts acis-options

Returns
(entity...)

Description
The model's assembly entity, if any, is not included in the list. If the model is unspecified, the model associated with the active part is used.

Arguments
model specifies the model from which the assembly entity will be removed.

opts contains journaling and versioning information.
; model:entities
; 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]
; List the entities in the model
(model:entities)
;; (#[entity 1 1])

[Top]


model:has-assembly

Action
Queries a model to determine if it contains an assembly entity.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_has_assembly

Syntax
(model:has-assembly [model=active] [opts])

Arg Types
model model
opts acis-options

Returns
boolean

Description
If the model is unspecified, the model associated with the active part is used.

Arguments
model specifies the model queried for an assembly entity.

opts contains journaling and versioning information.
; model:has-assembly
; Create a new model in the active part.
(define asm_model (model:create))
;; asm_model
; The new model has no assembly.
(model:has-assembly)
;; #f
; Put an assembly in the model.
(model:create-assembly)
;; ()
; The model now has an assembly.
(model:has-assembly)
;; #t

[Top]


model:load

Action
Restores one or more assembly models from a file.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_restore_model_list

Syntax
(model:load file [text=#t] [history=#f])

Arg Types
file string
text boolean
history boolean

Returns
(model...)

Description
A list of primary models is returned. Each restored model is bound to an entity manager.

If the text argument is #t, the file being restored is understood to be in text mode, as opposed to binary. The flag history determines whether history information is also to be loaded.

Arguments
file specifies the file containing the models to be restored.

text controls whether the file is in text mode (#t) or binary mode (#f).

history controls whether history information is loaded.
; model:load
; Load a model.
(model:load "myfile.asat")
;; (#[model 3])

[Top]


model:model-refs

Action
Returns all immediate model references belonging to an assembly model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_get_model_refs

Syntax
(model:model-refs [model=active] [opts])

Arg Types
model model
opts acis-options

Returns
(entity...)

Description
This extension does not search deeper in the tree for sub-references. If the model is unspecified, the model associated with the active part is used.

Arguments
model specifies the assembly model that will be queried for its model references.

opts contains journaling and versioning information.
; model:model-refs
; 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 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 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
; Get all model references.
(model:model-refs)
;; (#[entity 2 2])

[Top]


model:name

Action
Returns the name of the specified model or the model associated with the active part.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(model:name [model=active])

Arg Types
model model

Returns
part

Description
If the model is unspecified, the model associated with the active part is used.

Arguments
model specifies the model whose name is desired.
; model:name
; Load a model.
(define first_model (car (model:load "myfile.asat")))
;; first_model
; Ask for the name of first_model.
(model:name first_model)
;; "assembly"

[Top]


model:part

Action
Returns the part associated with a specified model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(model:part model)

Arg Types
model model

Returns
part

Description
This extension returns the part associated with a specified model.

Arguments
model specifies the model whose part is queried.
; model:part
; Get the active part.
(env:active-part)
;; #[part 1]
; Create a new model.
(define asm_model (model:create))
;; asm_model
; Get the part associated with the model.
(model:part asm_model)
;; #[part 1]

[Top]


model:remove-model-ref

Action
Removes a model reference from its owning model and loses it.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_remove_model_ref

Syntax
(model:remove-model-ref mref [opts])

Arg Types
mref entity
opts acis-options

Returns
Unspecified

Description
This extension removes a model reference from its owning model and loses it.

Arguments
mref specifies the model reference that is to be removed.

opts contains journaling and versioning information.
; model:remove-model-ref
; 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 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 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
; Get all model references.
(model:model-refs)
;; (#[entity 2 2])
; Remove the model reference.
(model:remove-model-ref part_model_ref)
;; ()
(model:model-refs)
;; ()

[Top]


model:remove-property

Action
Removes a previously-applied property attribute from its owner.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_property_remove

Syntax
(model:remove-property prop [opts])

Arg Types
prop entity
opts acis-options

Returns
Unspecified

Description
This extension unhooks and loses the attribute. If the property being removed is the last attribute attached to the property owner attribute, the property-owner attribute is also unhooked and lost.

Arguments
prop specifies the property attribute being removed.

opts contains journaling and versioning information.
; model:remove-property

[Top]


model:save

Action
Saves the model associated with the active part or the specified model or list of models to a file.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_save_model_list

Syntax
(model:save file [model=active] [text=#t] [history=#f] [opts])

Arg Types
model model | (model...)
text boolean
history boolean
opts acis-options

Returns
boolean

Description
This extension saves in Monolithic mode; that is, all models are saved to the same file.

Only top-level (primary) models need to be specified; the routine automatically saves any sub-models upon which the primary models depend.

The text argument is a boolean that switches between text and binary mode. The history argument is a boolean that determines whether or not to save history information. The default is to save in text mode without history.

Arguments
model specifies the model or list of models to be saved.

text specifies whether text (#t) or binary (#f) mode is to be used.

history specifies whether history information is saved.

opts contains journaling and versioning information.
; model:save
; 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 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 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
; Save the assembly model.
(model:save "myfile.asat" asm_model)
;; #t

[Top]


model:save-atomic

Action
Saves the model associated with the active part or the specified model to a file, in Atomic mode.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_save_model_atomic

Syntax
(model:save-atomic [model=active] [text=#t] [history=#f] [use_SAT_for_part_models=#f])

Arg Types
model model
text boolean
history boolean
use_SAT_for_part_models boolean

Returns
boolean

Description
This extension saves in Atomic mode; that is, all part models are saved to separate files.

Only the top-level (primary) model needs to be specified; the routine automatically saves any sub-models upon which the primary model depends.

The text argument is a boolean that switches between text and binary mode for the primary model; the use_SAT_for_part_models argument plays the same role for part models used by the primary model. The history argument is a boolean that determines whether or not to save history information. The default is to save in text mode without history.

Arguments
model specifies the model to be saved.

text specifies whether text (#t) or binary (#f) mode is used.

history specifies whether history information is saved

use_SAT_for_part_models specifies whether text (#t) or binary (#f) mode is used for part models.
; model:save-atomic
; Create a model in the active part.
(define part_model (model:create))
;; part_model
; Name the model.
(model:set-name "part")
;; ()
(solid:block 0 0 0 10 10 10)
;; #[entity 1 1]
; 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)
;; ()
; Name the model.
(model:set-name "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
; Save the assembly model in atomic mode.
(model:save-atomic "myfile.asat" asm_model)
;; #t

[Top]


model:set-name

Action
Associates a name with a model.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(model:set-name name [model=active])

Arg Types
name string
model model

Returns
Unspecified

Description
If the model is unspecified, the model associated with the active part is used.

Arguments
name specifies the name to be associated with the model.

model specifies the model to be named.
; model:set-name
; Create a model in the active part.
(define part_model (model:create))
;; part_model
; Name the model.
(model:set-name "part")
;; ()

[Top]


model:sub-models

Action
Gets the sub-models of a model, using an optional filter.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_get_sub_models

Syntax
(model:sub-models [root-model=active] [which="sub"] [opts])

Arg Types
root-model model
which string
opts acis-options

Returns
(model...)

Description
This extension returns a list of all models upon which the input root model depends; that is, all models that appear below the root model in the assembly tree. The intent of this routine is to allow you to find all the models that are involved in the definition of an assembly, so that, for example, a global assembly state can be noted (by noting each of the models' state).

The which string determines which models are returned:

"all" all sub-models of the root model, including the root model, are returned.
"sub" all proper sub-models of the root model are returned. (default)
"immediate" only the proper sub-models referenced by the root's assembly model are returned.
"leaf" all sub-models that are not assembly models are returned. If the root model is not an assembly, the root model is returned.

If the root model is not specified, the model associated with the active part is used.

Arguments
root-model specifies the root model to be queried.

which specifies the filter string used to control which components are returned.

opts contains journaling and versioning information.
; model:sub-models
; 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 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 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
; Get all sub-models
(model:sub-models)
;; (#[model 1])

[Top]


model-ref?

Action
Determines if a scheme-object is a model reference.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(model-ref? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is a model reference; otherwise, it returns #f.

Arguments
object specifies a scheme-object that is to be queried as being a model reference.
; model-ref?
; 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 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 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
; Is the result a model-ref?
(model-ref? part_model_ref)
;; #t
;Is the model a model-ref?
(model-ref? asm_model)
;; #f

[Top]


model-ref:get-transform

Action
Returns the transform used in defining the specified model reference.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_ref_get_transform

Syntax
(model-ref:get-transform mref [opts])

Arg Types
mref entity
opts acis-options

Returns
transform

Description
This extension returns the transform used in defining the specified model reference.

Arguments
mref specifies the model reference whose transform is queried.

opts contains journaling and versioning information.
; model-ref:get-transform
; 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 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 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
; Get the model reference's transform and print it.
(transform:print (model-ref:get-transform part_model_ref))
;; no rotation no reflection no shear not identity
;; translation part:
;; 1.000000 0.000000 0.000000
;; affine part:
;; 1.000000 0.000000 0.000000
;; 0.000000 1.000000 0.000000
;; 0.000000 0.000000 1.000000
;; scaling part:
;; 1.000000
;; Steps to reconstruct transf...
;; 1.) Translate (1.000000, 0.000000, 0.000000)
;; #[transform 129412928]

[Top]


model-ref:model

Action
Returns the model to which the specified model reference refers.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_ref_get_model

Syntax
(model-ref:model mref [opts])

Arg Types
mref entity
opts acis-options

Returns
model

Description
This extension returns the model to which the specified model reference refers.

Arguments
mref specifies the model reference whose model is queried.

opts contains journaling and versioning information.
; model-ref:model
; 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 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 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
; Get the model reference's model.
(model-ref:model part_model_ref)
;; #[model 1]

[Top]


model-ref:owning-model

Action
Returns the model containing the assembly owning a particular model reference.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_ref_get_owning_model

Syntax
(model-ref:owning-model mref [opts])

Arg Types
mref entity
opts acis-options

Returns
model

Description
This extension returns the model containing the assembly that owns a particular model reference.

Arguments
mref specifies the model reference whose owning model is requested.

opts contains journaling and versioning information.
; model-ref:owning-model
; 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 model that owns subasm_model_ref.
(model-ref:owning-model subasm_model_ref)
;; #[model 3]
; Get the model that owns part_model_ref.
(model-ref:owning-model part_model_ref)
;; #[model 2]

[Top]


model-ref:part

Action
Returns the part containing a model reference.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_ref_get_owning_model

Syntax
(model-ref:part mref)

Arg Types
mref entity

Returns
part

Description
This extension returns the part containing a model reference.

Arguments
mref specifies the model reference whose part is queried.
; model-ref:part
; 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 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 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
; Get the part that contains part_model_ref.
(model-ref:part part_model_ref)
;; #[part 2]

[Top]


model-ref:set-transform

Action
Resets the transform associated with a model reference.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_ref_set_transform

Syntax
(model-ref:set-transform mref tform [opts])

Arg Types
mref entity
tform transform
opts acis-options

Returns
Unspecified

Description
The supplied transform determines the location and orientation of the model reference within the assembly, in the assembly model's coordinate system and units. This transform may only involve rotation and translation; reflection, shear, and scaling transforms are not valid.

Arguments
mref specifies the model reference whose transform is reset.

tform specifies the transform to replace the existing transform.

opts contains journaling and versioning information.
; model-ref:set-transform
; 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 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 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
; Change the model references's transform.
(define new_part_transf (transform:rotation (position 0 0 0) (gvector 0 1 0) 45))
; new_part_transf
(model-ref:set-transform part_model_ref new_part_transf)
;; ()
; Get the model reference's current transform and print it.
(transform:print (model-ref:get-transform part_model_ref))
;; rotation no reflection no shear not identity
;; translation part:
;; 0.000000 0.000000 0.000000
;; affine part:
;; 0.707107 0.000000 -0.707107
;; 0.000000 1.000000 0.000000
;; 0.707107 0.000000 0.707107
;; scaling part:
;; 1.000000
;; Steps to reconstruct transf...
;; 1.) Rotate about X axis 0.000000, Y axis 45.000000, Z axis 0.000000 degrees
;; or rotate 45.000000 degrees about vector (0.000000, 1.000000, 0.000000)
;; #[transform 129416616]

[Top]


model-ref:transform

Action
Applies the specified transform to the model reference.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
asmi_model_ref_apply_transform

Syntax
(model-ref:transform mref tform [opts])

Arg Types
mref entity
tform transform
opts acis-options

Returns
Unspecified

Description
This extension replaces the existing model-reference transform by the composition of the supplied transform with the existing one.

Arguments
mref specifies the model reference to which the supplied transform is applied.
tform specifies the applied transform.

opts contains journaling and versioning information.
; model-ref:transform
; 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 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 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
; Change the model references's transform.
(define add_part_transf (transform:translation (gvector 0 1 0)))
; add_part_transf
(model-ref:transform part_model_ref add_part_transf)
;; ()
; Get the model reference's current transform and print it.
(transform:print (model-ref:get-transform part_model_ref))
;; no rotation no reflection no shear not identity
;; translation part:
;; 1.000000 1.000000 0.000000
;; affine part:
;; 1.000000 0.000000 0.000000
;; 0.000000 1.000000 0.000000
;; 0.000000 0.000000 1.000000
;; scaling part:
;; 1.000000
;; Steps to reconstruct transf...
;; 1.) Translate (1.000000, 1.000000, 0.000000)
;; #[transform 129416464]

[Top]


part:model

Action
Returns the model associated with a part.

Filename
scm/scmext/kern/asm_scm.cpp

APIs
None

Syntax
(part:model [part=active])

Arg Types
part part

Returns
model

Description
This extension returns the model associated with a part. If the part is unspecified, the active part is used.

Arguments
part specifies the part whose model is queried.
; part:model
; Get the active part.
(define asm_part (env:active-part))
;; asm_part
; Create a new model.
(model:create)
;; #[model 1]
; Get the model associated with the active part.
(part:model asm_part)
;; #[model 1]

[Top]