Scheme Extensions |
|
|
Technical Article |
None |
Description
This extension processes the pending messages used during long operations when
the user wants to check for an interrupt condition. The returned value
indicates the interrupt status.
; check-interrupt ; Allow pending messages to be processed. (check-interrupt) ;; #f |
[ Top]
item | dl-item |
Description
Returns the color of the specified display
item
in the display list. A display
item
is not part of the model and does not get saved and restored.
; dl-item:color ; Define two polyline list items. (define poly1 (dl-item:polyline (list (position 0 0 0) (position 5 0 0) (position 0 5 0) (position 0 0 0)) #t)) ;; poly1 ; Color poly1 red. (dl-item:set-color poly1 1) ;; () (define poly2 (dl-item:polyline (list (position 10 10 10) (position 15 10 10) (position 10 15 10) (position 10 10 10)) #t)) ;; poly2 ; Color poly2 blue. (dl-item:set-color poly2 3) ;; () ; OUTPUT Display ; Request the color of poly1 and poly2. (dl-item:color poly1) ;; #[color 1 0 0] ; color 1 0 0 is red. (dl-item:color poly2) ;; #[color 0 0 1] ; color 0 0 1 is blue. |
[Top]
item | dl-item |
Description
This extension adds a display
item
to the display list for all views. This extension is used if the display list
item is currently not being displayed, because it was turned off by the
dl-item:erase extension. A display item is not part of the
model and does not get saved and restored.
; dl-item:display ; Define two polyline list items. (define poly1 (dl-item:polyline (list (position 0 0 0) (position 5 0 0) (position 0 5 0) (position 0 0 0)) #t)) ;; poly1 ; Color poly1 red. (dl-item:set-color poly1 1) ;; () (define poly2 (dl-item:polyline (list (position 10 10 10) (position 15 10 10) (position 10 15 10) (position 10 10 10)) #t)) ;; poly2 ; Color poly2 blue. (dl-item:set-color poly2 3) ;; () ; Erase the first polyline. (dl-item:erase poly1) ;; () ; Re-display poly1 using featured command. (dl-item:display poly1) ;; () |
[ Top]
item | dl-item |
Description
This extension removes a display
item
from the display list in all views.
view:refresh may be required to update the individual views. A
display item is not part of the model and does not get saved and restored. This
extension cannot be used for removing an entity from the display list; it only
works on display items.
; dl-item:erase ; Define a point display list item. (define db (dl-item:point (position 5 10 15))) ;; db ; Remove the point display list item. (dl-item:erase db) ;; () (view:refresh) ;; #[view 1075640854] |
[ Top]
position | position |
Description
This extension creates a point display list item at the specified position. The
point is displayed in all views until it is deleted. The point style is
controlled by env:set-point-style and
env:set-point-size.
A display item is not part of the model and does not get saved and restored.
Even though a 3D position is provided for the display item, it is mapped into
2D space. A display item should then not be used for snapping or as part of a
model.
; dl-item:point ; Create a point display list item. (define dp (dl-item:point (position 15 5 10))) ;; dp |
[Top]
position-list | position | (position ...) |
fill | boolean |
Description
This extension creates a polyline display item for the display list connecting
the specified positions. The optional fill flag indicates whether the polyline
is filled. The polyline is displayed in all views until it is removed.
A display item is not part of the model and does not get saved and restored.
Even though a 3D position is provided for the display item, it is mapped into
2D space. A display item should then not be used for snapping or as part of a
model.
; dl-item:polyline ; Create a polyline display list item ; for a filled triangle. (define poly (dl-item:polyline (list (position 0 0 0) (position 5 0 0) (position 0 5 0) (position 0 0 0)) #t)) ;; poly |
[Top]
item | dl-item |
color | color |
Description
Sets the color of the specified display item. A display item is not part of the
model and does not get saved and restored.
; dl-item:set-color ; Create a text display list item. (define dt (dl-item:text (position 0 0 25) "Note")) ;; dt ; Set the display color of the text ; display list item to red. (dl-item:set-color dt (color:rgb 1 0 0)) ;; () |
[ Top]
position | position |
string | string |
Description
This extension creates a text display list item at the specified position. The
text displays in all views until it is removed.
A display item is not part of the model and does not get saved and restored.
Even though a 3D position is provided for the display item, it is mapped into
2D space. A display item should then not be used for snapping or as part of a
model.
; dl-item:text ; Create a text display list item. (define dt (dl-item:text (position 10 0 15) "Hello")) ;; dt ; Create a second text display list item. (define ds (dl-item:text (position -10 0 15) "Test")) ;; ds (dl-item:set-color dt (color:rgb 1 0 0)) ;; () |
[ Top]
object | scheme-object |
Description
This extension returns #t if the specified object is a display list item;
otherwise, it returns #f. A display item is not part of the model and does not
get saved and restored.
; dl-item? ; Create a point display list item. (define d1 (dl-item:point (position 0 0 0))) ;; d1 ; Verify that the object is a display list item. (dl-item? d1) ;; #t ; Create a circular edge. (define edge1 (edge:circular (position 0 0 0) 20)) ;; edge1 ; Verify that the circular edge is not ; a display list item. (dl-item? edge1) ;; #f |
[Top]
start-edge-entity | edge |
stop-edge-entity | edge |
Description
Returns a chain of edges given one or two edges. This extension operates on top
level edges only.
Note:
The edges of the chain must link to one another through common end points.
; edge:chain ; Create linear edge 1. (define edge1 (edge:linear (position 5 5 0) (position 20 5 0))) ;; edge1 ; Create linear edge 2. (define edge2 (edge:linear (position 18 0 0) (position 18 20 0))) ;; edge2 ; Create linear edge 3. (define edge3 (edge:linear (position 18 0 0) (position 15 15 0))) ;; edge3 (define edge4 (edge:linear (position 15 15 0) (position 10 9 0))) ;; edge4 ; Determine which edge forms a chain. (edge:chain edge1) ;; () ; Determine which edge forms a chain. (edge:chain edge2 edge3) ;; (#[entity 3 1] #[entity 4 1]) (edge:chain edge2 edge4) ;; (#[entity 3 1] #[entity 4 1] #[entity 5 1]) |
[Top]
entity | entity |
Description
This extension returns a color object.
; entity:color ; Create entity 1. (define edge1 (edge:circular (position 0 0 0) 25 0 180)) ;; edge1 ; Create entity 2. (define edge2 (edge:circular (position 5 5 5) 25 180 270)) ;; edge2 ; Create entity 3. (define edge3 (edge:linear (position 0 0 0) (position 25 0 0))) ;; edge3 ; Create entity 4. (define block1 (solid:block (position 0 0 0) (position 15 15 15))) ;; block1 ; Set the display color for entities 1 and 3. (entity:set-color (list edge1 edge3) 5) ;; () ; Set the display color for entity 2. (entity:set-color edge2 1) ;; () ; Get the display color for entity 1. (entity:color edge1) ;; #[color 1 1 0] ; Get the display color for entity 2. (entity:color edge2) ;; #[color 1 0 0] |
[Top]
entity-list | entity | (entity ...) |
; entity:display ; Create an edge. (define edge1 (edge:circular (position 0 0 0) 25 0 180)) ;; edge1 ; Turn off the automatic display of new entities. (env:set-auto-display #f) ;; () ; Create a second edge. (define edge2 (edge:circular (position 5 5 5) 25 180 270)) ;; edge2 ; Force the display of entity 2. (define display (entity:display edge2)) ;; display |
[Top]
entity | entity |
; entity:displayed? ; Create a block. (define block1 (solid:block (position 0 0 0) (position 6 6 6))) ;; block1 ; Determine if the block1 is displayed. (entity:displayed? block1) ;; #t ; Erase the block. (define erase (entity:erase block1)) ;; erase ; Determine if the block is displayed. (entity:displayed? block1) ;; #f |
[Top]
entity-list | entity | (entity ...) |
; entity:erase ; Create an edge. (define edge1 (edge:circular (position 0 0 0) 25 0 180)) ;; edge1 ; Create another edge. (define edge2 (edge:circular (position 5 5 5) 25 180 270)) ;; edge2 ; Erase the second edge. (define erase (entity:erase edge2)) ;; erase ; Display the erased entity 2. (define display (entity:display edge2)) ;; display ; The erased entity is redisplayed. |
[Top]
given_entity | entity |
acis-opts | acis-options |
Description
Retrieves the index of the eight character session user identifier, or zero if
it does not exists.
[Top]
entity | entity |
; entity:highlighted? ; Create circular edge 1. (define edge1 (edge:circular (position 0 0 0) 25 0 180)) ;; edge1 ; Create circular edge 2. (define edge2 (edge:circular (position 5 5 5) 25 180 270)) ;; edge2 ; Highlight circular edges 1 and 2. (define highlight (entity:set-highlight (list edge1 edge2) #t)) ;; highlight ; Determine if circular edge 1 is highlighted. (entity:highlighted? edge1) ;; #t ; Determine if circular edge 2 is highlighted. (entity:highlighted? edge2) ;; #t |
[Top]
entity | entity |
Description
This extension returns the part to which the entity belongs. If the entity does
not belong to any part, this extension returns #f.
; entity:part ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 30 30 30))) ;; block1 ; Determine to which part the block belongs. (entity:part block1) ;; #[part 1] |
[Top]
given_entity | entity |
acis-opts | acis-options |
Description
This extension removes the PID from the entity.
[Top]
entity-list | entity | (entity ...) |
acis-opts | acis-options |
;entity:remove-transform ;Define a WCS. (define wcs1 (wcs (position 0 0 0) (position 5 0 0)(position 0 5 0))) ;; wcs1 ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position -15 -25 -15))) ;; block1 ; OUTPUT Original ; Copy the block. (define copy (entity:copy block1)) ;; copy ; Set the color for the copy. (entity:set-color copy 3) ;; () ; Transform the solid block. (define transform (entity:transform copy (transform:axes (position 0 0 0) (gvector -8 0 0) (gvector 0 6 0)))) ;; transform ;Remove the the transform from the copy of the block (entity:remove-transform copy) (view:refresh) ;; #[view 3736786] ; OUTPUT Result |
[Top]
entity-list | entity | (entity ...) |
on-off | boolean |
Note:To display selection, change the default color of the selection so that it is different from the color of the entity.
; entity:select ; Create circular edge 1. (define edge1 (edge:circular (position 0 0 0) 25 0 180)) ;; edge1 ; Create circular edge 2. (define edge2 (edge:circular (position 5 5 5) 25 180 270)) ;; edge2 ; Select the first edge. (entity:select edge1 #t) ;; #[entity 2 1] ; Select entities 1 and 2. (entity:select (list edge1 edge2) #t) ;; (#[entity 2 1] #[entity 3 1]) |
[Top ]
entity | entity |
; entity:selected? ; Create circular edge 1. (define edge1 (edge:circular (position 0 0 0) 25 0 180)) ;; edge1 ; Create circular edge 2. (define edge2 (edge:circular (position 5 5 5) 25 180 270)) ;; edge2 ; Select circular edges 1 and 2. (define selected (entity:select (list edge1 edge2) #t)) ;; select ; Determine if circular edge 1 is selected. (entity:selected? edge1) ;; #t ; Determine if circular edge 2 is selected. (entity:selected? edge2) ;; #t |
[Top]
entity-list | entity | (entity ...) |
color | color |
; entity:set-color ; Create a solid block. (define block1 (solid:block (position 0 -5 0) (position 15 15 15))) ;; block1 ; OUTPUT Original ; Set the color for the block to red (entity:set-color block1 1) ;; () ; OUTPUT Result Figure. entity:set-color |
[Top]
entity-list | entity | (entity ...) |
on-off | boolean |
; entity:set-highlight ; Create circular edge 1. (define edge1 (edge:circular (position 0 0 0) 25 0 180)) ;; edge1 ; Create circular edge 2. (define edge2 (edge:circular (position 5 5 5) 25 180 270)) ;; edge2 ; Set the highlight for the first edge to on. (entity:set-highlight edge1 #t) ;; #[entity 2 1] ; Set the highlight for entities 1 and 2 to on. (entity:set-highlight (list edge1 edge2) #t) ;; (#[entity 2 1] #[entity 3 1]) |
[Top]
entity | entity |
part | part |
Description
If the entity already belongs to a different part, it is removed from the
original part, and added to the new part. Use this extension to move entities
from one part to another.
; entity:set-part ; Create an active view for display. ; This view will display the default or part 1. (define view1 (view:dl 1 1 256 256)) ;; view1 ; Create a part (define first-p (part:new)) ;; first-p ; Create a 2nd part. (define second-p (part:new)) ;; second-p ; Create a view to display the 2nd part. (define view2 (view:dl 1 1 256 256 second-p)) ;; view2 ; Make sure the active part is part 1 or default. (env:active-part) ;; #[part 1] ; Create a block in the active part. (define block1 (solid:block (position 0 0 0) (position 10 20 30))) ;; block1 ; Get the ID of the block. (entity:part block1) ;; #[part 1] ; Move the block from part 1 to part 2. (define move (entity:set-part block1 second-p)) ;; move ; Distributes entities to stream it ; was not created in. (define new-ent (car (part:entities second-p))) ;; new-ent (define new (entity:part new-ent)) ;; new |
[Top]
given_entity | entity |
acis-opts | acis-options |
Description
This extension sets the PID of the entity to the next unique value.
[Top]
entity-list | entity | (entity ...) |
on-off | boolean |
; entity:set-render ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 30 10 20))) ;; block1 ; Create a solid block. (define block2 (solid:block (position 30 10 20) (position 45 40 25))) ;; block2 ; Render both blocks. (render) ;; () ; Set rendering off for one of the blocks. (define set-render (entity:set-render block1 #f)) ;; set-render (define display (entity:display block1)) ;; display |
[Top]
entity-list | entity | (entity ...) |
color | color |
Description
Changes the entity color by adding or changing the ATTRIB_RGB. Also, if
the entity is in the display list, its color is changed. Any ATTRIB_COL
attribute is removed from the entity.
; entity:set-color ; Create a solid block. (define block1 (solid:block (position 0 -5 0)(position 15 15 15))) ;; block1 ; OUTPUT Original ; Set the color for the block to red (entity:set-rgb block1 1) ;; () ; OUTPUT Result |
[Top]
entray | entray |
Description
Gets the position of the vertex of the entity component of an entray that is
closest to the ray.
; entray:position ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 15 15 15))) ;; block1 ; Create a entity ray and then extract ; the position portion. (entray:position (entray block1 (ray (position 0 0 0) (gvector 0 0 1)))) ;; #[position 0 0 15] |
[Top]
entray | entray |
Description
Gets the vertex on the entity component of the entray that is closest to the
ray.
; entray:vertex ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 15 15 15))) ;; block1 ; Create an entity ray consisting of ; the block and a ray, and then find ; the vertex of the entity closest to the ray. (entray:vertex (entray block1 (ray (position 0 0 0) (gvector 0 0 1)))) ;; #[entity 3 1] |
[Top]
None |
Description
Gets the active part. A part is a grouping of top-level entities. When entities
are created, they are added to the active part, unless specified otherwise. A
part is represented externally in the form #[part n], where n represents
its identification number.
active-part is a part that is a grouping of top-level activities.
; env:active-part ; Get the ID of the currently active part. (env:active-part) ;; #[part 1] ; Create another part. (define part1 (part:new)) ;; part1 ; Verify what was created. part1 ;; #[part 2] ; Get the number of parts currently defined. (env:count-parts) ;; 2 ; Change the active part to the new one. (env:set-active-part part1) ;; () ; Verify that the new part is the active part. (env:active-part) ;; #[part 2] ; Anything created from this point in time ; is added to the second part. ; Change the active part to the old one. (env:set-active-part (part 1)) ;; () ; Verify that the old part is now the active part. (env:active-part) ;; #[part 1] |
[Top]
None |
Description
Gets the active view. A view is assigned to an individual part. Only the
entities in that part are displayed. When entities are created, they are added
to the active part. When views are created, they display the entities from the
active part, unless specified otherwise. A view is represented externally in
the form #[view n], where n represents its identification number. Multiple
views are helpful, for example, for displaying wireframe and rendered
representations of the same part at the same time in two different windows.
Setting the active view is useful for operations such as the render Scheme
extension, because they assume the active view unless specified otherwise.
Separate views can be used to display separate parts or the same part. When
separate views are assigned to the same part, they can have different eye and
target positions which present different views.
active-view is a view that is assigned to an individual part.
; env:active-view ; Create a new view. (define view1 (view:gl)) ;; view1 ; Create a new view. (define view2 (view:gl)) ;; view2 ; Verify ID of the views. view1 ;; #[view 3867314] view2 ;; #[view 268829534] ; Get the active view. ; Define the active view. (env:set-active-view view2) ;; () ; verify active view. (env:active-view) ;; #[view 268829534] ; Change the active view. (env:set-active-view view1) ;; () ; Verify the new active view. (env:active-view) ;; #[view 3867314] |
[Top]
None |
Description
Gets the display color of the active WCS. This is an RGB color used to display
the active WCS. By default, this value is #[color 0 1 0].
active-wcs-color gives the color of the active
WCS.
; env:active-wcs-color ; Determine if there is an active WCS. (wcs:active) ;; #f ; Define a WCS. (define wcs (wcs (position 0 0 0) (position 5 0 0) (position 0 5 0))) ;; wcs ; Make a WCS active. (wcs:set-active wcs) ;; () ; Get the color of the active WCS. (env:active-wcs-color) ;; #[color 0 1 0] ; Set the color of the active WCS. (env:set-active-wcs-color 6) ;; () ; Get the color of the active WCS. (env:active-wcs-color) ;; #[color 1 0 1] |
[Top]
None |
Description
Gets the auto-display mode. The automatic display at #t shows geometry entities
in all views as the entities are created. If set to #f, geometry entities are
displayed only in the active view as they are created. When deactivated, new
entities are only created in the active view. An example of where this is
useful is when rendered and wireframe views of the same part are used at the
same time. The default for auto-display is #t. To change the display state of
previously created entities, use the extensions entity:erase
and entity:display for those entities.
auto-display is an environment that has a on and off mode.
; env:auto-display ; Determine whether the environment auto display ; of entities is on or off. (env:auto-display) ;; #t ; Disable the automatic display of ; newly created entities. (env:set-auto-display #f) ;; () ; Verify that auto-display is disabled. (env:auto-display) ;; #f ; Enable the automatic display of ; newly created entities. (env:set-auto-display #t) ;; () ; Verify that auto-display is enabled. (env:auto-display) ;; #t |
[Top]
None |
Description
count-part is an environment that counts and returns the number of parts.
; env:count-parts ; Define an active part. (define first (env:active-part)) ;; first ; Create another part. (define part1 (part:new)) ;; part1 ; part1 ; Verify what was created. part1 ;; #[part 2] ; Get the number of parts currently defined. (env:count-parts) ;; 2 |
[Top]
None |
Description
Gets the RGB display color for newly created entities. By default, this value
is #[color 0 1 0]. For the results to be visible, the entity
should be reset with entity:set-color.
default-color displays the RGB color for newly created entities. The default
value is #[color 0 1 0].
; env:default-color ; Create a block. (define block1 (solid:block (position 12 0 5) (position 24 10 -8))) ;; block1 ; Get the default color as an rgb value. (env:default-color) ;; #[color 0 1 0] ; Set the default color for newly created entities ; to cyan using an integer. (env:set-default-color 4) ;; () ; Get the default color as an rgb value. (env:default-color) ;; #[color 0 1 1] ; Create a sphere using the new default color. (define sphere1 (solid:sphere (position 4 4 4) 8)) ;; sphere1 ; Set a new default color as an rgb value. (env:set-default-color (color:rgb 0.8 0.5 0.2)) ;; () ; Get the default color as an rgb value. (env:default-color) ;; #[color 0.8 0.5 0.2] ; View the first entity the new default color. (entity:set-color block1 (env:default-color)) ;; () |
[Top]
None |
Description
This extension returns the current highlight color RGB value. By default, this
value is #[color 1 1 1]. The highlight color setting affects all
views. A change in highlight color affects entities that have highlighting
enabled. Use the Scheme extension entity:set-highlight
to enable highlighting for an entity:highlight-color contains the highlight RGB
color. The default value is #[color 1 1 1].
; env:highlight-color ; Create a block. (define block1 (solid:block (position 12 0 5) (position 24 10 -8))) ;; block1 ; OUTPUT Original ; Get the highlight color as an rgb value. (env:highlight-color) ;; #[color 1 1 1] ; Set the display color for highlighted entities ; as an integer. (env:set-highlight-color 3) ;; () ; Get the highlight color as an rgb value. (env:highlight-color) ;; #[color 0 0 1] ; Define a list of faces for the block. (define faces1 (entity:faces block1)) ;; faces1 ; Highlight the first face in the list. (define highlight (entity:set-highlight (car faces1) #t)) ;; highlight ; OUTPUT Result Figure. env:highlight-color |
[Top]
None |
Description
This extension returns a list of all parts in the environment.
parts is an environment that is a grouping of entities.
; env:parts ; Create a part. (define first (env:active-part)) ;; first ; Create another part. (define part1 (part:new)) ;; part1 ; part1 ; Get the number of parts currently defined. (env:count-parts) ;; 2 ; Get a list of all parts in the environment. (env:parts) ;; (#[part 1] #[part 2]) |
[Top]
None |
Description
This extension returns the current display size of a point. This pertains to
points displayed as locations, and does not pertain to the text font, point
size.
point-size gives the display size of the point.
; env:point-size ; Create a point. (define point-position (point (position 5 4 10))) ;; point-position (env:point-size) ;; 10 ; Set the display size for a point. (env:set-point-size 20) ;; () ; Get the display size for a point. (env:point-size) ;; 20 |
[Top]
None |
Description
This extension returns the point style as "+", "X", "." (period), or "O" (the
letter "O") displayed in the view as a square.
point-style is the current style of the point.
; env:point-style ; Set the display style for a point to a +. (env:set-point-style "+") ;; () ; Get the display style for a point. (env:point-style) ;; "+" ; Create a point. (define point-position (point (position -5 -5 -5))) ;; point-position ; Set the display style of a point to a square. (env:set-point-style "o") ;; () ; Create another point. (define point2 (point (position 5 5 5))) ;; point2 (env:point-style) ;; "O" |
[Top]
part | part |
Description
Sets the active
part. A part is a container for
entities. When entities are created, they are added to the active part. A part
is represented externally in the form #[part n], where n represents
its identification number. Only one part can be assigned to any given view.
However, multiple views can display the entities from the same part.
; env:set-active-part ; Get the ID of the currently active part. (env:active-part) ;; #[part 1] ; Create another part. (define part1 (part:new)) ;; part1 ; Verify what was created. part1 ;; #[part 2] ; Change the active part to the new one. (env:set-active-part part1) ;; () ; Verify the active part. (env:active-part) ;; #[part 2] ; Anything created from this point in time ; is added to the second part. ; Change the active part to the old one. (env:set-active-part (part 1)) ;; () ; Verify the active part. (env:active-part) ;; #[part 1] |
[Top]
view | view |
Description
Sets the active view. A view is assigned to an individual part. Only the
entities in that part are displayed. When entities are created, they are added
to the active part. When views are created, they display the entities from the
active part, unless specified otherwise. A view is represented externally in
the form #[view n], where n represents its identification number.
Multiple views are helpful, for example, for displaying wireframe and rendered
representations of the same part at the same time in two different windows.
Setting the active view is useful for operations such as the render Scheme
extension, because they assume the active view unless specified otherwise.
Separate views can be used to display separate parts or the same part. When
separate views are assigned to the same part, they can have different eye and
target positions which presents different views.
; env:set-active-view ; Create view 1. (define view1 (view:dl)) ;; view1 ; Create view 2. (define view2 (view:dl)) ;; view2 ; Verify the views. view1 ;; #[view 10755193761] view2 ;; #[view 10755193798] ; Get the ID of the new (active) view. (env:active-view) ;; #[view 10755193761] ; Change the active view. (env:set-active-view view1) ;; () ; Get the ID of the new (active) view. (env:active-view) ;; #[view 10755193761] |
[Top]
color | color |
Description
Sets the display color of the active WCS. This is an RGB color. It is the color
used to display the active WCS. By default, this value is
#[color 0 1 0]. In order for the results to be visible, the
active WCS must be set with
wcs:set-active.
; env:set-active-wcs-color ; Determine if there is an active WCS. (wcs:active) ;; #f ; If there is no active WCS, define a WCS. (define wcs (wcs (position 0 0 0) (position 5 0 0) (position 0 5 0))) ;; wcs ; Make the WCS active. (wcs:set-active wcs) ;; () ; Get the color of the active WCS. (env:active-wcs-color) ;; #[color 0 1 0] ; Change the color of the active WCS. (env:set-active-wcs-color 6) ;; () ; Get the color of the active WCS. (env:active-wcs-color) ;; #[color 1 0 1] |
[Top]
on-off | boolean |
Description
The argument
on-off
activates the automatic display in all views of geometry entities as they are
created if set to #t. The argument on-off deactivates the automatic
display in all views of geometry entities as they are created if set to #f.
When deactivated, new entities are only created in the active view. An example
of where this is useful is when rendered and wireframe views of the same part
are used at the same time. The default for on-off is #t. This only affects
entities created after this procedure is called. To change the display state of
previously created entities, use the extensions entity:erase
and entity:display for those entities.
; env:set-auto-display ; Disable the automatic display of ; newly created entities. (env:set-auto-display #f) ;; () ; Enable the automatic display of ; newly created entities. (env:set-auto-display #t) ;; () |
[Top]
color | color |
Description
Sets the display color for newly created entities. This is an RGB color. By
default, this value is #[color 0 1 0]. In order for the results
to be visible, the entity should be reset with entity:set-color.
; env:set-default-color ; Create a block. (define block1 (solid:block (position 12 0 5) (position 24 10 -8))) ;; block1 ; Get the default color as an rgb value. (env:default-color) ;; #[color 0 1 0] ; Set the default color for newly created entities ; to cyan using an integer. (env:set-default-color 4) ;; () ; Get the default color as an rgb value. (env:default-color) ;; #[color 0 1 1] (define second (solid:sphere (position 4 4 4) 8)) ;; second ; Set the default color as an rgb value. (env:set-default-color (color:rgb 0.8 0.5 0.2)) ;; () ; Get the default color as an rgb value. (env:default-color) ;; #[color 0.8 0.5 0.2] ; View the first entity in new default color. (entity:set-color block1 (env:default-color)) ;; () |
[Top]
color | color |
Description
Sets the highlight color. This is an RGB color. By default, this value is
#[color 1 1 1]. The highlight color setting affects all views. A
change in highlight color affects entities that have highlighting enabled. Use
the Scheme extension entity:set-highlight to
enable highlighting for an entity.
; env:set-highlight-color ; Create a block. (define block1 (solid:block (position 12 0 5) (position 24 10 -8))) ;; block1 (env:highlight-color) ;; #[color 1 1 1] ; Set the display color for highlighted ; entities as an integer. (env:set-highlight-color 4) ;; () ; Get the default color as an rgb value. (env:highlight-color) ;; #[color 0 1 1] (define faces1 (entity:faces block1)) ;; faces1 (define entity (entity:set-highlight (car faces1) #t)) ;; entity |
[Top]
size | integer |
; env:set-point-size ; Create a point. (define point1 (point (position 5 4 10))) ;; point1 (env:point-size) ;; 10 ; Set the display size for a point. (env:set-point-size 20) ;; () ; Get the display size for a point. (env:point-size) ;; 20 |
[Top]
style-string | string |
; env:set-point-style ; Set the display style of a point to an x. (env:set-point-style "x") ;; () ; Define a point. (define point1 (point (position -5 -5 -5))) ;; point1 ; Set the display style of a point to a +. (env:set-point-style "+") ;; () ; Define a point. (define point2 (point (position 0 0 0))) ;; point2 ; Set the display style of a point to a square. (env:set-point-style "o") ;; () ; Define a point. (define point3 (point (position 5 5 5))) ;; point3 Figure. env:set-point-style |
[Top]
x | integer |
y | integer |
button | integer |
view | view |
state | string |
Description
Pick-events are created from user mouse/keyboard input using (read-event) or
are generated from data using (event).
; event ; Create a new view. (define view (view:dl)) ;; view ; Create pick event 1 from data. (event 100 100 1 view) ;; #[pick-event 100 100 1 3080666 0] ; Create pick event 2 from data. (event 100 100 1 view (list "left" "shift")) ;; #[pick-event 100 100 1 3080666 257] |
[Top]
event | pick-event |
Description
This extension returns #t if the event specifies that the Alt key is pressed;
otherwise, it returns #f.
; event:alt? ; Create a new view. (define view (view:dl)) ;; view ; Create an event from data. (define event (event 100 100 1 view (list "left" "alt"))) ;; event ; Determine if the event specified that the ; "alt" key is pressed. (event:alt? event) ;; #t ; Determine if the event specified that the ; "alt" key is pressed. (event:alt? (read-event)) ;; #f ; Returns #t if alt key pressed with selection ; key on mouse ; Returns #f if any or no other key pressed ; with selection key on mouse (except alt) |
[Top]
event | pick-event |
Description
This extension returns the number of the mouse button pressed as an integer.
The mouse buttons are represented as button 1 (left), button 2 (middle),
or button 3 (right).
; event:button ; Create a new view. (define view (view:dl)) ;; view ; Create an event from data. (define event (event 100 100 1 view (list "left" "alt"))) ;; event ; Determine which mouse buttons were pressed. (event:button event) ;; 1 ; Determine which mouse buttons were pressed. (event:button (read-event)) ;; 1 ; Returns 1 if left mouse button ; Returns 2 if middle mouse button ; Returns 3 if right mouse button |
[Top]
event | pick-event |
Description
This extension returns #t if the event specifies that the control key is
pressed; otherwise, it returns #f.
; event:control? ; Create a new view. (define view (view:dl)) ;; view ; Create an event from data. (define event (event 100 100 1 view (list "left" "control"))) ;; event ; Determine if the event specified that the ; "control" key is pressed. (event:control? event) ;; #t ; Determine if the event specified that the ; "control" key is pressed. (event:control? (read-event)) ;; #f ; Returns #t if "control" key pressed with selection ; key on mouse ; Returns #f if any or no other key pressed ; with selection key on mouse (except the "control" ; key) |
[Top]
event | pick-event |
Description
This extension returns #t if the event specifies that the left mouse button is
pressed; otherwise, it returns #f.
; event:left? ; Create a new view. (define view (view:dl)) ;; view ; Create an event from data. (define event (event 100 100 1 view (list "left" "control"))) ;; event ; Determine if the left mouse button ; was pressed during the event. (event:left? event) ;; #t ; Determine if the event specified that ; the left key is pressed. (event:left? (read-event)) ;; #t ; Returns #t if left mouse key pressed. ; Returns #f if any other mouse key pressed. |
[Top]
event | pick-event |
Description
This extension returns #t if the event specifies that the middle mouse button
is pressed; otherwise, it returns #f.
; event:middle? ; Create a new view. (define view (view:dl)) ;; view ; Create an event from data. (define event (event 100 100 1 view (list "middle" "control"))) ;; event ; Determine if the middle mouse button ; was pressed during the event. (event:middle? event) ;; #t ; Determine if the event specified that ; the middle key is pressed. (event:middle? (read-event)) ;; #t ; Returns #t if middle mouse key pressed ; Returns #f if any other mouse key pressed |
[Top]
event | pick-event |
Description
This extension returns the pick ray specified by an event.
; event:ray ; Create a view to use as input to the event. (define view1 (view:dl)) ;; view1 ; Create an imaginary event from data instead of ; doing a (define event1 (read-event)). (define event1 (event 100 100 1 view1) (list "right" "shift")) ;; event1 ; Determine a ray from the event (define ray1 (event:ray event1)) ;; ray1 ; ray1 => ; #[ray (-33.25 33.25 500) (0 0 -1)] |
[Top]
event | pick-event |
Description
This extension returns #t if the event specifies that the right mouse button
was pressed, #f otherwise. Event specifies the event used. This can be read
using (read-event) or generated from data using (event).
; event:right? ; Create a new view. (define view (view:dl)) ;; view ; Create an event from data. (define event (event 100 100 1 view (list "right" "control"))) ;; event ; Determine if the right mouse button ; was pressed during the event. (event:right? event) ;; #t ; Determine if the event specified that ; the right key is pressed. (event:right? (read-event)) ;; #t ; Returns #t if right mouse key pressed ; Returns #f if any other mouse key pressed |
[Top]
event | pick-event |
Description
This extension returns #t if the event specifies that the shift key is pressed;
otherwise, it returns #f.
; event:shift? ; Create a new view. (define view (view:dl)) ;; view ; Create an event from data. (define event (event 100 100 1 view (list "right" "shift"))) ;; event ; Determine if the event specified that ; the shift key was pressed. (event:shift? event) ;; #t ; Determine if the event specified that ; the shift key is pressed. (event:shift? (read-event)) ;; #t ; Returns #t if shift key was pressed with ; selection key on mouse. ; Returns #f if any or no other key pressed with ; selection key on mouse (except shift). |
[Top]
event | pick-event |
Description
This extension returns the view specified by an event. event specifies
the event used, and it is read using (read-event) or is generated from data
using (event).
; event:view ; Define a new view. (define view (view:dl)) ;; view ; Create an event from data. (define event (event 100 100 1 view (list "right" "shift"))) ;; event ; Determine in which view the event occurred. (event:view event) ;; #[view 1075519376] ; Determine if the event specified that ; the selection key is pressed. (event:view (read-event)) ;; #[view 1075519376] ; If selection key is pressed in the view. |
[Top]
event | pick-event |
Description
This extension returns the x-coordinate of the pick-event in pixels. event
specifies the event used, and it is read using (read-event) or is generated
from data using (event).
; event:x ; Create an event from data. (define view1 (view:dl)) ;; view1 ; Define an event in the new view. (define event1 (event 100 150 1 view1 (list "right" "shift"))) ;; event1 ; Determine the X location of the event. (event:x event1) ;; 100 ; Determine if the event specified an X location. (event:x (read-event)) ;; 334 ; Location of event. ; Define an event in the new view. (define event2 (event 100 150 1 view1 (list "right" "shift"))) ;; event2 ; Determine the X location of the event. (event:x event2) ;; 100 ; Determine if the event specified an X location. (event:x (read-event)) ;; 513 ; Location of event. |
[Top]
event | pick-event |
Description
This extension returns the y-coordinate of the pick-event in pixels.
; event:y ; Create an event from data. (define view1 (view:dl)) ;; view1 ; Define an event in the new view. (define event1 (event 100 150 1 view1 (list "right" "shift"))) ;; event1 ; Determine the Y location of the event. (event:y event1) ;; 150 ; Determine if the event specified an Y location. (event:y (read-event)) ;; 111 ; Location from pick |
[Top]
object | scheme-object |
Description
This extension returns #t if the object is a pick-event; otherwise, it returns
#f.
; event? ; Create an event from data. (define view1 (view:dl)) ;; view1 (define event1 (event 100 100 1 view1 (list "left" "control"))) ;; event1 ; Determine if the object is an event. (event? event1) ;; #t |
[Top]
color | color |
; filter:color ; Create solid block 1. (define block1 (solid:block (position 10 0 10) (position 20 30 40))) ;; block1 ; block1 => #[entity 2 1] ; Create linear edge 2. (define edge1 (edge:linear (position 0 0 0) (position 10 10 10))) ;; edge1 ; edge1 => #[entity 3 1] ; Create circular edge 3. (define edge2 (edge:circular (position 0 0 0) 20)) ;; edge2 ; edge2 => #[entity 4 1] ; Change the color of the entities so far to red. (entity:set-color (part:entities) 1) ;; () ; Create solid sphere 4. (define sphere1 (solid:sphere (position 20 30 40) 30)) ;; sphere1 ; sphere1 => #[entity 5 1] ; Create solid sphere 5. (define cyl1 (solid:cylinder (position 40 0 0) (position 5 5 5) 8)) ;; cyl1 ; cyl1 => #[entity 6 1] ; Create linear edge 6. (define edge3 (edge:linear (position 0 50 0) (position 50 50 0))) ;; edge3 ; edge3 => #[entity 7 1] ; Create spline edge 7. (define edge4 (edge:spline (list (position 20 20 20) (position 10 20 30) (position 50 40 10)))) ;; edge4 ; edge4 => #[entity 8 1] (zoom-all) ;; #[view 1075640874] ; OUTPUT Original ; Apply a green filter and obtain the entities. (filter:apply (filter:color 2) (part:entities)) ;; (#[entity 5 1] #[entity 6 1] ;; #[entity 7 1] #[entity 8 1]) Figure. filter:color |
[Top]
None |
; filter:display ; Create solid block 1. (define block1 (solid:block (position 10 0 10) (position 20 30 40))) ;; block1 ; block1 => #[entity 2 1] ; Create linear edge 2. (define edge1 (edge:linear (position 0 0 0) (position 10 10 10))) ;; edge1 ; edge1 => #[entity 3 1] ; Create circular edge 3. (define edge2 (edge:circular (position 0 0 0) 20)) ;; edge2 ; edge2 => #[entity 4 1] ; Change the color of the entities so far to red. (entity:set-color (part:entities) 1) ;; () ; Create solid sphere 4. (define sphere1 (solid:sphere (position 20 30 40) 30)) ;; sphere1 ; sphere1 => #[entity 5 1] ; Create solid sphere 5. (define cyl1 (solid:cylinder (position 40 0 0) (position 5 5 5) 8)) ;; cyl1 ; cyl1 => #[entity 6 1] ; Create linear edge 6. (define edge3 (edge:linear (position 0 50 0) (position 50 50 0))) ;; edge3 ; edge3 => #[entity 7 1] ; Create spline edge 7. (define edge4 (edge:spline (list (position 20 20 20) (position 10 20 30) (position 50 40 10)))) ;; edge4 ; edge4 => #[entity 8 1] ; Apply a green filter and obtain the entities. (filter:apply (filter:color 2) (part:entities)) ;; (#[entity 5 1] #[entity 6 1] ;; #[entity 7 1] #[entity 8 1]) ; Apply a display filter to list the entities ; that are displayed. (filter:apply (filter:display) (part:entities)) ;; (#[entity 2 1] #[entity 3 1] #[entity 4 1] ;; #[entity 5 1] #[entity 6 1] #[entity 7 1] ;; #[entity 8 1]) |
[Top]
x | real |
y | real |
z | real |
view | view |
; gvector:view ; Create a gvector in the active view's ; coordinate system. (gvector:view 4 4 5) ;; #[gvector 4.88865347297876 -0.833035035958355 ;; 5.69272516902042] |
[Top]
part | part |
entity | entity |
history-id | integer |
part-id | integer |
"default" | string |
Description
Three types of history exist: part histories, entity histories, and the default
history. If an entity with entity history is deleted or rolled before it's
creation, its history still exists. The part contains an array of histories,
which can be obtained with:(history history-id part-id).
Unless specified otherwise with option:set, each part generally has its own
history stream associated with it.
; history ; Define a new part. (define part1 (part:new)) ;; part1 ; Define a new view for the part. (define view1 (view:dl part1)) ;; view1 (env:set-active-part part1) ;; () ; Define a 2nd new part. (define part2 (part:new)) ;; part2 ; Define a 2nd new view for the part. (define view2 (view:dl part2)) ;; view2 ; Get the default history. (history "default") ;; #[history 0 0] (history part1) ;; #f (history part2) ;; #f |
[Top]
mod-type-string | string |
delta-state-name-string | string |
history | history |
Description
This extension is intended to find lists of faces that have been created,
deleted, or modified between the named delta state and the current state of the
given history stream. If no history stream is specified, the default stream is
used. If no delta state is specified, the beginning of the history stream is
used.
For the purposes of this extension, a face is not considered modified if its
associated attributes or bounding box changes. A face is considered modified if
one of its "contained" entities is modified. These contained entities are its
surface, loops, coedges, edges (and associated curves) and vertices (and
associated apoints). One intended use of the underlying API is to allow
customers to determine which faces in a model need to be re-rendered.
; history:get-modified-faces ; Create solid block 1, (roll:name-state "block") ;; "block" (define block1 (solid:block (position -20 -20 -20) (position 30 30 30))) ;; block1 (history:get-modified-faces "c" "block") ;; (#[entity 3 1] #[entity 4 1] #[entity 5 1] ;; #[entity 6 1] #[entity 7 1] #[entity 8 1]) (history:get-modified-faces "m" "block") ;; () (history:get-modified-faces "d" "block") ;; () (roll:name-state "round") ;; "round" (blend:round (list-ref (entity:edges block1) 9) 10 "fix") ;; #t (history:get-modified-faces "c" "round") ;; (#[entity 21 1] #[entity 22 1] #[entity 23 1]) (history:get-modified-faces "m" "round") ;; (#[entity 4 1] #[entity 6 1] #[entity 8 1]) (history:get-modified-faces "d" "round") ;; (-1 -1) |
[Top]
filename | string |
textmode | boolean |
part | part |
Description
This extension loads one or more history streams from a file. Each history
stream (and its associated entities) is placed in a distinct part. When placing
the first stream, the extension examines the part specified as an argument. If
the part is empty, then its history stream is replaced by the first stream and
the first stream's entities are placed in it. If the part is not empty, then a
new part is created into which the first stream and its entities are placed.
New parts are created for all additional streams. A list of the parts into
which streams were placed is returned by the extension.
; history:load ; turn on distributed history (part:set-distribution-mode #t) ;; #t ; create a block (define block1 (solid:block 0 0 0 10 10 10)) ;; block1 ; create both blocks (define block2 (solid:block 20 20 20 30 25 22)) ;; block2 ; save blocks with history (history:save "myblock.sat" (history (env:active-part))) ;; #t ; delete all entities in the part (part:clear) ;; #t ; read in blocks with history (history:load "myblock.sat") ;; (#[part 1]) ; should be 2 blocks (part:entities) ;; (#[entity 3 1] #[entity 4 1]) ; roll to state with only first block (roll) ;; -1 ; should be 1 block (part:entities) ;; (entity 4) |
[Top]
filename | string |
text-mode | boolean |
save-type | string |
history | history |
; history:save ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Save the history_stream of the currently-active ; part to the named file. (history:save "myblock.sat" (history (env:active-part))) ;; #t ; Set the save_version option to ACIS 1.7. (option:set "save_version" 107) ;; 800 ; Save the solid block again in ACIS 1.7 format. (history:save "myblock17.sat" (history (env:active-part))) ;; #t |
[Top]
hist | history |
; history:size ; turn on distributed history (part:set-distribution-mode #t) ;; #t ; give a name to history stream of active part (define h (history (env:active-part))) ;; h ; and find its size (history:size h) ;; 64 ; create a block (define block1 (solid:block 0 0 0 10 10 10)) ;; block1 (history:size h) ;; 192 ; create second block (define block2 (solid:block 20 20 20 30 25 22)) ;; block2 (history:size h) ;; 256 |
[Top]
None |
Description
When stepping, journal:abort terminates the current load without
executing the rest of the commands in the file.
; journal:abort ; Turn journaling on. (journal:on) ;; "j001.jrl" ; Create solid block 1. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Create solid block 2. (define block2 (solid:block (position 5 10 15) (position 10 20 35))) ;; block2 ; Turn journaling off (journal:off) ;; () ; Save the resulting journal. (journal:save "j008.jrl") ;; ""j008.jrl"" ; Clear the part. (part:clear) ;; #t ; Turn on single step mode. (journal:step #t) ;; (journal-step . #t) ; Load the journal file to recreate ; and redisplay the solid block. (journal:load "j001.jrl") ;; () (journal:abort) ;; (journal-abort . #t) |
[Top]
filename | string |
Description
This extension opens the optional filename, if it exists, where all future
commands are journaled to the existing file. The time and date of the append to
the existing file are indicated in the journal. If the filename is not
specified, a unique name is created after reading the current directory. The
unique name is numerically sequenced from the last journal file created or
named j(last number+1).jrl.
; journal:append ; Start journalling and create some geometry. (journal:on 'test.jrl) ;; "test.jrl" ; Create solid block 1. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Create solid block 2. (define block2 (solid:block (position 5 10 15) (position 10 20 35))) ;; block2 ; Turn journaling off (journal:off) ;; () ; Save the resulting journal. (journal:save 'test.jrl) ;; "test.jrl" ; Clear the part. (part:clear) ;; #t ; Load the journal file to recreate ; and redisplay the solid block. (journal:load 'test.jrl) ;; "test.jrl" ; Initiate the append command. (journal:append 'test.jrl) ;; "test.jrl" ; Add additional changes to blocks. (define color1 (entity:set-color block1 1)) ;; color1 (define color2 (entity:set-color block2 4)) ;; color2 ; Turn journaling off and save new version. (journal:off) ;; () (journal:save 'test.jrl) ;; "test.jrl" ; Load journal file to verify successful appending. (journal:load 'test.jrl) ; the contents of the journal are displayed ;; test.jrl |
[Top]
filename | string |
Description
The journal:load extension loads an existing journal file and runs each of the
commands contained in that file. Each line is journaled if journaling is on.
This extension works like the load primitive, except the file is evaluated one
line at a time instead of all at once with the Scheme load primitive.
Encountered errors do not abort the load operation and are reported in the
command window. This extension is useful for debugging Scheme files as well as
for rerunning the commands given in another Scheme session.
Note: An error in the
loaded file does not abort the evaluation.
The mouse-up-hook and mouse-down-hook are no longer journaled, because the
results are incomplete without journaling all of the mouse moves as well.
The journal:load extension permits single stepping through a loaded file one
line at a time. (journal:step #t) turns it on and should be run before
loading the journal file. In addition, (option:set "timing" #t) can be
used to show the execution time for each command in the output window.
Before loading, the directory where the load file is found is added to the
part-load-path.
; journal:load ; Turn journaling on. (journal:on) ;; "j002.jrl" ; Create solid block 1. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Create solid block 2. (define block2 (solid:block (position 5 10 15) (position 10 20 35))) ;; block2 ; Turn journaling off (journal:off) ;; () ; Save the resulting journal. (journal:save "j002.jrl") ;; "j002.jrl" ; Clear the part. (part:clear) ;; #t ; Load the journal file to recreate ; and redisplay the solid block. (journal:load "j002.jrl") ;; "j002.jrl" ; (journal:on) ; "j010.jrl" ; (define block1 (solid:block ; (position 0 0 0) (position 10 10 10))) ; block1 ; (define block2 (solid:block ; (position 5 10 15) (position 10 20 35))) ; block2 ; (journal:off) |
[Top]
None |
Description
This extension turns off journaling. All extensions executed after journaling
has been turned off are not retained in the journaling file.
; journal:off ; Turn journaling on. (journal:on) ;; "j004.jrl" ; Create solid block 1. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Create solid block 2. (define block2 (solid:block (position 5 10 15) (position 10 20 35))) ;; block2 ; Save the resulting journal. ; Turn journaling off (journal:off) ;; () |
[Top]
filename | string |
Description
This extension opens the optional specified
filename, if it exists, and all future
commands are journaled to the existing file. If
filename
is not specified, the extension creates a unique name after reading the current
directory. The unique name is numerically sequenced from the last journal file
created or named j(last number+1).jrl. If the file exists, it is truncated
to zero length.
; journal:on ; Close the current journal file and open ; a new journal file called new_jrl. (journal:on "new_jrl") ;; "new_jrl" ; Create solid block 1. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Create solid block 2. (define block2 (solid:block (position 5 10 15) (position 10 20 35))) ;; block2 ; Turn journaling off (journal:off) ;; () ; Save the resulting journal. (journal:save "new_jrl") ;; "new_jrl" ; Clear the part. (part:clear) ;; #t ; Load the journal file to recreate ; and redisplay the solid block. (journal:load "new_jrl") ;; "new_jrl" ; (journal:on "new_jrl") ; "new_jrl" ; (define block1 (solid:block ; (position 0 0 0) (position 10 10 10))) ; block1 ; (define block2 (solid:block ; (position 5 10 15) (position 10 20 35))) ; block2 ; (journal:off) |
[Top]
None |
Description
This extension does not record in the journal any procedures evaluated while
the journal file is paused.
; journal:pause ; Turn journaling on. (journal:on) ;; "j012.jrl" ; Create solid block 1. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Temporarily disable journaling. (journal:pause) ;; () ; Create solid block 2. (define block2 (solid:block (position 5 10 15) (position 10 20 35))) ;; block2 ; Resume journaling. (journal:resume) ;; () ; Create solid block 3. (define block3 (solid:block (position -5 10 -15) (position 10 -20 35))) ;; block3 ; Turn journaling off (journal:off) ;; () ; Save the resulting journal. (journal:save "j012.jrl") ;; "j012.jrl" ; Clear the part. (part:clear) ;; #t ; Load the journal file to recreate ; and redisplay the solid block. (journal:load "j012.jrl") ;; "j012.jrl" ; (journal:on) ; (define block1 (solid:block ; (position 0 0 0) (position 10 10 10))) ; block1 ; (journal:pause) ; (journal:resume) ; () ; (define block3 (solid:block ; (position -5 10 -15) (position 10 -20 35))) ; block3 ; (journal:off) ; "j012.jrl" |
[Top]
None |
; journal:resume ; Turn journaling on. (journal:on) ;; "j015.jrl" ; Create solid block 1. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Temporarily disable journaling. (journal:pause) ;; () ; Create solid block 2. (define block2 (solid:block (position 5 10 15) (position 10 20 35))) ;; block2 ; Resume journaling. (journal:resume) ;; () ; Create solid block 3. (define block3 (solid:block (position -5 10 -15) (position 10 -20 35))) ;; block3 ; Turn journaling off (journal:off) ;; () ; Save the resulting journal. (journal:save "j015.jrl") ;; "j015.jrl" ; Clear the part. (part:clear) ;; #t ; Load the journal file to recreate ; and redisplay the solid block. (journal:load "j015.jrl") ;; ;; (journal:on) ;; "j015.jrl" ;; (define block1 (solid:block ;; (position 0 0 0) (position 10 10 10))) ;; block1 ;; (journal:pause) ;; (journal:resume) ;; () :: (define block3 (solid:block ;; (position -5 10 -15) (position 10 -20 35))) ;; block3 ;; (journal:off) ;; "j015.jrl" |
[Top]
filename | string |
; journal:save ; Turn journaling on. (journal:on) ;; "j004.jrl" ; Create solid block 1. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Turn journaling off (journal:off) ;; () ; Save the resulting journal. (journal:save "j004.jrl") ;; "j004.jrl" ; Clear the part. (part:clear) ;; #t ; Load the journal file to recreate ; and redisplay the solid block. (journal:load "j004.jrl") ;; "j004.jrl" ; contents of journal file are displayed ; (journal:on) ; "j004.jrl" ; (define block1 (solid:block ; (position 0 0 0) (position 10 10 10))) ; block1 ; (journal:off) ; j004.jrl |
[Top]
value | boolean |
Description
journal:step sets a flag to control stepping through the journal file. When
stepping is on, the system waits for input after printing, but before executing
each line. A single return causes the line to be executed. Anything else is
evaluated and the system waits for more input. This allows one to setup demos
and to debug scheme scripts one line at a time.
To run a demo, enter (journal:step #f), but include (journal:step #t)
at points in the script where you want to stop and talk. Extra commands can be
executed to show things that are not a part of the canned demo. Or press the
return key a few times to step through it slowly. Re-enter free running mode
with (journal:step #f).
; journal:step ; Turn journaling on. (journal:on) ;; "j015.jrl" ; Create solid block 1. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Create solid block 2. (define block2 (solid:block (position 5 10 15) (position 10 20 35))) ;; block2 ; Switch the step mode to off. (journal:step #f) ;; (journal-step . #f) ; Create solid block 3. (define block3 (solid:block (position -5 10 -15) (position 10 -20 35))) ;; block3 ; Turn journaling off (journal:off) ;; () ; Save the resulting journal. (journal:save "j015.jrl") ;; "j015.jrl" ; Clear the part. (part:clear) ;; #t ; Turn on step mode. (journal:step #t) ;; (journal-step . #t) ; Load the journal file to recreate ; and redisplay the solid block. (journal:load "j015.jrl") ;; #f |
[Top]
filename | string |
Description
This extension loads a dynamically-linked library at run time and attaches any
Scheme primitives (extensions) defined in the library to the parser. This
enables users to define their own Scheme extensions in DLLs, and then
selectively load those DLLs at run time as needed. This extension returns an
empty list.
; load-dll ; Load a dynamically linked library. (load-dll "mylib.dll") |
[Top]
id | integer |
; part ; define a part (define part1 (part:new)) ;; part1 ; Find a part from its ID number. (part 3) ;; #f ; Find a part from its ID number. (part 2) ;; #[part 2] |
[Top]
script | string |
; part:add-picksubscriber-script (define ps (lambda (n) (cond ((equal? n "BeginPick") (newline) (display "BeginPick") ) ((equal? n "ClearENTITYs") (newline) (display "ClearENTITYs") ) ((equal? n "NotifyAboutPick") (newline) (display "NotifyAboutPick") ) ((equal? n "NotifyAboutUnPick") (newline) (display "NotifyAboutUnPick") ) ((equal? n "EndPick") (newline) (display "EndPick") (newline) ) (else (newline) (display "Unrecognised") ) ) ) ) ;; ps (define my_ps (part:add-picksubscriber-script "ps" )) ;; my_ps (part:remove-picksubscriber my_ps) |
[Top]
part | part |
Description
This extension does not reset the entity counter to 1. Use the env:set-active-part
extension to establish the active part.
Note: Roll back is not
supported after processing this extension. The entity counter is not reset to
1.
; part:clear ; Create a block. (define block1 (solid:block (position 0 0 0) (position 5 10 15))) ;; block1 ; Create a sphere (define sphere1 (solid:sphere (position 0 0 0) 10)) ;; sphere1 ; Delete all entities in the active part. (part:clear) ;; #t |
[Top]
part | part |
Description
This extension return a list of all currently selected entities in a part. If
the optional part is not specified, then the active part is assumed. Use the
env:set-active-part extension to establish the active part.
Note: Use part:clear-selection
to de-select all selected entities.
; part:clear-selection ; Create a new part (define part1 (part:new)) ;; part1 ; Create a new block (define block (solid:block 0 0 0 1 1 1)) ;; block ; Create a new sphere (define sphere (solid:sphere 0 0 0 1)) ;; sphere ; Select block and sphere (entity:select block sphere) ;; () ; Clear selection (part:clear-selection) ;; () |
[Top]
part | part |
Description
This extension deletes a part and all of the entities in it. If the optional
part is not specified, then the active part is closed. Use the env:set-active-part
extension to establish the active part. The part is removed from env:parts.
The display list associated with this part is deleted along with all rendering
contexts contained in this part. It closes all windows and files associated
with views that depict the entities in the part's display list. These views are
removed from the env:views list.
Note: Roll back is not supported for this part after processing this extension.
; part:close ; Create a new part (define part1 (part:new)) ;; part1 (part:close part1) ;; () |
[Top]
part | part |
Description
This extension prints debug information to the output port. The first column
specifies the entity number. The second column indicates the entity type. The
remaining columns specify the address location of the entity when it is
displayed.
; part:debug ; create some entities to delete (define block1 (solid:block (position 0 0 0) (position 5 10 15))) ;; block1 ; Print the debug information. (part:debug) ; --- Entity ID table --- ; 1, rh_background, 4024f010, top level ; 2, body, 40255c00, top level ; --- End of ID table --- ;; () (define edges1 (entity:edges block1)) ;; edges1 ; Print the debug information. (part:debug) ; --- Entity ID table --- ; 1, body, 401f6038, top level ; 2, edge, 401f29e0, not top level ; 3, edge, 401f28d8, not top level ; 4, edge, 401f295c, not top level ; 5, edge, 401f29e0, not top level ; 6, edge, 401f2a64, not top level ; 7, edge, 401f2930, not top level ; 8, edge, 401f2abc, not top level ; 9, edge, 401f2a38, not top level ; 10, edge, 401f29b4, not top level ; 11, edge, 401f2a90, not top level ; 12, edge, 401f2904, not top level ; 13, edge, 401f2a0c, not top level ; 14, edge, 401f2a0c, not top level ; --- End of ID table --- ;; () |
[Top]
part | part |
name | string |
Description
This removes the rendering context, name, from the specified part. If no part
is supplied, the rendering context is deleted from the active part. Any views
that are associated with the rendering context are also deleted while their
associated windows and files are closed. If name specifies an invalid rendering
context, this extension has no effect.
; part:delete-rendering-context ; Create a new part. (define part1 (part:new)) ;; part1 ; Create a new view. (define view1 (view:dl)) ;; view1 ; Set the context of the view. (view:set-context view1 "dl") ;; #[view 1075606912] ; Get the context of the view. (view:context view1) ;; "dl_context" ; Delete the rendering context for the part (part:delete-rendering-context part1 "dl") ;; #t ; Get the context of the view. (view:context view1) ;; "dl_context" |
[Top]
part | part |
filter | entity-filter |
Description
This extension obtains a list of the top-level entities from the specified
part. An
ENTITY is top level when
making a call to api_get_owner returns itself. Also, every
ENTITY
contains an owner method. This method would return the next higher
ENTITY. If that object is the top
level
ENTITY, then this pointer is
returned. This means that if a
FACE does not point to an
owning
SHELL, this
FACE
is top level for that model. A
BODY is normally top level,
but in some cases, there are others that are the top level
ENTITY.
; part:entities ; List the entities in the active part. (part:entities) ;; (#[entity 1 1]) (define block1 (solid:block (position 0 0 0) (position 5 10 15))) ;; block1 (part:entities) ;; (#[entity 1 1] #[entity 2 1]) (define edges1 (entity:edges block1)) ;; edges1 ; Create a point. (define point1 (point (position 0 0 0))) ;; point1 ; Get a list of the top level entities in a part. (part:entities) ;; (#[entity 1 1] #[entity 2 1] #[entity 15 1]) ; Get a list of the solid entities in a part. (part:entities (filter:type "solid?")) ;; (#[entity 2 1]) |
[Top]
None |
Description
Returns TRUE or FALSE depending on whether or not distributed history is on or
off.
; part:get-distribution-mode ; get the distribution mode of the part (part:get-distribution-mode) ;; #f |
[Top]
filename | string |
textmode | boolean |
part | part |
with-history | boolean |
Description
This extension is a merge function. This means that the restore does not
replace entities but adds them to the present working session. The list of
entities is returned.
; part:load ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Save the part under the specified name. (part:save "eraseme.sat") ;; #t ; Delete all entities from the part. (part:clear) ;; #t ; Create another solid block. (define block2 (solid:block (position -20 -30 -10) (position -5 -10 -15))) ;; block2 ; Load the saved part (block). (part:load "eraseme.sat") ;; (#[entity 4 1] #[entity 5 1]) |
[Top]
part | part |
; part:modified ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Define a new part. (part:new) ;; #[part 2] ; Determine if a part has been modified. (part:modified? (part 2)) ;; #f |
[Top]
part | part |
; part:name ; Set the name of the currently-active part. (part:set-name "block.sat") ;; () ; Get the name of the currently-active part. (part:name) ;; "block.sat" ; Save the part under the specified name. (part:save "block2.sat") ;; #t ; Get the name of the currently-active part. (part:name) ;; "block2.sat" |
[Top]
size | integer |
; part:new ; Define a new part (define part1 (part:new)) ;; part1 ; Set the part as the active part in the environment. (env:set-active-part part1) ;; () |
[Top]
ISCMPickSubscriber | picksubscriber |
; part:remove-picksubscriber (define ps (lambda (n) (cond ((equal? n "BeginPick") (newline) (display "BeginPick") ) ((equal? n "ClearENTITYs") (newline) (display "ClearENTITYs") ) ((equal? n "NotifyAboutPick") (newline) (display "NotifyAboutPick") ) ((equal? n "NotifyAboutUnPick") (newline) (display "NotifyAboutUnPick") ) ((equal? n "EndPick") (newline) (display "EndPick") (newline) ) (else (newline) (display "Unrecognised") ) ) ) ) ;; ps (define my_ps (part:add-picksubscriber-script "ps" )) ;; my_ps (part:remove-picksubscriber my_ps) |
[Top]
filename | string |
textmode | boolean |
part | part |
with-history | boolean |
mainline-only | boolean |
; part:save ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Save the currently-active part to the named file. (part:save "myblock.sat") ;; #t ; Set the save_version option to ACIS 1.7. (option:set "save_version" 107) ;; 700 ; Save the solid block again in ACIS 1.7 format. (part:save "myblock17.sat") ;; #t |
[Top]
ent-list | entity | entity ... |
filename | string |
textmode | boolean |
with-history | boolean |
; part:save-selection ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Save the currently-active part to the named file. (part:save-selection block1 "block.sat" #t) ;; #t ; Clear the part (part:clear) ;; #t ; Restore the saved entity (define restore (part:load "block.sat")) ;; restore |
[Top]
part | part |
Description
This extension return a list of all currently selected entities in a part. If
the optional part is not specified, then the active part is assumed. Use the
env:set-active-part extension to establish the active part.
Note: Use part:clear-selection
to deselect all selected entities.
; part:selection ; Create a new part (define part1 (part:new)) ;; part1 ; Create a new block (define block (solid:block 0 0 0 1 1 1)) ;; block ; Create a new sphere (define sphere (solid:sphere 0 0 0 1)) ;; sphere ; Select block and sphere (entity:select block sphere) ;; () ; Get current selection (part:selection) ;; block sphere |
[Top]
on-off | boolean |
Description
Turns distributed history on or off. After distribution is set (either on or
off) it cannot be changed. Distributed history is off by default, and the first
bulletin created for a part's history stream locks it in this state. This
Scheme extension replaces distributed_history.
; part:set-distribution-mode ; set the distribution mode of the part (part:set-distribution-mode #t) ;; #t |
[Top]
name | string |
part | part |
; part:set-name ; Define a new part (define part1 (part:new)) ;; part1 ; Set the part as the active part in the environment. (env:set-active-part part1) ;; () ; Set the name of the currently-active part. (part:set-name "block.sat") ;; () ; Save again in ACIS1.7 format (option:set "save_version" 107) ;; 700 (part:save "block17.sat") ;; #t |
[Top]
part | part |
; part:views ; Define a new part (define part1 (part:new)) ;; part1 ; Set the part as the active part in the environment. (env:set-active-part part1) ;; () ; define some views (define view1 (view:dl)) ;; view1 (define view2 (view:dl)) ;; view2 ; Get all views displaying a part. (part:views) ;; (#[view 10755338721] #[view 10755339071]) |
[Top]
object | scheme-object |
; part? ; Define a new part (define part1 (part:new)) ;; part1 ; Set the part as the active part in the environment. (env:set-active-part part1) ;; () ; Determine if part1 is a part. (part? part1) ;; #t |
[Top]
None |
Description
This extension returns the pick aperture's dimensions in the form (aperture-x.
aperture-y). The default is a width of 15 pixels and a height of 15 pixels. The
aperture specifies the size of the window surrounding the cursor; items inside
the aperture window could be selected by a read-event. Use the extension
pick:set-aperture to change the aperture size.
; pick:aperture ; Get the dimensions of the pick aperture. (pick:aperture) ;; (15 . 15) (pick:set-aperture 25 25) ;; () (pick:aperture) ;; (25 . 25) |
[Top]
event | pick-event |
pick-ray | ray |
filter | entity-filter |
Description
If the picked entity has sub-components (e.g., the edges of a solid), this
extension returns the sub-component as the entity. This extension returns #f if
no valid object is registered within the pick:aperture
by the pick action.
; pick:edge ; Create a solid block. (define block1 (solid:block (position -10 -10 0) (position 25 25 25))) ;; block1 ; Extract an edge from a pick-event. ; Select an edge of the block with the mouse. (define edge1 (pick:edge (read-event))) ;; edge1 ; Returns #f if no edge is picked. ; Select an edge of the block with the mouse. (define edge2 (pick:edge (read-event) (filter:type "edge:linear?"))) ;; edge2 ; Returns #f if no edge is picked. |
[Top]
event | pick-event |
filter | entity-filter |
depth | integer |
Description
When picking several connected entities (e.g., all edges of a face), pick one
entity, the face, and find the others by following model topology pointers.
This extension returns #f if no valid object is registered by the pick action.
; pick:entity ; Create a solid block. (define block1 (solid:block (position -10 -10 0) (position 25 25 25))) ;; block1 ; Get an entity from pick-event 1. (define pick1 (pick:entity (read-event))) ; Using the mouse, select the block. ;; pick1 ; Returns #f if nothing selected with the mouse. (define list (entity:edges pick1)) ;; list ; Get an entity from pick-event 2. (define pick2 (pick:entity (read-event) 2)) ; Using the mouse, select the block. ;; pick2 ; Returns #f if nothing selected with the mouse. |
[Top]
event | pick-event |
pick-ray | ray |
face-index | integer |
filter | entity-filter |
The optional filter specifies the entity to include with the pick event.
; pick:face ; Extract a face from a pick-event. ; Create a solid block. (define block1 (solid:block (position -10 -10 0) (position 25 25 25))) ;; block1 ; Get a list of the faces so we know what the ; entities could be (define list (entity:faces block1)) ;; list ; Extract planar-face 1 from a pick-event. (define face1 (pick:face (read-event))) ; Using the mouse, select a face on the block. ;; face1 ; Returns #f in nothing selection. ; Extract planar-face 2 from a pick-event using ; a face-index integer. (define face2 (pick:face (read-event) 2)) ; Using a mouse, select a face on the block. ;; face2 ; Returns #f in nothing selection. |
[Top]
event1 | pick-event |
event2 | pick-event |
filter | entity-filter |
; pick:in-region ; Create a solid cylinder. (define cyl1 (solid:cylinder (position -5 -5 -5) (position -30 0 -30) 10)) ;; cyl1 ; Create a block. (define block1 (solid:block (position 5 5 5) (position 20 0 20))) ;; block1 ; Get all the entities lying within a rectangular ; region defined by two pick-events. ; Create a rectangle that contains block ; within it. ; Define the first corner of a rectangle. (define event1 (read-event)) ;; event1 ; Define the first corner to be the start ; position. (define start (pick:position event1)) ;; start ; Use rubberbanding to visually aid corner selection. ; Create a rectangle rubberband driver. (rbd:rectangle #t start) ;; #[rbd-driver 401b1df0] ; Define the second corner of rectangle. (define event2 (read-event)) ;; event2 ; Define the second corner to be the end ; position. (define end (pick:position event2)) ;; end ; Remove the rubberbanding rectangle. (rbd:remove-type rbd:rectangle?) ;; () ; Using the mouse, select diagonal corners of ; the window. (define pick (pick:in-region event1 event2)) ;; pick |
[Top]
event | pick-event |
plane-position | position |
plane-direction | gvector |
Description
This extension computes the position of the pick event mapped into the space of
the active WCS, if specified; otherwise, it maps into model space coordinates.
If snapping is active, the position component is snapped to the grid. Positions
returned are approximate.
; pick:position ; Create a solid block. (define block1 (solid:block (position -10 -10 0) (position 25 25 25))) ;; block1 ; Extract a position of the pick from a pick-event. (pick:position (read-event)) ; Using the mouse, select screen position 1 ; corresponding approximately to the upper ; left corner of the front of the block. ;; #[position -34.3990726470947 39.1702480316162 0] ; Extract another position of the pick from a ; pick-event. (pick:position (read-event) (position 0 0 0) (gvector 0 1 0)) ; Using the mouse, select screen position 1 ; corresponding approximately to the lower ; right corner of the front of the block. ;; #[position 20.2177810668945 0 -5.35901403427124] ; OUTPUT Example ; Second example: ; Draw a rubberbanded rectangle using ; pick:position. ; Define the first corner of a rectangle. (define start (pick:position (read-event))) ;; start ; Create a rectangle rubberband driver. (rbd:rectangle #t start) ;; #[rbd-driver 401b1df0] ; Define the second corner of rectangle. (define end (pick:position (read-event))) ;; end ; Define the rectangle. (define rectangle (lambda (start end) (let ((x1 (position:x start)) (x2 (position:x end)) (y1 (position:y start)) (y2 (position:y end)) (z1 (position:z start)) (z2 (position:z end))) (let ((corner1 (position x2 y1 z2)) (corner2 (position x1 y2 z1))) (list (edge:linear start corner1) (edge:linear corner1 end) (edge:linear end corner2) (edge:linear corner2 start)))))) ;; rectangle ; Draw the rectangle. (define rectangle (rectangle start end)) ;; rectangle ; #[entity 2 1] #[entity 3 1] #[entity 4 1] ; #[entity 5 1] ; Turn off rubberbanding. (rbd:remove-type rbd:rectangle?) ;; () ; OUTPUT Example Figure. pick:position |
[Top]
event | pick-event |
plane-position | position |
plane-direction | gvector |
Description
This extension computes a pick event's ray. The ray maps into the space of the
active WCS, if specified; otherwise, it maps into model space coordinates. If
snapping is active, the position component is snapped to the grid.
;; pick:ray ; Create a solid block. (define block1 (solid:block (position -10 -10 0) (position 25 25 25))) ;; block1 ; Get a ray from pick-event 1. (pick:ray (read-event) (position 0 0 0) (gvector 1 0 0)) ; Using the mouse, select screen position 1 ; corresponding approximately to the lower ; left corner of the front of the block. ;; #[ray (0 -29.5407 9.5048) ;; (-0.408248 0.816497 -0.408248)] ; Get a ray from pick-event 2. (pick:ray (read-event) (position 0 0 0) (gvector 1 0 0)) ; Using the mouse, select screen position 2 ; corresponding approximately to the upper ; right corner of the front of the block. ;; #[ray (0 40.2082 -0.505848) ;; (-0.408248 0.816497 -0.408248)] ; OUTPUT Result Figure. pick:ray |
[Top]
dx | integer |
dy | integer |
; pick:set-aperture ; Get the dimensions of the pick aperture. (pick:aperture) ;; (15 . 15) (pick:set-aperture 25 25) ;; () (pick:aperture) ;; (25 . 25) |
[Top]
event | pick-event |
pick-ray | ray |
filter | entity-filter |
Description
This extension gets the vertex at the end of an entity sub-component.
; pick:vertex ; Create a solid block. (define block1 (solid:block (position -10 -10 0) (position 25 25 25))) ;; block1 ; Extract a vertex from a pick-event. (define vertex1 (pick:vertex (read-event))) ; Select a vertex on the block (position 1) ; with the mouse. ;; vertex1 ; Returns #f if nothing selected. ; OUTPUT Result Figure. pick:vertex |
[Top]
ray | ray |
hits_wanted | integer |
ao | acis-options |
Description
When fires a ray at an array of entities from the given ray point in the given
ray direction with the given ray radius. It returns a list that contains the n
entities nearest the ray point (where n is the number of hits recorded) and an
array that holds the n parameter values of the points long the ray. Only
entities in the forward direction along the ray can be hit. This extension
returns #f if no valid object is hit by the ray.
; pick-ray:entity ; define a block (define block1 (solid:block 0 0 0 30 30 30)) ;; block1 ; define a sphere (define sphere1 (solid:sphere 20 20 20 15)) ;; sphere1 ; define a ray (define ray1 (ray (position -5 -5 -5) (gvector 1 1 1))) ;;ray1 ; pick entities by ray (define pick1 (pick-ray:entity ray1)) |
[Top]
x | real |
y | real |
z | real |
view | view |
Description
This extension returns the position in active system coordinates.
; position:view ; Create a new view. (define ISO (view:dl)) ;; ISO ; Create new positions in the active view's ; coordinate system. (position:view 0 -1 0) ;; #[position 0.182574185835055 -0.365148371670111 ;; -0.912870929175277] ; Create new positions in the ISO view's ; coordinate system. (position:view 0 -1 0 ISO) ;; #[position 0 -1 0] |
[Top]
None |
Description
This extension waits for mouse input from the application, then generates a pick-event
Scheme object.
The Scheme object contains five numbers. The first and second numbers specify
the x-position and y-position in pixels of the cursor at the time
a mouse click event was initiated. The third number specifies the mouse button
initiated; valid options are 1, 2, or 3. The fourth number specifies the view
handle used for the active view where the event took place. The fifth
numerically codes the state of the modifier keys.
; read-event ; Create a solid block. (define block1 (solid:block (position -10 -10 -10) (position 10 10 10))) ;; block1 ; Specify a pick-event 1. (read-event) ; Using mouse button 1, select point on block1. ;; #[pick-event 221 367 1 1075533160 0] ; Specify pick-event 2. (read-event) ; Using mouse button 2, select point on block1. ;; #[pick-event 326 278 2 1075533160 0] ; Specify pick-event 3. (read-event) ; Using mouse button 3, select point on block1. ;; #[pick-event 275 213 3 1075533160 0] ; Two-step entity dragging example follows. ; Click on the block. If you click somewhere ; other than on the block, an error message ; is displayed. (define evt (read-event)) ;; evt ; Get entity portion of event. (define ent (pick:entity evt)) ;; ent ; Get original location of entity / event. (define pos1 (pick:position evt)) ;; pos1 ; Test to see if object is an entity. ; Move the mouse to new position. The ; image should follow. ; When at new location, click mouse again. (if (entity? ent) (begin (rbd:drag #t ent pos1) (rbd:line #t pos1) (define pos2 (pick:position (read-event))) (rbd:remove-type rbd:drag?) (rbd:remove-type rbd:line?) (entity:transform ent (transform:translation (gvector:from-to pos1 pos2) )) ) (ui:error-dialog "Object selected is not entity.") ) ;; #[entity 3 1] ; Move entity back to where it originally was. (if (entity? ent) (begin (entity:transform ent (transform:translation (gvector:from-to pos2 pos1) ))) (ui:error-dialog "Object selected is not entity.")) ;; #[entity 3 1] ; OUTPUT Result Figure. read-event |
[Top]
item | ro |
Description
Returns the color of the specified display item in the display list. A display
item is not part of the model and does not get saved and restored.
; ro:color ; Define two polyline list items. (define poly1 (ro:polyline (list (position 0 0 0) (position 5 0 0) (position 0 5 0) (position 0 0 0)) #t)) ;; poly1 ; Color poly1 red. (ro:set-color poly1 1) ;; () (define poly2 (ro:polyline (list (position 10 10 10) (position 15 10 10) (position 10 15 10) (position 10 10 10)) #t)) ;; poly2 ; Color poly2 blue. (ro:set-color poly2 3) ;; () ; OUTPUT Display ; Request the color of poly1 and poly2. (ro:color poly1) ;; #[color 1 0 0] ; color 1 0 0 is red. (ro:color poly2) ;; #[color 0 0 1] ; color 0 0 1 is blue. |
[Top]
rendering-object | ro |
Description
Deletes the rendering object.
; ro:delete ; Create a point display list item. (define dp (ro:point (position 15 5 10))) ;; dp (ro:delete dp) ;; () |
[Top]
rendering-object | ro |
Description
Displays the rendering object.
; ro:display ; Create a point display list item. (define dp (ro:point (position 15 5 10))) ;; dp (ro:erase dp) (ro:display dp) |
[Top]
rendering-object | ro |
Description
Erases the rendering object.
; ro:display ; Create a point display list item. (define dp (ro:point (position 15 5 10))) ;; dp (ro:erase dp) (ro:display dp) |
[Top]
face | face |
; ro:face-pcurves (define param_lines (ro:face-pcurves (pick-face))) ;; param_lines |
[Top]
pos1 | position |
pos2 | position |
Description
Returns the new rendering object.
; ro:line ; Create a line between the position (ro:line ro (position 0 0 0) (position 3 3 3)) ;; ro |
[Top]
view-opt | string |
Description
Returns the new rendering object.
; ro:new ; Create a new rendering object (define ro (ro:new 'all')) ;; ro |
[Top]
position | position |
Description
This extension creates a point display list item at the specified position. The
point is displayed in all views until it is deleted. The point style is
controlled by env:set-point-style and
env:set-point-size.
A display item is not part of the model and does not get saved and restored. Even though a 3D position is provided for the display item, it is mapped into 2D space. A display item should then not be used for snapping or as part of a model.
; ro:point ; Create a point display list item. (define dp (ro:point (position 15 5 10))) ;; dp |
[Top]
pos-list | (position ...) |
fill | boolean |
Description
This extension creates a polyline display item for the display list connecting
the specified positions. The polyline is displayed in all views until it is
removed.
A display item is not part of the model and does not get saved and restored.
Even though a 3D position is provided for the display item, it is mapped into
2D space. A display item should then not be used for snapping or as part of a
model.
; ro:polyline ; Create a polyline display list item ; for a filled triangle. (define poly (ro:polyline (list (position 0 0 0) (position 5 0 0) (position 0 5 0) (position 0 0 0)) #t)) ;; poly |
[Top]
position | position |
text | string |
Description
This extension creates a text display list item at the specified position. The
text displays in all views until it is removed.
A display item is not part of the model and does not get saved and restored.
Even though a 3D position is provided for the display item, it is mapped into
2D space. A display item should then not be used for snapping or as part of a
model.
; ro:text ; Create a text display list item. (define dt (ro:text (position 10 0 15) "Hello")) ;; dt ; Create a second text display list item. (define ds (ro:text (position -10 0 15) "Test")) ;; ds (ro:set-color dt (color:rgb 1 0 0)) ;; () |
[Top]
object | scheme-object |
Description
This extension returns #t if the specified
object
is a rendering object; otherwise, it returns #f. A rendering object is not part
of the model and does not get saved and restored.
object
is a specified Scheme object of a rendering object.
; ro? ; Create a point rendering object. (define p1 (ro:point (position 0 0 0))) ;; p1 ; Verify that the object is a rendering object. (ro? p1) ;; #t ; Create a circular edge. (define edge1 (edge:circular (position 0 0 0) 20)) ;; edge1 ; Verify that the circular edge is not ; a rendering object. (ro? edge1) ;; #f |
[Top]
number-of-states | integer |
name-string | string |
history | history |
Description
This extension returns the number of steps rolled.
; roll ; Roll back and forward ; to previously defined states. ; Create solid block 1, (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Create solid block 2. (define block2 (solid:block (position 15 15 15) (position 25 25 25))) ;; block2 ; Create solid block 3. (define block3 (solid:block (position 30 30 30) (position 40 40 40))) ;; block3 ; Roll back to the beginning of the session. (roll "start") ;; 6 ; Roll forward to the end of the session. (roll "end") ;; 6 ; Roll back one step. (roll) ;; -1 ; Define the name of the state. (roll:name-state "step") ;; "step" ; Roll back two states (roll -2) ;; -2 ; Roll back to the named state. (roll "step") ;; 2 |
[Top]
history | history |
Description
This extension returns #t if it is possible to roll back to a previous state;
otherwise, it returns #f. It is not necessary to call this extension before
invoking the roll procedure because that procedure automatically checks to make
sure that it is possible to roll the specified number of steps. This extension
helps update the user interface to reflect whether it is possible to perform a
roll operation.
; roll:back? ; Create a solid sphere. (define sphere1 (solid:sphere (position 0 0 0) 10)) ;; sphere1 ; Determine if a roll back is possible. (roll:back?) ;; #t |
[Top]
history | history |
level | integer |
ent-name | string |
Description
Writes debugging information about the history stream to the debug file.
; roll:debug ; Get history information for the active part. ; Note that the active part must be specified ; explicitly as the default is a background ; history stream not associated with a part. (roll:debug (history "default") 1) ;; () ; Returns debug information on the specified history. |
[Top]
history | history |
Description
This extension deletes all delta states to free memory used to maintain those
states to ACIS (but not to the operating system). After calling this extension,
it is no longer possible to roll backwards or forwards to any of the deleted
states. This extension returns the number of deleted states.
; roll:delete-all-states ; Create a solid sphere. (define sphere1 (solid:sphere (position 0 0 0) 30)) ;; sphere1 ; Delete all the delta states. (roll:delete-all-states) ;; 4 |
[Top]
history | history |
Description
This extension deletes all delta states after the current state to free memory
used to maintain the states in ACIS (but not the operating system). After
calling this extension, it is no longer possible to roll forward to any of the
deleted states. To avoid creation of branches, use this extension before
operations that would create a new state. Clean up branches after they are
created with roll:delete-active-states. This extension returns the
number of deleted states.
; roll:delete-following-states ; Create a solid sphere. (define sphere1 (solid:sphere (position 0 0 0) 10)) ;; sphere1 ; Roll back one state. (roll -1) ;; -1 ; Delete all the following delta states. (roll:delete-following-states) ;; 0 |
[Top]
history | history |
Description
This extension deletes all delta states not in the active path to free memory
used to maintain those states in ACIS (but not the operating system). After
calling this extension, it is no longer possible to roll to any of the deleted
states. The active path is the set of delta states from the root to the
currently active state. This extension returns the number of deleted states.
; roll:delete-inactive-states ; Create a solid sphere. (define sphere1 (solid:sphere (position 0 0 0) 10)) ;; sphere1 ; Delete inactive delta states. (roll:delete-inactive-states) ;; 0 |
[Top]
history | history |
Description
This extension deletes all delta states before the current state to free memory
used to maintain the states in ACIS (but not the operating system). After
calling this extension, it is no longer possible to roll back to any of the
deleted states. This extension returns the number of deleted states.
; roll:delete-previous-states ; Create a solid sphere. (define sphere1 (solid:sphere (position 0 0 0) 10)) ;; sphere1 ; Delete all previous delta states. (roll:delete-previous-states) ;; 0 |
[Top]
history | history |
Description
This extension returns #t if it is possible to roll forward to another state;
otherwise, it returns #f. It is not necessary to call this extension before
invoking the roll extension because that extension automatically checks to make
sure that the specified roll can be performed. This extension helps update the
user interface to reflect whether it is possible to perform a roll operation.
; roll:forward? ; Create a solid sphere. (define sphere1 (solid:sphere (position 0 0 0) 10)) ;; sphere1 (roll:forward?) ; Determine if a roll forward can be performed. ;; #f ; Roll back one state. (roll -1) ;; -1 ; Determine if a roll forward can be performed. (roll:forward?) ;; #t |
[Top]
Description
Returns the state of the internal logging flag, which controls whether
bulletins are created for rollback and error recovery.
; roll:get-logging ; Create a solid block. ; get the current state of the internal logging flag. (roll:get-logging) ;; #t ; shows logging is not active ; turn on internal logging (roll:set-logging #f) ;; #t ; get the current state of the
internal logging flag. ; turn on internal logging ; get the current state of the
internal logging flag. |
[Top]
None |
Description
Use roll:mark-start and roll:mark-end to
group a series of operations as a single operation for rollback. For example,
if a procedure is written to create a rectangle by creating four lines, a roll
back can be inserted to undo the entire rectangle as a single state change.
Insert the following before the line creation:(roll:mark-start) and
the following after creation:(roll:mark-end)
The end marks a block of operations that is treated as a single operation for roll back. Roll to mark-start and roll to mark-end blocks may be nested; in which case, the outermost block is treated as a single operation for roll back. This extension returns the delta state number.
; roll:mark-end ; Mark the beginning of a block of operations. (roll:mark-start) ;; 0 ; Create some test entities. (define sphere1 (solid:sphere (position 0 0 0) 10)) ;; sphere1 (define sphere2 (solid:sphere (position 5 10 20) 10)) ;; sphere2 (define sphere3 (solid:sphere (position 20 0 -5) 10)) ;; sphere3 ; Mark the end of a block of operations. (roll:mark-end) ;; 0 ; Roll back 1 state. (roll) ;; -1 ; All created entities should be gone. ; Roll forward 1 state. (roll 1) ;; 1 ; All created entities should be back. |
[Top]
None |
Description
Use roll:mark-start and roll:mark-end to
group a series of operations as one single a single operation for rollback. For
example, if a procedure is written to create a rectangle by creating four
lines, a rollback can be inserted to undo the entire rectangle as a single
state change. Insert the following before the line creation: Arguments (roll:mark-start)
and the following after creation: (roll:mark-end)
The end marks a block of operations that is treated as a single operation for roll back. Roll to mark-start and roll to mark-end blocks may be nested; in which case, the outermost block is treated as a single operation for roll back. This extension returns the delta state number.
; roll:mark-start ; Mark the beginning of a block of operations. (roll:mark-start) ;; 0 ; Create some test entities. (define sphere1 (solid:sphere (position 0 0 0) 10)) ;; sphere1 (define sphere2 (solid:sphere (position 5 10 20) 10)) ;; sphere2 (define sphere3 (solid:sphere (position 20 0 -5) 10)) ;; sphere3 ; Mark the end of a block of operations. (roll:mark-end) ;; 0 ; Roll back 1 state. (roll) ;; -1 ; All created entities should be gone. ; Roll forward 1 state. (roll 1) ;; 1 ; All created entities should be back. |
[Top]
name | string |
stream | history |
Description
Merges the named delta state with the adjacent one from the side it rolls to.
Prunes history branches, if necessary, to maintain a valid history stream.
; roll:merge-delta-state ; create a block (define b (solid:block (position -10 -10 -10) (position 10 10 10))) ;; b ; lop:offset-body corresponds to 1 delta state (define offset1 (lop:offset-body b -5)) ;; offset1 (define offset2 (lop:offset-body b -3)) ;; offset2 ; Merge the active delta state with the next ; (previous in time) delta state. (roll:merge-delta-state "active") ;; #t ; Since delta states have been merged, rolling back ; one step now is equivalent to rolling back two ; steps before the merge, so the block is restored to ; it's original size. (roll) ;; -1 |
[Top]
id1 | integer |
id2 | integer |
name1 | string |
name2 | string |
stream | history |
prune-partners | boolean |
Description
Merges the range of delta states specified by the id and name arguments (id1,
id2,
name1, and
name2). When names are used, the
string "active" may be used to refer to the active delta states. If one of
these arguments is omitted, the specified state is merged with its next
state. If no names are specified, the active delta state is merged with
its predecessor.
stream
specifies the relevant history stream. If is not defined, it is taken from
the delta states. If no delta states are provided, it is set to the default
stream.
By default, the function fails if the range contains states having partner
states. However, when prune-partners is set to #t, the branches associated
with these partners are pruned.
; roll:merge-delta-states ; Create history default. (define h (history "default")) ;; h (define id0 (history:get-active-state-id h)) ;; id0 ; Create a block. (define b (solid:block 0 0 0 10 10 10)) ;; b (define id1 (history:get-active-state-id h)) ;; id1 ; Blend an edge. (define edges (entity:edges b)) ;; edges (define blend1 (blend:const-rad-on-edge edges 2)) ;; blend1 (define id2 (history:get-active-state-id h)) ;; id2 (define fix (blend:fix (car edges))) ;; fix (define id3 (history:get-active-state-id h)) ;; id3 ; Offset the block. (define offset (lop:offset-body b 1)) ;; offset (define id4 (history:get-active-state-id h)) ;; id4 ; Merge the active state with the state immediately ; following creation of the block. (define merge (roll:merge-delta-states id4 id1)) ;; merge ; Roll takes the part back to the state before block ; creation. (roll) ;; -1 |
[Top]
name-string | string |
history | history |
; roll:name-state ; Create some test entities. (define sphere1 (solid:sphere (position 0 0 0) 10)) ;; sphere1 (define sphere2 (solid:sphere (position 5 10 20) 10)) ;; sphere2 ; Name the current state. (roll:name-state "clock_cr") ;; "clock_cr" (define sphere3 (solid:sphere (position 20 0 -5) 10)) ;; sphere3 ; Roll back to the start of this session. (roll "start") ;; 6 ; All created entities should be gone. ; Roll forward to the named state. (roll "clock_cr") ;; 5 ; Two of the created entities should be back. |
[Top]
name-pattern | string |
history | history |
; roll:named-states ; Create some test entities. (define sphere1 (solid:sphere (position 0 0 0) 10)) ;; sphere1 (define sphere2 (solid:sphere (position 5 10 20) 10)) ;; sphere2 ; Name the current state. (roll:name-state "clock_cr") ;; "clock_cr" (define sphere3 (solid:sphere (position 20 0 -5) 10)) ;; sphere3 ; Roll back to the start of this session. (roll "start") ;; 6 ; List all states with names in the stream ; associated with the active part. (roll:named-states "*") ;; ("clock_cr" "begin") ; roll:set-max-states ; Save only the previous 10 states for undo. (roll:set-max-states 10) ;; 0 |
[Top]
on-off | real |
Description
Sets the global logging flag which controls the creation of bulletin boards.
When logging is turned off, the ability to recover from errors by rolling the
model to the last stable state is also turned off. This routine is intended
only for testing and learning about the behavior of the modeler.
; roll:set-logging ; logging defaults to #t (on) ; verify logging is on. (roll:get-logging) ;; #t ; turn logging off (roll:set-logging #f) ;; #t ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 20 20 20))) ;; block1 ; set the color of block1 to blue (entity:set-color block1 3) ;; () ; attempt a roll command to return block1 to it's ; original color. (roll) ;; -1 ; the roll did not occur. ; clear out all entities (part:clear) ;; #t ; turn logging on (roll:set-logging #t) ;; #f ; Redefine the solid block1 (define block1 (solid:block (position 0 0 0) (position 20 20 20))) ;; block1 ; set the color of block1 (entity:set-color block1 3) ;; () ; attempt a roll command to return block1 to it's ; original color. (roll) ;; -1 ; You should be able to tell the roll completed ; successfully by the block reverting to it's ; original color. (roll:set-logging #f) ;; #t |
[Top]
num | integer |
history | history |
Description
By default, the system maintains all delta states until the states are
explicitly deleted or the system runs out of memory. This extension sets the
number of states to keep. By setting this to a small number, the system uses
less memory, but it is not able to roll back or forward as many operations.
This extension returns the number of states deleted (if any) to satisfy the new
limit.
; roll:set-max-states ; turn on distributed history (part:set-distribution-mode #t) ;; #t (roll:set-max-states 1) ;; 0 ; state should be empty (part:entities) ;; () ; create a block (define block1 (solid:block 0 0 0 10 10 10)) ;; block1 ; state should have 1 block (part:entities) ;; (#[entity 1 1]) ; create second block (define block2 (solid:block 20 20 20 30 25 22)) ;; block2 ; state should have 2 blocks (part:entities) ;; (#[entity 1 1] #[entity 2 1]) ; attempt to roll back one state (roll -1) ;; -1 ; roll forward to state with 2 blocks (roll +1) ;; 1 ; attempt to roll back two states (roll -2) ;; -1 ; only rolled back one state ; should still be one block (part:entities) ;; (#[entity 1 1]) |
[Top]
state-id | integer |
history | history |
; roll:to-state-id ; turn on distributed history (part:set-distribution-mode #t) ;; #t ; create a block (define block1 (solid:block 0 0 0 10 10 10)) ;; block1 (define id (history:get-active-state-id)) ; id ; state should have 1 block (part:entities) ;; (#[entity 1 1]) ; create second block (define block2 (solid:block 20 20 20 30 25 22)) ;; block2 ; state should have 2 blocks (part:entities) ;; (#[entity 1 1] #[entity 2 1]) ; attempt to roll back one state (roll:to-state-id id) ;; 1 ; should be one block (part:entities) ;; (#[entity 1 1]) |
[Top]
on-off | boolean |
; set-timer ; Start the timer. (set-timer #t) ;; "Timer Started" ; Get the elapsed time since the timer was started. (set-timer #f) ;; "Time: 0.000000" |
[Top]
body1 | BODY |
body2 | BODY |
min_clearance | real |
facet_resolution | real |
acis-opts | acis-options |
;solid:check-clerance (part:clear) ;create a solid block (define blk (solid:block 0 0 0 10 10 10)) ;;blk ;create a solid cylinder (define cyl (solid:cylinder (position 15 15 0) (position 15 15 10) 7)) ;;cyl ;check clearance between block and cylinder (solid:check-clearance blk cyl) ;;(#[position 10 10 10] . #[position 10.0502525316942 10.0502525316942 10]) ; OUTPUT Example |
[Top]
duration | integer |
frequency | integer |
Note: Some hardware does not include these functions.
; system:bell ; Sound the system bell. (system:bell 5000 5000) ;; () (system:bell) ;; () |
[Top]
cmd | string |
Description
This extension executes a system command from the Scheme interpreter command
window. The command results, such as the file list from the ls command shown in
the following example, displays in the UNIX window.
; system:command ; Display a file list in the UNIX window. (system:command "ls /") ;; 0 |
[Top]
name-string | string |
; system:getenv ; Get the value of UNIX environment variable. (system:getenv "DISPLAY") ;; #f |
[Top]
None |
; system:name ; Get the system hardware type name. (system:name) ;; "hp700" |
[Top]
filename | string | boolean |
async | integer |
; system:play-sound ; Plays a sound file (system:play-sound "chord.wav") ;; #t |
[Top]
None |
; system:set-timer-off ; Set the timer for 10 seconds then turn it off (system:set-timer-on 10) ;; #t (system:set-timer-off) ;; #t |
[Top]
num-sec | integer |
Description
This extension interrupts an active procedure after a given number of seconds.
On UNIX platforms only the virtual time counts, while on NT the timer counts
the real time.
; system:set-timer-on ; Set the timer for 10 seconds (system:set-timer-on 10) ;; #t |
[Top]
duration | integer |
Description
This extension freezes a view of an object during journal file processing or
loading.
; system:sleep ; Create solid block 1. (define block (solid:block (position 0 0 0) (position 10 10 10))) ;; block ; Execute a system sleep. (system:sleep 5000) ;; 5000 ; The system pauses. ; After the sleep time expires, create solid block 2. (define block2 (solid:block (position 5 5 5) (position 15 15 15))) ;; block2 |
[Top]
None |
Description
This extension returns the system time string as day, month, date, time, and
year.
; system:time-string ; Get the day, month, date, time, and year. (system:time-string) ;; "Mon Apr 7 10:46:43 1997" |
[Top]
msg-string | string |
x | integer |
y | integer |
width | integer |
height | integer |
Description
Displays a message string in an error dialog box. This extension returns #f.
; ui:error-dialog ; Create a user interface error dialog box. (ui:error-dialog "This function cannot be completed.") ; Select the OK button. ;; #f Figure. ui:error-dialog |
[Top]
msg-string | string |
x | integer |
y | integer |
width | integer |
height | integer |
Description
Information messages indicate to the user that a process is occurring, the
status of a process, etc. This extension returns #t.
; ui:info-dialog ;; Create a user interface information dialog box. (ui:info-dialog "Command is being processed. Please Wait.") ; Select the OK button. ;; #t Figure. ui:info-dialog |
[Top]
msg-string | string |
; ui:prompt ; Create a user interface prompt on the command line. (ui:prompt "Select two positions.") ;; Select two positions. ;; () |
[Top]
msg-string | string |
x | integer |
y | integer |
width | integer |
height | integer |
Description
Displays a message string in a warning dialog box.
; ui:warning-dialog ; Create a user interface warning dialog box. (ui:warning-dialog "If you continue the data may be lost.") ; Select the Cancel button. ;; #f Figure. ui:warning-dialog |
[Top]
msg-string | string |
title-string | string |
x | integer |
y | integer |
width | integer |
height | integer |
Description
Displays a message string in a yes/no dialog box.
; ui:yesno-dialog ; Create a user interface yes/no dialog box. (ui:yesno-dialog "Do you want to save the part?" "ACIS for More Fun") ; Select the No button. ;; #f Figure. ui:yesno-dialog |
[Top]
None |
; versionid ; Get the current version of the executable. (versionid) ;; "Acis version 8.0 (ag1.51): for HP-UX B.10.20 ;; generated Fri Mar 1 15:09:00 2002" |
[Top]
view | view |
; view:bg-color ; Define a view. (define view1 (view:dl 0 0 100 100)) ;; view1 ; Get the background color of a view. (view:bg-color view1) ;; #[color 0 0 0] |
[Top]
view | view |
Description
Cleans all drawings from the specified window. The objects depicted are not
destroyed. The visual representation may be refreshed using
view:refresh. If the view
is associated with a file, a "new page" instruction is written to the file.
; view:clear ; Define a named view. (define view (view:dl)) ;; view ; Create a solid block that appears in both views. (define block1 (solid:block (position -10 -10 -10) (position 5 10 15))) ;; block1 ; Clear the active view. (view:clear) ;; #[view 1075533160] ; Clear the named view. (view:clear view) ;; #[view 1075519936] |
[Top]
view | view |
Description
Deletes the specified view. This involves not only removing the associated
window from the computer screen, but also deleting all mention of the view from
the list returned by
env:views.
; view:delete ; Create a new view. (define view1 (view:dl)) ;; view1 ; Delete the new view. (view:delete view1) ;; () |
[Top]
disp | boolean |
Description
Displays the existing facets when the input value is TRUE. Entities will not be
automatically faceted. Only those entities that currently have facets will have
facets displayed.
; view:display-facets ; open a dl view (define v (view:dl)) ;; v ; create a sphere (define s (solid:sphere 0 0 0 10)) ;; s ; zoom to fill screen (zoom-all) ;; #[view 2755404] (entity:facet s) ;; 698 (view:display-facets #t) ;; facets are shown (view:display-facets #f) ;; facets are not shown |
[Top]
disp | boolean |
Description
Displays the parameter lines when the input value is TRUE.
; view:display-param-lines ; open a dl view (define v (view:dl)) ;; v ; create a sphere (define s (solid:sphere 0 0 0 10)) ;; s ; isometric view (iso) ;; #[view 789352] ; zoom to fill screen (zoom-all) ;; #[view 789352] (view:display-param-lines #t) ;; parameter lines are shown (view:display-param-lines #f) ;; parameter lines are not shown |
[Top]
disp | boolean |
Description
Displays the surface polygons when the input value is FALSE.
; view:display-surface-polys ; open a dl view (define v (view:dl)) ;; v ; create a blended block (define b (solid:block 0 0 0 10 10 10)) ;; b (define e (car (entity:edges b))) ; isometric view (iso) ;; #[view 526362] ; zoom to fill screen (zoom-all) ;; #[view 526362] ;; e (entity:set-color e RED) ;; () ;; edge turns red (define bl (blend:var-rad-on-edge e 2 3)) ;; bl (blend:fix e) ;; #t (view:display-surface-polys #f) ;; () (render:rebuild) ;; () ;; surface polygons are shown (view:display-surface-polys #t) ;; () (render:rebuild) ;; () ;;surface polygons are not shown |
[Top]
position | position |
view | view |
Description
Draws a temporary representation of a point in the view. As soon as the view is
refreshed, the temporary point representation goes away.
; view:draw-point ; Draw temporary point 1. (view:draw-point (position 6 6 6)) ;; () ; Draw temporary point 2. (view:draw-point (position -10 -10 -10)) ;; () ; Clear the view. (view:refresh) ;; #[view 1075915864] |
[Top]
position-list | position | (position ...) |
fill | boolean |
view | view |
Description
Draws a temporary polyline in the active view or the specified view. As soon as
that view is refreshed, polyline representation goes away.
; view:draw-polyline ; Draw a temporary polyline to a view. (define line1 (view:draw-polyline (list (position 3 3 3) (position 6 6 6) (position -10 -10 -10)))) ;; line1 ; Define a new view. (define view1 (view:draw-polyline (list (position 3 3 3) (position 6 6 6) (position -10 -10 -10)))) ;; view1 ; Draw another polyline with fill to a specific view. (define line2 (view:draw-polyline (list (position 3 3 3) (position -10 -10 -10) (position 40 -10 20) #t view1))) ;; line2 ; Clear the view. (view:refresh) ;; #[view 1075907056] |
[Top]
position | position |
string | string |
view | view |
Description
Draws a temporary text string in the specified view or active view. As soon as
that view is refreshed, input text goes away.
; view:draw-text ; Draw temporary text to the current view. (view:draw-text (position 0 0 0) "rectangle 1") ;; () ; Draw temporary text. (view:draw-text (position 0 25 0) "sphere") ;; () ; Clear the view. (view:refresh) ;; #[view 1075907056] |
[Top]
view | view |
Description
Retrieves the eye position for the specified view, or the active view.
; view:eye ; Create a block. (define block1 (solid:block (position 5 5 5) (position 15 15 15))) ;; block1 ; Determine the eye point. (view:eye) ;; #[position 100 -200 100] ; Set a new eye position. (view:set-eye (position 50 -100 50)) ;; #[position 100 -200 100] ; Refresh to see the block ; from the new eye position. (view:refresh) ;; #[view 1076014304] ; Determine the new eye position. (view:eye) ;; #[position 50 -100 50] |
[Top]
u_min | double |
u_max | double |
v_min | double |
v_max | double |
nu | integer |
nv | integer |
factor | double |
(part:clear) (view:dl) (define e (edge:spline (list (position 0 0 0)(position 1 1 0)(position 2 0 0)(position 3 1 0)))) (define s (sweep:law e (gvector 0 0 1))) (iso) (zoom-all) (define f (list-ref (entity:faces s)0)) (surface:domain f) (view:face-hedgehog f 'uv -2 -1 0.12 .5 'nuv 15 15 'scale 0.1) (view:face-hedgehog f 'vec 1 'uv -3 -2 0 .12 'nuv 15 15 'scale 0.1) (view:face-hedgehog f 'vec 2 'uv -1 0 0.1 .5 'nuv 15 15 'scale 0.1) (view:face-hedgehog f 'vec 3 'uv -4 -3 0 1 'nuv 15 15 'scale 0.1) (view:hedgehog-clear) |
[Top]
on-off | boolean |
; view:face-normals ; Define a view. (define view1 (view:gl)) ;; view1 ; Define a block (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 ; Define a cylinder. (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Parameter lines are turned on. (view:face-normals #t) ;; () ; The parameter lines of the model should be visible. ; Verify that normals are turned on. (view:face-normals?) ;; #t |
[Top]
None |
; view:face-normals ; Define a view. (define view1 (view:gl)) ;; view1 ; Define a block (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 ; Define a cylinder. (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Parameter lines are turned on. (view:face-normals #t) ;; () ; The parameter lines of the model should be visible. ; Verify that normals are turned on. (view:face-normals?) ;; #t |
[Top]
on-off | boolean |
; view:facet-vertex-normals ; Define a view. (define view1 (view:gl)) ;; view1 ; Define a block (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 ; Define a cylinder. (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Parameter lines are turned on. (view:facet-vertex-normals #t) ;; () ; The parameter lines of the model should be visible. ; Verify that facets are turned on. (view:facet-vertex-normals?) ;; #t |
[Top]
None |
; view:facet-vertex-normals? ; Define a view. (define view1 (view:gl)) ;; view1 ; Define a block (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 ; Define a cylinder. (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Parameter lines are turned on. (view:facet-vertex-normals #t) ;; () ; The parameter lines of the model should be visible. ; Verify that facets are turned on. (view:facet-vertex-normals?) ;; #t |
[Top]
view | view |
; view:fg-color ; Define a new view. (define view1 (view:dl)) ;; view1 ; Get the foreground color in view. (view:fg-color view1) ;; #[color 1 1 1] |
[Top]
view | view |
Description
This extension returns the handle for a view window as an integer.
; view:handle ; Define a new view. (define view1 (view:dl)) ;; view1 ; Get the window handle for view. (view:handle view1) ;; 1075958424 ; You can delete the view if all you know is ; the window handle. (view:delete (view:with-handle 1075958424)) ;; () |
[Top]
view | view |
Description
The view height in conjunction with the viewport height determines the scale of
the representation. If the view height is doubled, for example, while the
dimensions of the viewport remain unchanged, then the images in the view window
will shrink to half size.
; view:height ; Define a new view. (define view1 (view:dl)) ;; view1 ; Get the height of view. (view:height view1) ;; 100 |
[Top]
view | view |
Description
This returns the hither clipping distance. A view's hither plane is a plane
perpendicular to the view's line of sight. Objects located on the same side of
the hither plane as the eye position are invisible; they are not pictured in
the view. The distance along the line of sight from the eye position to its
hither plane is the hither clipping distance. The default hither clipping
distance is 0.025.
Hither and yon settings are very useful for perspective views or for views
where the eye point is inside of the object. Establish clipping such that it
clips out everything behind the eye point. It can also be used to clip out
foreground and backgrounds objects.
; view:hither ; Define a new view. (define view1 (view:dl)) ;; view1 ; Set the view's hither clip distance. (view:set-hither .03 view1) ;; #[view 1076057640] ; Get the hither clipping plane for view. (view:hither view1) ;; 0.03 |
[Top]
view | view |
Description
This extension returns the unitized gvector from the view target to the view
eye position. This vector is always perpendicular to the screen. However, its
relationship to the model is determined by this command.
; view:out ; Get the out vector for a view. (view:out) ;; #[gvector 0.408248290463863 -0.816496580927726 ;; 0.408248290463863] |
[Top]
view | view |
Description
Determines if perspective is on for a view. If the output is #t, the view uses
the perspective mode; if it is #f, the view uses orthographic projection mode.
; view:perspective? ; Create a new view called view. (define view1 (view:dl)) ;; view1 ; Determine if the current view ; is a perspective view. (view:perspective?) ;; #f ; Make view a perspective view. (view:set-perspective #t view1) ;; #f ; Determine if view is a perspective view. (view:perspective? view1) ;; #t |
[Top]
view | view |
Description
This extension returns the unitized gvector that points toward the right side
of the view. This corresponds to the x-axis of the view coordinate
system. The gvectors returned from the operations view:out,
view:right, and view:up form a right-handed
ortho-normal triple. Each is the cross-product of the other two. The
view:out vector is always perpendicular to the screen. After
the model has been reoriented, this command determines the x-axis
relationship to the model.
; view:right ; Get the right vector for a view. (view:right) ;; #[gvector 0.894427190999916 0.447213595499958 0] |
[Top]
eye-position | position |
target-position | position |
up-direction | gvector |
view | view |
; view:set ; Create a block. (define block1 (solid:block (position 0 0 0) (position 35 35 35))) ;; block1 ; Define a new view. (define view1 (view:dl)) ;; view1 ; Set a view's eye position, target position, ; and up vector. (view:set (position 200 -400 200) (position 0 0 0) (gvector 1 0 0) view1) ;; #[view 1075533160] ; Refresh the view. (view:refresh view1) ;; #[view 1075533160] |
[Top]
color | integer | color |
view | view |
; view:set-bg-color ; Define a new view. (define view1 (view:dl)) ;; view1 ; Set the background color to magenta for the ; view using a color integer. (view:set-bg-color 6 view1) ;; #[view 1075519376] ; Set the background color to light pink for the ; current view using an rgb value. (view:set-bg-color (color:rgb 0.9 0.45 0.7)) ;; #[view 41943045] |
[Top]
hither | real |
yon | real |
view | view |
; view:set-clipping ; Create a solid block for viewing. (define block1 (solid:block (position 10 10 10) (position -10 40 30))) ;; block1 ; OUTPUT Original ; Set a view's hither and yon clipping planes. (view:set-clipping 10 250) ;; #[view 1075519376] (view:refresh) ;; #[view 1075915640] ; OUTPUT Result Figure. view:set-clipping |
[Top]
mode | integer |
view | view |
Description
Sets the drawing mode for the wireframe representation of entities and the
depiction of temporary points and polylines.
; view:set-draw-mode ; Define a new view. (define view1 (view:dl)) ;; view1 ; Create a solid block. (define block1 (solid:block (position -10 -5 0) (position 10 8 6))) ;; block1 ; Create a polyline to see the difference. (view:draw-polyline (list (position -10 -10 -10) (position 2 2 2) (position 10 2 2) (position -10 2 2)) #t view1) ;; () ; Set the drawing mode of a view to exclusive or. (view:set-draw-mode 2 view1) ;; #[view 1075519376] ; Refresh the view. (view:refresh view1) ;; #[view 1075533160] (view:set-draw-mode 1 view1) ;; #[view 1075519376] ; Refresh the view. (view:refresh view1) ;; #[view 1075533160] |
[Top]
eye-position | position |
view | view |
; view:set-eye ; Define a new view. (define view1 (view:dl)) ;; view1 ; Create a solid block. (define block1 (solid:block (position -10 -5 0) (position 10 8 6))) ;; block1 ; Set the eye position of the new view. (view:set-eye (position 15 -20 0) view1) ;; #[position 0 0 500] ; Refresh the view. (view:refresh view1) ;; #[view 1075533160] ; Get the eye position of the new view. (view:eye view1) ;; #[position 15 -20 0] |
[Top]
color | color |
view | view |
; view:set-fg-color ; Define a new view. (define view1 (view:dl)) ;; view1 ; Set the foreground color to magenta. (view:set-fg-color 6 view1) ;; #[view 1075519376] ; Create something to be displayed in color. (view:draw-text (position 0 0 0) "howdy" view1) ;; () |
[Top]
font-string | string |
view | view |
; view:set-font ; Define a new view. (define view1 (view:dl)) ;; view1 ; Set the text font for a view. (view:set-font "helvetica" view1) ;; #[view 1075533160] ; Draw text in that font. (view:draw-text (position 0 0 0) "helvetica font appears" view1) ;; () |
[Top]
size | real |
view | view |
; view:set-font-size ; Define a new view. (define view (view:dl)) ;; view ; Sets the text font size for a view. (view:set-font-size 14 view) ;; #[view 1075519376] ; Draw text in that font. (view:draw-text (position 0 0 0) "font size 14" view) ;; () |
[Top]
hither | real |
view | view |
Description
This extension sets the hither clip distance from the active view unless the
optional argument view is specified. A view's hither plane is a plane
perpendicular to the view's line of sight. Objects located on the same side of
the hither plane as the eye position are invisible; they are not pictured in
the view. The distance along the line of sight from the eye position to its
hither plane is the hither clipping distance. The default hither clipping
distance is 0.025.
; view:set-hither ; Get the hither clip distance. (view:hither) ;; 0.025 (define block1 (solid:block (position -30 -30 -30) (position 20 50 20))) ;; block1 ; OUTPUT Original ; Set the hither clip distance. (view:set-hither 220) ;; #[view 1075519376] (view:refresh) ;; #[view 1075519376] ; OUTPUT Result Figure. view:set-hither |
[Top]
style-string | string |
view | view |
Description
Sets the line style for temporary lines in a view.
; view:set-line-style ; Define a new view. (define view1 (view:dl)) ;; view1 ; Set the line style for view. (view:set-line-style "." view1) ;; #[view 1075419376] (view:draw-polyline (list (position 0 0 0) (position 10 10 10)) view1) ;; () |
[Top]
size | integer |
view | view |
; view:set-line-width ; Set the size of temporary lines for a view. (view:set-line-width 5) ;; #[view 1075519376] (view:draw-polyline (list (position 0 0 0) (position 10 10 10))) ;; () |
[Top]
persp-orth | boolean |
view | view |
; view:set-perspective ; Determine if perspective is on. (view:perspective?) ;; #f ; Create a block. (define block1 (solid:block (position -30 -30 -30) (position 20 50 20))) ;; block1 ; OUTPUT Original ; Set the perspective mode on for a view. (view:set-perspective #t) ;; #f (view:refresh) ;; #[view 1076139208] ; Set the orthographic mode on for a view. (view:set-perspective #f) ;; #t (view:refresh) ;; #[view 1076139208] ; OUTPUT Result Figure. view:set-perspective |
[Top]
size | integer |
view | view |
; view:set-point-size ; Set the point style. (view:set-point-style "o") ;; #[view 1075533160] ; Draw a point. (view:draw-point (position 3 6 8)) ;; () ; Set the size of temporary points. (view:set-point-size 20) ;; #[view 1075519376] ; Draw a second point in the same position. (view:draw-point (position 3 6 8)) ;; () |
[Top]
style-string | string |
view | view |
; view:set-point-style ; Set the style for temporary points. (view:set-point-style "+") ;; #[view 1075533160] ; Draw a point. (view:draw-point (position 3 6 8)) ;; () |
[Top]
on-off | boolean |
view | view |
; view:set-rb-mode ; Define a new view. (define view (view:dl)) ;; view ; Set the rubberbanding mode for view. (view:set-rb-mode #f view) ;; #[view 1075519376] ; Another example. (define rbd:line2 (lambda (boo1 . init-pos) (let* ((pos1 (if (null? init-pos) (wcs:origin) (car init-pos))) (pos2 #f) (draw (lambda () (view:set-rb-mode #t) (view:draw-polyline (list pos1 pos2)) (view:set-rb-mode #f)))) (rbd:scheme bool (vector ; init-hook ' () ; start-hook (lambda (self evt) (set! pos2 (pick:position evt)) (draw)) ; update-hook (lambda (self evt) (draw)) (set! pos2 (pick:position evt)) (draw)) ; stop-hook (lambda (self) (draw)) ; repaint-hook (lambda (self view) (draw)) ; position-hook '() ; end-hook '()))))) ;; rbd:line2 |
[Top]
width | real |
height | real |
view | view |
; view:set-size ; Define a WCS. (define wcs (wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))) ;; wcs ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 35 35 35))) ;; block1 ; Set the size of the view. (view:set-size 300 500) ;; #[view 1075533160] ; Refresh the view. (view:refresh) ;; #[view 41943045] ; OUTPUT Original ; Set the size of the view. (view:set-size 100 200) ;; #[view 1075533160] ; Refresh the view. (view:refresh) ;; #[view 41943045] ; OUTPUT Result Figure. view:set-size ; Another example where the size of the view; and viewport are changed before an output image ; is made. ; Define a new view. (define view2 (view:dl 100 200)) ;; view2 ; This queries the current view size. Then ; it resizes the viewport. Then it makes the ; object appear smaller by changing the width ; and height parameter of the view. (let ((w (view:width view2))) (view:set-viewport 0 0 300 300 view2) (view:set-size (* w 2) (* w 2) view2)) ;; #[view 109820984] ; Refresh the view to see the changes (view:refresh view2) ;; #[view 109829897] |
[Top]
target-position | position |
view | view |
; view:set-target ; Define a new view. (define view (view:dl)) ;; view (view:target view) ;; #[position 0 0 0] ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 20 20 20))) ;; block1 ; Set the target position for a view. (view:set-target (position 0 40 0) view) ;; #[position 0 0 0] ; Refresh the view. (view:refresh) ;; #[view 1075533160] ; Get the target position of the new view. (view:target view) ;; #[position 0 40 0] |
[Top]
name-string | string |
view | view |
; view:set-title ; Define a new view. (define view (view:dl)) ;; view ; Set the title of a view. (view:set-title "Working View" view) ;; #[view 1075533160] ; "Working View" appears as the title of the view. |
[Top]
up-direction | gvector |
view | view |
Description
Sets the up vector for a view.
; view:set-up ; Set a view's up vector. (define view1 (view:dl)) ;; view1 (view:set-up (gvector 0 0 1) view1) ;; #[gvector 0 1 0] (view:refresh view1) ;; #[view 1075900736] |
[Top]
org-x | integer |
org-y | integer |
width | integer |
height | integer |
view | view |
; view:set-viewport ; Define a new view. (define view1 (view:dl)) ;; view1 ; Set the viewport for a view. (view:set-viewport) ;; #[view 1075533160] (view:set-viewport 0 0 100 100) ;; #[view 1075533160] ; Another example where the size of the view ; and viewport are changed before an output image ; is made. ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 20 20 20))) ;; block1 ; Define a new view. (define view2 (view:dl 100 200)) ;; view2 ; This queries the current view size. Then ; it resizes the viewport. Then it makes the ; object appear smaller by changing the width ; and height parameter of the view. (let ((w (view:width view2))) (view:set-viewport 0 0 300 300 view2) (view:set-size (* w 2) (* w 2) view2)) ;; #[view 109820984] ; Refresh the view to see the changes (view:refresh view2) ;; #[view 109829897] |
[Top]
yon | real |
view | view |
; view:set-yon ; Get the yon clip distance. (view:yon) ;; 10000 (define block1 (solid:block (position -30 -30 -30) (position 20 50 20))) ;; block1 ; Set the yon clipping distance. (view:set-yon 250) ;; #[view 1075519376] (view:refresh) ;; #[view 1075519376] |
[Top]
view | view |
Description
Gets the target position of a view. The argument target-position specifies the
target location of the view. The target position needs to be different from the
eye position. The resulting vector from the target to the eye position cannot
be parallel to the up gvector.
; view:target ; Get the target position of a view. (define view (view:dl)) ;; view (view:target view) ;; #[position 0 0 0] |
[Top]
view | view |
Description
This extension returns the unitized gvector that points toward the top side of
the view. This corresponds to the y-axis of the view coordinate system.
The gvectors returned from the operations view:out,
view:right, and view:up form a
right-handed ortho-normal triple. Each is the cross-product of the other two.
The view:out vector is always perpendicular to the screen. After the
model has been reoriented, this command determines the y-axis
relationship to the model.
; view:up ; Get the up vector for a view. (define view (view:dl)) ;; view (view:up view) ;; #[gvector 0 1 0] |
[Top]
view | view |
Description
This extension returns a list of four integers: origin-x, origin-y, width, and
height. The first two specify the location of the upper left-hand corner of the
viewport relative to the top left corner of the associated window. The last two
specify the size in pixels (width and height) from that initial point.
; view:viewport ; Get the viewport for a view. (define view1 (view:dl)) ;; view1 (view:viewport view1) ;; (0 0 600 600) |
[Top]
view | view |
Description
Specifies the width in pixels of the viewport from the viewports starting
corner.
; view:width ; Get the width of a view. (define view1 (view:dl)) ;; view1 (view:width view1) ;; 100 |
[Top]
handle | integer |
; view:with-handle ; create several windows and spread them out to make ; them all visible on screen. (view:gl) ;; #[view 160891358] (view:gl) ;; #[view 11076370] ; You now have 2 dl and 2 gl views displayed. ; find the active view. (env:active-view) ;; #[view 16122558] ; delete the first gl view created. (view:delete (view:with-handle 160891358)) ;; () |
[Top]
view | view |
Description
Returns the yon clipping distance. Yon specifies the far distance, which must
be greater than the hither distance. Any item farther away from the eye than
the yon distance is clipped. Hither specifies the near distance and must be
greater than 0. Any item closer to the eye than the hither distance is clipped.
; view:yon ; Get the yon clipping plane for a view. (define view1 (view:dl)) ;; view1 (view:yon) ;; 10000 |
[Top]
object | scheme-object |
; view? ; Create a new view. (define view1 (view:dl)) ;; view1 ; Determine if the new view is actually a view. (view? view1) ;; #t (view? (position 10 20 30)) ;; #f |
[Top]
object | scheme-object |
; void? ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 0 0 0))) ;; block1 ; Determine if the solid block is void. (void? block1) ;; #f |
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.