<<< Miscellaneous Useful Functions | Chapters | Attributes in KID >>> |
This chapter describes the enquiries available in KID.
enquire
function is applicable to points, curves, surfaces, vertices, edges and faces. The function can be used to print out either all available information or just specific details about the geometry of the item. For instance, assuming c1 ( a curve), f1 ( a face) and a1 ( an assembly) have already been picked:
> (c1 enquire) > (f1 enquire) > (a1 enquire) |
This prints out information about the geometry of the item on the screen.
In addition, for assemblies of only one layer of substructure, a statement to that effect and the number of sheet and solid bodies the assembly consists of are printed out.
To convert an "unlevelled" assembly to a single layer assembly, type:
> ( a1 level ) |
Other enquiries on an assembly are:
> ( a1 instances ) -- a list of the first layer of instances > ( a1 bodies ) -- a list of the first layer of bodies > ( a1 transforms ) -- a list of the first layer of transform tags |
It is also possible to get more specific information from the enquire function. An argument identifying the type of information required is given to the
enquire
function, and the function thens return the value of the information, or
nil
if it is not found.
Assuming c1 is a circular curve:
> (c1 enquire ´point) -->(0 0 0) > (c1 enquire ´direction) -->(0 0 1) > (c1 enquire ´radius) --> 42 > (c1 enquire ´maj_axis) --> nil > (c1 enquire ´type) --> circle |
If a primitive is created, or if an object has been picked from the screen, it has a property which contains the value of the kernel tag which represents the item. KID uses this when it calls the KI / PK. It is possible to access the value of the tag, or to set it to a particular value. For instance, if it is known that tag 99 refers to a face, the following creates an object which may then be manipulated by KID:
> (define f1 face) > (f1 tag 99) -- set tag property to 99 > (f1 enquire) --> information > (f1 tag) --> gives tag value 99 |
It may prove useful to manipulate tag values in this way to perform operations which are not possible with the normal KID functions.
Some KID functions result in the tag property of an entity having a LISP list of tags. An example of this is the function
pick_from
. It is often possible to manipulate an object with a list of tags using the same functions as if it had a single tag. This facility is not provided by all KID functions.
This form of the
enquire
function can be used to construct complex functions where the geometry of one surface is used to define the size of another.
The argument type can be used to select specific curve or surface types, which are named as follows:
Use of the
enquire
function within the pick facility using type is described in the section "Picking directly from other objects" in Chapter 14, "Picking".
A convenient way of accessing the KI routine IDCOEN for topological entities is:
> ( b0 faces ) -- returning a list of b0´s (body) faces > ( f0 edges ) -- returning a list of f0´s (face) edges > ( a0 bodies ) -- returning a list of a0´s (assembly) bodies |
The function box returns two vectors defining the extremes of a minimal rectangular box aligned with the axis system, and enclosing the single topology item, or list of topology items of the same type. This is true for assemblies, bodies, faces, edges and vertices. For a single vertex point, the box extremes are identical.
Function clash provides a means of testing whether a supplied point is contained in, on or outside a body, face, edge or vertex. Clash uses the KI routine ENCONT.
<<< Miscellaneous Useful Functions | Chapters | Attributes in KID >>> |