void me_change_global_info(oldinfo,newinfo)
char *oldinfo;
char *newinfo;
void me_delete_global_infolist(infolist)
struct strlist *infolist;
struct strlist *me_get_elem_infolist(elem,infolist)
struct elem2d *elem;
struct strlist **infolist;
void me_add_elem_infolist(elem,infolist)
struct elem2d *elem;
struct strlist *infolist;
void me_change_elem_info(elem,oldinfo,newinfo)
struct elem2d *elem;
char *oldinfo;
char *newinfo;
void me_delete_elem_infolist(elem,infolist)
struct elem2d *elem;
struct strlist *infolist;
struct strlist *me_get_curr_infolist(infolist)
struct strlist **infolist;
void me_add_curr_infolist(infolist)
struct strlist *infolist;
void me_change_curr_info(oldinfo,newinfo)
char *oldinfo;
char *newinfo;
void me_delete_curr_infolist(infolist)
struct strlist *infolist;
The current infolist is an additional list of infostrings. Its infostrings will be attached to all newly created elements. This list is independent of the global infolist.
Most of the AI functions for associated texts operate on lists of infostrings rather than on single strings. For such stringlists, we use the data type
struct strlist { struct strlist *nxt; char *str; }
Please note that this list type is different from the "normal" AI list data type.
me_get_global_infolist gets the list of all infostrings attached to any existing 2D elements. The global infolist is returned as a function result and by the parameter infolist.
me_change_global_info changes the infostring oldinfo in the global infolist into newinfo. The change is done automatically for the infolists of all elements referring to the associated text oldinfo.
me_delete_global_infolist deletes all infostrings of infolist from the global infolist in the global infolist. The deletion is done automatically for the infolists of all elements referring to the associated texts in infolist.
me_get_elem_infolist gets the list of all infostrings attached to the element elem. The element's infolist is returned as a function result and by the parameter infolist.
me_add_elem_infolist adds the infostrings from infolist to the infolist of elem. Each infostring is added automatically to the global infolist as well if it has not yet been contained in it.
me_change_elem_info changes the infostring oldinfo in the infolist of elem into newinfo. If elem was the only element to refer oldinfo, then this infostring will be removed automatically from the global infolist as well. If newinfo has not yet been contained in the global infolist it will automatically be added to the global infolist.
me_delete_elem_infolist deletes all infostrings of infolist from the infolist of elem. If elem was the only element to refer any of the strings in infolist, then this infostring will be removed automatically from the global infolist as well.
me_get_curr_infolist gets the list of all current infostrings that will be attached to all newly created 2D elements. The current infolist is returned as a function result and by the parameter infolist.
me_add_curr_infolist adds the infostrings from infolist to the current infolist.
me_change_curr_info changes the infostring oldinfo in the current infolist into newinfo.
me_delete_curr_infolist deletes all infostrings of infolist from the current infolist.
void me_get_curr_catch_info(catch_info)
struct catch_info *catch_info;
int me_catch2d(pnt)
struct fvec3 *pnt;
extern struct catch_result me_last_catch_result;
The current catch settings can be accessed by me_get_curr_catch_info. They can be defined or changed by me_set_curr_catch_info and are described by a struct catch_info which contains the following fields:
float64 model_catch_range;
int32 pixel_catch_range;
int32 catch_mode;
int permanent;
catch_mode describes the catch mode which is applied for catching to elements and can have one of the following values:
CATCH_NOTHING CATCH_VERTEX_2D CATCH_ELEMENT CATCH_INTERSECTION CATCH_CENTER CATCH_GRID CATCH_ALL
CATCH_NOTHING turns catching off. The decision point pnt must be exactly on the element.
CATCH_VERTEX_2D is used to catch to vertices of elements.
CATCH_ELEMENT searches for elements in the given range.
CATCH_INTERSECTION looks only for intersections of elements.
CATCH_CENTER can be applied to circular elements and returns the element and the center point of such elements.
CATCH_GRID catches to an active grid raster.
CATCH_ALL applies the following catch mode in the given order:
CATCH_VERTEX_2D CATCH_INTERSECTION CATCH_GRID CATCH_ELEMENT
permanent:
If permanent is true the catch mode is not changed to CATCH_ALL after a successful call of me_catch2d.
pixel_catch_range:
This number gives the catch range in pixels for all catching by picking in graphical ports.
model_catch_range:
The model_catch_range gives the catch range in world units for values entered via the keyboard or given by macros.
Additional information about the results of a successful catching are placed in a struct catch_result with the name me_last_catch_result.
This struct contains the following fields:
int catch_mode; struct fvec3 pnt_in; struct fvec3 pnt_out; struct mp *mp; struct elem2d *element1; struct elem2d *element2;
catch_mode:
Contains that catch mode which was last applied to find an element.
pnt_in, pnt_out:
Contains the original input point pnt_in given to me_catch2d and the corrected point pnt_out.
mp:
Contains the pointer to a model point found during the last catching.
element1, element2:
element1 and/or element2 contains the pointers to elements which were found during the catching.
int changed = *me_color_ptr & COLOR_CHANGED;
To get only the color information out of an int32 color value,
color & COLOR_MASK can be used.
The following explicit color definitions are provided:
BLACK
RED
GREEN
YELLOW
BLUE
MAGENTA
CYAN
WHITE
The following me_color_xxx variables contain the current color values which are used for creating new elements that belong to the group xxx. These values can also be changed directly.
me_color_geo contains the current geometry color.
me_color_hatch contains the current hatch color.
me_color_text contains the current text color.
me_set_length_unit, me_set_angle_unit.
me_set_length_unit(unit,factor)
int unit;
float64 factor;
me_set_angle_unit(unit,factor)
int unit;
float64 factor;
me_angle_per_rad
Is the ratio of the ME10 user angle units to angle units in radians used on the AI level.
me_world_cs
Is a Cartesian coordinate system with the length unit millimeter.
me_2d_user_cs
Is the coordinate system for user in/output. It is set relative to the "me_2d_basis_cs". (it is set on ME10 user level by functions like cs_ref_pt , cs_axis, cs_rotate ...)
me_model2d_cs
Is the coordinate system of the top part of the 2D model.
me_curr_part_cs
me_set_length_unit, me_set_angle_unit
Sets the length/angle units of the basis coordinate system (like ME10 units function). The parameter factor can be used to create new units, if it is set to a value not equal to 1.0.
The angle units can have the values :
ANG_DEG (degrees) ANG_GRD (grads) ANG_RAD (radians)
The length units can have the values :
LEN_CM LEN_M LEN_KM LEN_MM LEN_UM LEN_INCH LEN_FOOT LEN_YARD LEN_MILES LEN_MILS LEN_UINCH
Is the coordinate system of the currently active part (ME10 edit_part command).
int32 me_get_elem_set_point()
int32 me_get_elem_set_line()
int32 me_get_elem_set_arc()
int32 me_get_elem_set_fillet()
int32 me_get_elem_set_circle()
int32 me_get_elem_set_spline()
int32 me_get_elem_set_bspline()
int32 me_get_elem_set_text()
int32 me_get_elem_set_contour()
int32 me_get_elem_set_face()
int32 me_get_elem_set_part()
int32 me_get_elem_set_all()
void me_set_elem2d_attr(elem,elem2d_attr)
struct elem2d *elem;
struct elem2d_attr *elem2d_attr;
void me_get_elem2d_attr(elem,elem2d_attr)
struct elem2d *elem;
struct elem2d_attr *elem2d_attr;
void me_draw_elem(elem, gports, draw_mode)
struct elem2d *elem;
int16 gports;
int draw_mode;
void me_delete_elem_2d(elem)
struct elem2d *elem;
struct fbox3 *me_get_elem_box(elem,elem_box)
struct elem2d *elem;
struct fbox3 *elem_box;
Each element contains attributes, in particular color and linetype which could be set by me_set_elem2d_attr and inquired by me_get_elem2d_attr. The input and output parameter of these functions is a pointer to struct elem2d_attr which contains pointers to the color, linetype, and linewidth.
The reason for using pointer in the struct is to support the using of me_color_ptr, me_linetype_ptr, me_linewidth_ptr to receive the changing of color, linetype, and linewidth settings with the interactive color and linetype functions, and linewidth commands.
me_draw_elem draws the element elem in the gports given by gports with draw mode draw_mode. The draw mode could be DRAW_MODE_NORMAL, DRAW_MODE_ERASE, DRAW_MODE_HIGHLIGHT and DRAW_MODE_UNHIGHLIGHT.
me_delete_elem_2d deletes the element elem out of the data structure including any model point references.
me_get_elem_box calculates the box elem_box that contains the given element elem.
int me_unsubscribe_event(event_list,fnc)
struct list_node **event_list;
void (*fnc)();
me_subscribe_event
The function fnc is added to the end of the event list specified by event_list.
If the routine returns ME_OK the given function has been added to the end of the specified event list. If ME_DUPLICATE_FUNCTION is returned, the function is already in the event list, and the function is not added to the event list in this case.
me_unsubscribe_event
The function fnc is removed from the event list specified by event_list
If the routine returns ME_OK, the function has been successfully removed. If it returns ME_FUNCTION_NOT_FOUND, the function could not be found in the specified event list, and hence has not been removed.
void ME_ESCAPE(exception_code)
int32 exception_code;
The macro ME_ESCAPE allows the programmatic generation of longjumps.
When ME_TRY is executed, certain information about the state of the program is recorded in a marker called the 'environment', which is pushed on the program's stack. The address of the environment is saved in the global variable 'me_env_ptr', then the statements following the ME_TRY are executed in sequence. If none of them causes an exception, the ME_RECOVERY is reached, its statements are skipped, and the environment is popped off the stack.
But if an exception occurs (i.e. signal received, math error occurred, or ME_ESCAPE executed), the stack is restored to the state indicated by the most recent environment. If ME_TRY - ME_RECOVERY - ME_END_TRY was itself nested within another one, or within procedures called while a ME_TRY - ME_RECOVERY - ME_END_TRY was active then the embracing outer environment becomes active. Then the statements following ME_RECOVERY are executed. Thus nesting of ME_TRY - ME_RECOVERY - ME_END_TRY is DYNAMIC, according to calling sequence, not statically structured.
The macros ME_TRY, ME_RECOVERY, and ME_END_TRY are based on calls of setjump. Be careful if you use setjump or these macros together with global optimization switched on during compilation. Due to global optimization, non-volatile variables may have been overwritten if the RECOVER block is entered (by a longjump).
The recovery process does not 'undo' the computational effects of statements between ME_TRY and ME_RECOVERY. The exception simply aborts the computation and the program continues with the 'recover' statements.
When an exception has been caught the global variable 'me_errno' contains the number of the exception.
The programmer can simulate exceptions by using the macro ME_ESCAPE(exception_code), which sets the exception code in me_errno to exception_code and does a longjump.
ME_TRY ME_RECOVERY ME_END_TRY statements are usually structured in the following way:
ME_TRY { statement1; statement2; . . } ME_RECOVER switch (me_errno) { ME_SYS_ERROR: recover_statement1; recover_statement2; . . break; default: ME_ESCAPE(me_errno); break; } ME_END_TRY
The 'default' branch in the switch statement has the effect of ensuring unwanted exceptions are passed on to the next ME_TRY... block.
ACTION_FDBCK feedback sub-model is only active when the inserting action routine is active.
PERMANENT_FDBCK feedback sub-model is permanently active. The feedback model to which the new sub-model is added is given by the parameter fdbck_model.
struct feedback_element *me_add_fdbck_box(box_pnt1, box_pnt2, fdbck_id)
struct feedback_element *box_pnt1,*box_pnt2;
struct feedback *fdbck_id;
struct feedback_element *me_add_fdbck_parallelogram(par_pnt1, par_pnt2, vec1, vec2, fdbck_id)
struct feedback_element *par_pnt1,*par_pnt2;
struct fvec3 *vec1,*vec2;
struct feedback *fdbck_id;
struct feedback_element *me_add_fdbck_arc(center, beg_pnt, end_pnt, fdbck_id)
struct feedback_element *center,*beg_pnt,*end_pnt;
struct feedback *fdbck_id;
me_add_fdbck_line
Adds a feedback line specified by two feedback points.
me_add_fdbck_box
Adds a feedback box ( coordinate system axis parallel rectangle), given by two feedback points representing the corners of the box.
me_add_fdbck_parallelogram
Adds a feedback parallelogram defined by two feedback corners points and the two direction vectors of the parallelogram border lines.
me_add_fdbck_arc
Adds a feedback arc defined by the three feedback points, which represent the center, begin and end point of the arc.
me_cursor_fdbck_model
Is the name of the feedback model, that is executed, that is, updated and drawn, when the cursor position, steered by the graphic input device, changes.
me_cursor_gport
Is a feedback viewport list. If the cursor is in a viewport controlled by the 2D model, the viewport is in this list. If the cursor is in a viewport not controlled by the 2D model, this list is empty.
me_cursor_model_pnt
Is the feedback point that represents the cursor position in 2D model coordinates. It is to be used, if a cursor dependent feedback is switched on in a viewport controlled by the 2D model.
struct feedback_element *me_add_fdbck_trans_pnt(x_dist,y_dist,x_rel,y_rel, fdbck_id)
float64 x_dist,y_dist;
struct feedback_element *x_ref,*y_ref;
struct feedback *fdbck_id;
struct feedback_element *me_add_fdbck_trans_dir_pnt(ref_pnt,project_pnt, dir,fdbck_id)
struct feedback_element *ref_pnt,*project_pnt;
struct fvec3 *dir;
struct feedback *fdbck_id;
struct feedback_element *me_add_fdbck_rot_pnt(r_dist,phi_dist,r_ref,
phi_ref,rot_cen,fdbck_id)
float64 r_dist,phi_dist;
struct feedback_element *r_ref,*phi_ref,*rot_cen;
struct feedback *fdbck_id;
struct feedback_element *me_add_fdbck_project_pnt_to_circle(cen,pnt,rad, fdbck_id)
struct feedback_element *cen,*pnt;
float64 rad;
struct feedback *fdbck_id;
struct feedback_element *me_add_fdbck_divide_pnt(fctr,pnt1,pnt2,fdbck_id)
float64 fctr;
struct feedback_element *pnt1,*pnt2;
struct feedback *fdbck_id;
me_add_fdbck_fix_pnt
Inserts a feedback point whose fix coordinates are given by the parameter coord_ptr.
me_add_fdbck_trans_pnt
Inserts a translating feedback point. The x-coordinate of that point has a constant distance x_dist from the x-coordinate of the feedback point, specified by the parameter x_ref. The y-coordinate has a constant distance y_dist from the y-coordinate of the feedback point specified by y_ref.
me_add_fdbck_trans_dir_pnt
Inserts a translating feedback point. This point lies on a line which goes through the feedback point ref_pnt and has the direction vector dir. The position of the point on the line is the perpendicular projection of the feedback point project_pnt to the line.
me_add_fdbck_rot_pnt
Inserts a rotating feedback point. The center of the rotation is the feedback point rot_cen. The polar coordinate r of that point has a constant distance r_dist from the r-coordinate of the feedback point r_ref.
The phi-coordinate has a constant distance phi_dist from the phi-coordinate of the feedback point specified by phi_ref.
me_add_fdbck_project_pnt_to_circle
Inserts a feedback point, which is the projection of the feedback point pnt to the circle, defined by the center point cen and the radius rad.
listptr me_add_fdbck_divide_pnt(fctr,pnt1,pnt2,fdbck_id)
Inserts a feedback point, which lies on the line through the feedback points pnt1 and pnt2 and has the distance of fctr multiplied with the distance from pnt1 to pnt2 from the feedback point pnt1.
me_fclose - close file
me_fopen opens the file named by fullname and associates a stream with it. The filename may be a fully user-definable name with up to 60 characters or up to 255 characters on file systems that allow long filenames. If this filename is not a "valid" filename in the sense that it is too long or contains characters not allowed by the operating system, a physical filename is created. This name is returned to the user as physical filename in physname. Fullname and physname are the same, if no translation is necessary.
Type is a character string having one of the following values:
"r" | open for reading |
"w" | create for writing |
"a" | append; open for writing at end of file, or create for writing |
"r+" | open for update (reading and writing) if the file exists already or create one for update |
"w+" | truncate of create for update |
The filename together with the physical filename is stored in the hp_catfile in the corresponding directory. Besides some other system-information, like create-date or number of accesses, the catalog also contains some application dependent information like a short file description or the name and revision of the program that generated the file. This information is stored in the catalog when a file is newly created. File description can be a character string with max. 8 characters and is pointed by the parameter fdesc. Program-name and Program-revision are expected to be set as configuration parameters.
me_fclose
me_fclose causes any buffered data for the named stream to be written out, and the stream to be closed. Buffers allocated by the standard input/output system may be freed.
me_fclose returns 0 for success and EOF if any error was detected.
struct elem2d *me_create_elem_line2d(part,begmp,endmp,elem2d_attr)
struct elem2d *part;
struct mp *begmp,*endmp;
struct elem2d_attr *elem2d_attr;
struct elem2d *me_create_elem_circle2d(part,cenmp,permp,elem2d_attr)
struct elem2d *part;
struct mp *cenmp,*permp;
struct elem2d_attr *elem2d_attr;
struct elem2d *me_create_elem_arc2d(part,cenmp,begmp,endmp,elem2d_attr)
struct elem2d *part;
struct mp *cenmp,*begmp,*endmp;
struct elem2d_attr *elem2d_attr;
struct elem2d *me_create_elem_bspline2d(part, bspline_pts, num_pts, pnt_type, closed, order, knots, elem2d_attr)
struct elem2d *part;
struct bspline_pnt2d *bspline_pts;
int num_pts;
int pnt_type;
int closed;
int order;
float64 *knots;
struct elem2d_attr *elem2d_attr;
void me_get_elem_bspline2d(bspline, ctrl_pts, intp_pts, knots, num_ipts, num_cpts, num_knots, closed, order)
struct elem2d *bspline;
struct bspline_pnt2d **ctrl_pts;
struct bspline_pnt2d **intp_pts;
float64 **knots;
int *num_ipts;
int *num_cpts;
int *num_knots;
int *closed;
int *order;
void me_elem2d_get_begin_end_vertices(elem,begmp,endmp)
struct elem2d *elem;
struct mp **begmp,**endmp;
void me_elem2d_get_center_vertex(elem,cenmp)
struct elem2d *elem;
struct mp **cenmp;
float64 me_elem2d_get_radius(elem)
struct elem2d *elem;
me_create_elem_bspline2d creates a 2D B-spline and returns a pointer to the resulting elem2d structure. This function generates a non-uniform B-spline curve of a specified order. It is optionally based on a list of knots in parameter space and a list of points in 2D space. (Part and elem2d_attr have the same meaning as described in the previous paragraph.)
The spline order must be a positive integer. The knots must form a monotonic increasing sequence of values.
The closed parameter is one of OPEN, CLOSED and CLOSED_PERIODIC. OPEN means an open B-spline. CLOSED means that the vertex of the start- and end-point of the B-spline has C(0) continuity. CLOSED_PERIODIC means that the vertex of the start- and end-point of the B-spline has C(1) continuity.
The shape of the B-spline curve is described by bspline_pts, pnt_type, and num_pts. Bspline_pts should be an array with members of the type:
struct bspline_pnt2d { struct mp *mp_ptr; int32 conditions; float64 slope; float64 curvature; }.
Pnt_type is either INTP_PTS or CTRL_PTS. INTP_PTS describes the model-points (mp_ptr) as interpolation-points that the resulting curve must pass through. CTRL_PTS describes the model-points as the control-polygon of the resulting B-spline. In the case of INTP_PTS, the conditions for interpolation-points is considered. A value for condition NO_COND means ignore the tangent and curvature. SLOPE_COND means the curve at the specific point has a slope measured as an angle in radians (0 <= slope <= 2pi). Curvature is currently ignored. In the case of CTRL_PTS, the conditions are completely ignored.
Num_pts defines the length of the bspline_pts array.
If you do not specify a knot-vector (for example, knots = (float64*) 0), the system calculates a non-uniform knot-vector based on the distances of the points in bspline_pts. In the case of INTP_PTS, the knots are ignored. The function returns NULL, if the creation of the curve fails.
For the creation of B-splines the following conditions must hold (# = number of):
#control-points | >= order of the B-spline |
#interpolation-points + #conditions | >= order of the B-spline |
#control-points + order | = length of knot-vector |
Therefore, the creation of a B-spline with order 6 and three control-points fails.
me_get_elem_bspline2d gets the values of a curve 'bspline'. For ctrl_pts and knots, the function allocates and fills an array of control points and knot values. For intp_pts, the functions allocates an array only if the spline was created by interpolation points. The memory allocated by the function must be freed by the caller. If the call fails, no memory is allocated by the system and therefore nothing has to be freed.
me_elem2d_get_begin_end_vertices gets the start and end model points of a line, circle, arc, fillet or bspline. me_elem2d_get_center_vertex gets the center model point of an arc, circle, fillet or point. me_elem2d_get_radius gets the radius of an arc, fillet or circle.
struct hatch *me_get_face_hatch(face)
struct elem2d *face;
void me_set_face_hatch(face,hatch)
struct elem2d *face;
struct hatch *hatch;
me_create_hatch
Creates a hatch. A hatch consists of a pattern and three parameters, which specify a transformation for the pattern. distance specifies the scale factor for the pattern. angle specifies the orientation of the pattern. match_point specifies the location of the pattern. The identifier for the created hatch is returned.
me_get_face_hatch
Returns the hatch of a face. If the face has no hatch, the NULL pointer is returned.
me_set_face_hatch
Links a hatch to a face. A hatch can be linked to several faces. A face can only have one hatch.
struct elemdef2d *elemdef1,*elemdef2;
struct fvec3 *intpnt_arr;
int intpnt_arr_size,*numb_found;
The function uses vector parameters only and thus is independent of real 2D elements or 2D model points. It can generally be used as a mathematical vector function outside the 2D model.
To make intersection calculations more general and independent of really existing 2D model elements, the intersection function does not refer to model elements , but uses two elemdefs as input parameters instead.
For each element type (currently line, arc, circle, and bspline) a C struct is used as a parameter that describes the geometric element by means of vectors and numbers only, e.g. without any references to the model data structure. This element specific struct (i.e. linedef2d, circledef2d, arcdef2d, or bspline2def) has to be casted to a struct elemdef2d when used as an input parameter for the intersection function. So a model independent but general element definition type (i.e. elemdef2d) is available without the need to have the referred input elements created and inserted into the model data structure before calling this function.
struct linedef2d { int32 type; struct fvec3 begpnt, endpnt; } struct circledef2d { int32 type; struct fvec2 cenpnt; float64 radius; } struct arcdef2d { int32 type; struct fvec2 cenpnt; float64 radius, begang, endang; } struct bsplinedef2d { int32 type; int32 pnt_type; float64 *knots; int32 closed; int32 order; struct bspl_pts *pts; int32 n_pts; } where struct bspl_pts is defined as follows: struct bspl_pts { struct fvec3 pt; int32 conditions; float64 tangent; float64 curvature; } struct elemdef2d { int32 type; }
type may be LINE2D, CIRCLE2D, ARC2D, or BSPLINE2D.
Here is an example how to call the intersection function for a line and a circle:
struct linedef2d ldef; struct circledef2d cdef; ldef.type = LINE2D; ldef.begpnt.x = 0.0; ldef.begpnt.y = 0.0; ldef.endpnt.x = 100.0; ldef.endpnt.y = 100.0; cdef.type = CIRCLE2D; cdef.cenpnt.x = 50.0; cdef.cenpnt.y = 50.0; cdef.radius = 25.0; me_intsect_2_elemdefs(....,(struct elemdef2d *)&ldef, (struct elemdef2 *)&cdef,....)
The calculated intersection points are put into the array 'intput_arr'. The calling function has to give the array size (i.e. the maximum number of intersection points that fit into the array) via the parameter.
The parameter 'numb_found' as well as the function return value give the number of found intersections between the two elements. If more intersections are found than would fit into the 'intpnt_arr', only the first intersections that fit into the array will be returned. Currently the intersection point array need not contain more than two intersection points, but this concept enables future extensions to element types with possibly more than two intersection points.
For a description of type struct bsplinedef2d, see also GEO2D(3X) and 2D Application Interface.
struct keyword *me_new_function(name,func)
char *name;
void (*func)();
struct keyword *me_new_qualifier(name)
char *name;
struct keyword *me_new_arithm_function(name)
char *name;
struct keyword *me_search_keyword(name)
char *name;
me_search_keyword returns the pointer identifying the keyword with the given name, or NULL if no such keyword exists.
int changed = *me_linetype_ptr & LINETYPE_CHANGED;
To get only the linetype information out of an int32 linetype value
linetype & LINETYPE_MASK
can be used.
The following explicit linetype definitions are provided:
LT_SOLID LT_DASHED LT_LONG_DASHED LT_DOT_CENTER LT_DASH_CENTER LT_PHANTOM LT_LONG_DOTTED LT_DOTTED
The following me_linetype_xxx variables contain the current linetype values which are used for creating new elements belonging to the group xxx. These values can also be changed directly.
me_linetype_geo contains the current geometry linetype.
me_linetype_hatch contains the current hatch linetype.
The me_linewidth_geo variable contains the current linewidth which is used for creating new geometry elements. The value can also be changed directly.
me_linetype_geo contains the current geometry linewidth.
Within AI, the linewidth for elements can be changed directly without using the current linewidth setting. Here, it is possible to use the current setting and modify it.
int32 me_count_nodes(node_ptr)
struct list_node *node_ptr ;
struct list_node *me_del_node(list_head_ptr,node)
struct list_node *list_head_ptr, *node;
struct list_node *me_del_list(start_node)
struct list_node *start_node;
struct list_node *me_exchange_link_of_node(node_ptr,new_link)
struct list_node *node_ptr, *new_link;
struct list_node *me_front_add_node(list_head_ptr,size)
struct list_node *list_head_ptr;
uint32 size ;
struct list_node *me_get_next_node(node_ptr)
struct list_node *node_ptr;
anyptr me_get_objptr_of_node(node_ptr)
struct list_node *node_ptr;
struct list_node *me_reserve_list(list_head_ptr);
struct list_node *list_head_ptr ;
me_add_node
Inserts a new node AFTER the list element indicated by node_ptr and returns the node pointer of the new element. If node_ptr is NULL, a new list will be created. The size of the object (number of bytes) of the new node is determined by size
Note: The object of the new node is returned uninitialized.
me_count_nodes
Returns the number of nodes in a list. Counting start at node_ptr which may be the head or any other node of a list.
me_del_node
Deletes node node from the list specified by list_head_ptr. If the specified node is not in the given list, nothing happens;
Note: To effectively delete a range of nodes use me_exchange_link_of_node and me_del_list.
me_del_list
Deletes the list starting at the node start_node and returns a null pointer.
This routine may also be used to delete a part of a list if the link of the predecessor of start_node is set to null using 'me_exchange_link_of_node'
me_exchange_link_of_node
Exchanges the link of the node given by node_ptr with new_link and returns the old link as function result. new_link can be either a list head or any node in a list.
Illustration:
Before After node_ptr node_ptr | | +- Return value v v v o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o o-o-o-o-o-o-o-o-o-o o-o-o-o-o-o | o-o-o-o-o-o +-o-o-o-o-o-o ^ | list_head_ptr
me_front_add_node
Appends a new node of the size specified by size (in number of bytes) to the front (head) of a list specified by list_head_ptr The new list head node is returned as function result.
If list_head_ptr is NULL, a new list will be created.
Note: The object of the node is not initialized.
me_get_next_node
This macro returns the successor of node_ptr
me_get_objptr_of_node
This macro allows access to the object attached to the node specified by node_ptr. The returned pointer should be cast to a pointer of appropriate type.
me_reverse_list
Reverses the order of the list denoted by list_head_ptr. The previous tail of the list is returned as the function result.
struct macro *me_search_macro(name)
char *name;
me_search_macro returns the pointer identifying the macro with the given name. The macro is created if it does not exist already.
struct fvec3 *me_map_pnt_to_line_3(pnt_on_line,line_direction,pnt,result)
struct fvec3 *pnt_on_line, *line_direction, *pnt, *result;
struct fvec3 *me_map_vec_3(operator,vec,operation,result)
struct geo_operator_3 *operator;
struct fvec3 *vec;
int operation;
struct fvec3 *result;
struct fvec3 { float64 x, y, z; };
me_map_pnt_to_plane_3
Calculates the orthogonal projection of a point given by pnt onto a plane defined by pnt_on_plane and plane_normal and returns the projected point which lies now on the plane in result.
Note: plane_normal must be of unit length (normalised).
me_map_pnt_to_line_3
Calculates the orthogonal projection of a point taken from pnt onto a line defined by pnt_on_line and line_direction and returns the projected point which now lies on the line in result.
Note: line_direction must be of unit length (normalised).
me_map_vec_3
Transforms vector vec by pre-multiplying it with the homogenous 4x4 matrix taken from the geo operator given in operator.
operation determines whether the translational part of operator is to be applied. If ME_TRANSLATION is given the translation will be applied, if ME_NO_TRANSLATION is given it will not be applied. Ignoring the translation is suitable for direction vectors where the position in space is irrelevant. The translation must be applied if points are to be transformed.
The transformed vector is returned in result.
struct fvec3 *me_map_pnt_to_cs(mapped_pnt,pnt,source_cs,destination_cs)
struct fvec3 *mapped_pnt,*pnt;
struct cs_identifier source_cs,destination_cs;
struct fvec3 *me_map_vec_to_cs(mapped_vec,vec,source_cs,destination_cs)
struct fvec3 *mapped_vec,*vec;
struct cs_identifier source_cs,destination_cs;
float64 me_map_dist_to_cs(dist,dir,source_cs,destination_cs)
float64 dist;
struct fvec3 *dir;
struct cs_identifier source_cs,destination_cs;
float64 me_map_angle_to_cs(angle,plane_normal,source_cs,destination_cs)
float64 angle;
struct fvec3 *plane_normal;
struct cs_identifier source_cs,destination_cs;
me_get_cs_operator
Returns the identifier of the operator performing the transformation from source to destination coordinate system.
me_map_pnt_to_cs, me_map_vec_to_cs
With the first parameter mapped_XXX the caller specifies the address, where the result is written. This address is also the return value of the functions. The second parameter is the address of the vector or point to be mapped.
me_map_dist_to_cs, me_map_angle_to_cs
The first parameter dist respectively angle is the value to be mapped. The mapped value is returned. The parameter dir in the distance mapping function is the address of the vector, in whose direction the distance is measured. The parameter plane_normal in the angle mapping function is the address of the vector, which is the normal vector of the plane in which the angle is measured.
Note: plane_normal must be of unit length (normalized).
char *me_get_part_name(part)
struct elem2d *part;
int me_get_part_shared(part)
struct elem2d *part;
void me_share_part(part)
struct elem2d *part;
void me_unshare_part(part)
struct elem2d *part;
void me_rename_all_instances(part, new_partname)
struct elem2d *part;
char *new_partname;
void me_set_part_ref_pnt(part, ref_pnt)
struct elem2d *part;
struct fvec3 *ref_pnt;
struct fvec3 *me_get_part_ref_pnt(part)
struct elem2d *part;
struct geo_operator_3 *me_get_rel_part_mtrx_3(part,mtrx)
struct elem2d *part;
struct geo_operator_3 *mtrx;
void me_change_rel_part_mtrx_3(part, mtrx)
struct elem2d *part;
struct geo_operator_3 *mtrx;
struct elem2d *me_get_part_elem(part, types, gport, elem)
struct elem2d *part;
int32 types;
int gport;
struct elem2d *elem;
struct elem2d *me_get_parent_part(part)
struct elem2d *part;
struct elem2d *me_find_part(count,part_name)
int *count;
char *part_name;
struct elem2d *me_get_root_part()
struct elem2d *me_get_curr_part()
void me_change_curr_part(curr_part)
struct elem2d *curr_part;
me_create_part creates a subpart in the part parent_part with the given part name partname.
me_rename_all_instances changes the name of all instances of the part part to new_partname.
me_get_part_name returns the part name of the part part.
me_get_part_shared specifies whether part is shared or not.
me_share_part sets the given part part shared.
me_unshare_part sets the given part part unshared.
Every part has a reference point (abbrev. ref_pnt) which is used as an origin point for loading and modifying the whole part. me_set_part_ref_pnt changes the reference point of a part to ref_pnt. me_get_part_ref_pnt returns the address of the value of this reference point.
All parts have a transformation matrix which is applied to all elements. For every element the sum of all relative matrices of all parent parts up to the root part is applied to the elements. Note that only shared parts may have a relative transformation matrix different to the identity operator whereas non shared parts always have the identity operator as their part matrix. Therefore you must not change the relative part matrix of a non shared part. me_get_rel_part_mtrx_3 returns the relative matrix of the specified part.
me_change_rel_part_mtrx_3 changes the matrix of the shared part part to the matrix mtrx.
With me_get_part_elem all elements of a part can be accessed in order. Every call to me_get_part_elem returns the next element after the element elem in order according to the specified parameters. types is a set that describes the types of elements to return. To access the first element within the given type set, use 0 for parameter elem. If gport is NO_GPORT all elements in the part can be accessed, otherwise only the elements which are in the graphic port gport are returned.
me_get_parent_part returns for simple elements the part to which the element belongs or for subparts the parent part.
me_find_part takes a part name and returns the part identifier with the given name or 0, if no part of this name exists. *count is set to the number of parts with this name
2D Model Access:
The whole 2D model is built up by a hierarchical tree of nodes. The nodes of this tree are called parts. The root of the parts tree is called the root part and is accessed by me_get_root_part. All 2D elements and also all parts are identified by struct elem2d *.
One of the parts can be set as the current part with me_change_curr_part. me_get_curr_part returns the actual current part.
struct fvec3 *me_create_mp(part,pnt)
struct elem2d *part;
struct fvec3 *pnt;
struct fvec3 *me_get_mp_pnt(mp,pnt)
struct mp *mp;
struct fvec3 *pnt;
All model points are identified by struct mp * and contains a struct fvec3 to describe the location of the model point. 2D model points are created with me_create_mp. The location of a 2D model point can be inquired by me_get_mp_pnt which returns a struct fvec3 *. The function result struct fvec3 * points into a read only volatile storage area.
void me_pixmap_rotate(pixmap_name, ref_pnt, angle)
char *pixmap_name;
struct fvec2 ref_pnt;
float64 angle;
void me_pixmap_scale(pixmap_name, ref_pnt, xscale, yscale)
char *pixmap_name;
struct fvec2 ref_pnt;
float64 xscale;
float64 yscale;
void me_pixmap_sendback(pixmap_name)
char *pixmap_name;
void me_pixmap_bringtop(pixmap_name)
char *pixmap_name;
void me_pixmap_show_box (pixmap_name, port)
char *pixmap_name;
int port;
void me_pixmap_on(pixmap_name, port)
char *pixmap_name;
int port;
void me_pixmap_off(pixmap_name, port)
char *pixmap_name;
int port;
void me_pixmap_delete_one(pixmap_name)
char *pixmap_name;
void me_pixmap_get_data(pixmap_name, data)
char *pixmap_name;
struct pix_map_data *data;
void me_pixmap_get_data_all(data, npixmaps)
struct pix_map_data **data;
int *npixmaps;
void me_pixmap_display(pixmap_name, port, draw_mode)
char *pixmap_name;
int port;
int draw_mode;
int me_pixmap_select_from_pnt(select_pnt, pixmap_name)
struct fvec2 select_pnt;
char **pixmap_name;
me_pixmap_move moves a given pixmap from one location to another.
me_pixmap_rotate rotates the pixmap specified about the given point through a given angle. The angle is specified in degrees.
me_pixmap_scale scales the pixmap along x and y direction.
me_pixmap_sendback places the selected pixmap behind all other pixmaps.
me_pixmap_bringtop places the selected pixmap in front of all other pixmaps.
me_pixmap_show_box sets the box-mode flag of the pixmap in the given viewport. The pixmap is then represented by a frame.
me_pixmap_on sets the visibility flag to ON
for the selected pixmap in
the given viewport. This overrides the setting of boxmode flag.
me_pixmap_off sets the visibility flag to OFF
for the selected
pixmap in the given viewport.
me_pixmap_delete_one deletes the selected pixmap. This command removes the pixmap from the database.
me_pixmap_get_data retrieves the properties of the selected pixmap such as size, box-mode flag, rotation angle etc.
me_pixmap_get_data_all retrieves the properties of all the pixmaps.
me_pixmap_display displays or erases the pixmap on a given viewport. The draw_mode can have the values:
me_pixmap_select_from_pnt selects a pixmap (and returns its name) lying closest to a given point.
The pixmap parameter structure is defined as follows:
struct pix_map_data
{ char *name; int z_level; struct fbox2 pixmap_box; float64 x_scale; float64 y_scale; float64 rot_angle; int32 inwindow; int32 boxmode; };
void me_select2d_select_elem(elem)
struct elem2d *elem;
void me_select2d_unselect_elem(elem)
struct elem2d *elem;
void me_select2d_select_closest_element(global,calpnt,types,
inpnt,elem,elempnt,elemmp)
struct elem2d **elem;
struct mp **elemmp;
struct fvec3 *inpnt;
struct fvec3 *elempnt;
int global,calpnt;
int32 types;
void me_select2d_select_by_vertex(part,mp,types)
struct elem2d *part;
struct mp *mp;
int32 types;
void me_select2d_select_by_box(box,types,global)
struct fbox3 *box;
int32 types;
int global;
void me_select2d_select_by_infostring(infostring,types,global)
char *infostring;
int32 types;
int global;
void me_select2d_select_by_color(types,color,global)
int32 types,color;
int global;
void me_select2d_select_by_linesizes(types,linesizes,global)
int32 types;
float64 linesize;
int global;
void me_select2d_select_by_linetype(types,linetype,global)
int32 types,linetype;
int global;
void me_select2d_select_by_linewidth(types,linewidth,global)
int32 types;
float64 linewidth;
int global;
void me_select2d_select_all(types,global)
int32 types;
int global;
struct list_node *me_select2d_list_selected_elems()
Element selection is done by scanning all appropriate elements, either starting at the top part and scanning through all parts top down (i.e. global selection), or scanning only in the current part. The search only includes elements whose type matches a given set of element types.
Elements can be selected either directly one by one via the functions me_select2d_select_elem and me_select2d_unselect_elem or by using one of the selection functions that search for all elements matching a specified criterion, e.g. for all elements contained in a box.
To access the currently selected elements you can call me_select2d_list_selected_elems to create a list containing pointers to all selected elements as your final selection result.
Each time you start a selection, you first have to call the general selection mechanism. This function unselects all existing elements and removes all previous selection results. All subsequent selections have a cumulative effect until me_select2d_initialize is called again.
Explanation of the selection functions:
me_select2d_initialize initializes the whole selection mechanism and should be called before each first selection pass.
me_select2d_select_elem selects an element.
me_select2d_unselect_elem unselects an element.
me_select2d_list_selected_elem creates a list containing pointers to all currently selected elements.
The selection functions provided can select for the following selection criteria:
me_select2d_select_by_vertex selects all elements starting or ending at a given model point mp.
me_select2d_select_closest_element selects the closest element to a given input point inpnt. If calpnt equals 1, then a point elempnt on the selected element closest to the given input point inpnt and the element's model point elemmp closest to the given input point will be calculated as well. The input coordinates have to be given in world coordinates.
me_select2d_select_by_box selects all elements contained in the box. The input coordinates have to be given in world coordinates.
me_select2d_select_by_infostring selects all elements to which infostring is attached. Infostring may contain wildcard characters (see ME10 manual for wildcards).
me_select2d_select_by_color selects all elements having a certain color.
me_select2d_select_by_linesize selects all elements having a certain linesize.
me_select2d_select_by_linetype selects all elements having a certain linetype.
me_select2d_select_by_linewidth selects all elements having a certain linewidth.
me_select2d_select_all selects all elements.
The parameter global defines whether all elements (i.e. global = 1) or only elements in the current part (i.e. global = 0) will be scanned.
The selection functions only scan elements whose element type matches the parameter types describing a set of allowed element types.
void me_get_text_corners(elem,llpnt,lrpnt,urpnt,ulpnt)
struct elem2d *elem;
struct fvec3 *llpnt,*lrpnt,*urpnt,*ulpnt;
void me_get_text_params(elem,fontname,fontname_2byte,slist, originmp,params)
struct elem2d *elem;
struct strlist **slist;
struct mp **originmp;
struct text_params *params;
char *fontname;
char *fontname_2byte;
void me_change_text_slist(elem,new_slist)
struct elem2d *elem;
struct strlist *new_slist;
void me_set_curr_text_params(fontname,fontname_2byte,params)
struct text_params *params;
char *fontname;
char *fontname_2byte;
void me_get_curr_text_params(fontname,fontname_2byte,params)
struct text_params *params;
char *fontname;
char *fontname_2byte;
The data type for stringlists is defined as
struct strlist { struct strlist *nxt; char *str; }
Please note that this list type is not compatible to the "normal" AI list data type.
The text parameter struct is defined as follows:
struct text_params { float64 char_height; float64 char_slant; float64 block_slant; float64 ratio; float64 angle; float64 linedist; uint8 adjust; uint8 frame; uint8 fill; uint8 keep_orientation; };
A text consists of one or more lines, so it will be more adequate to speak of a text block with all its lines left bound. It is positioned by an origin model point that can occupy one from nine possible origin adjustment positions within a text block.
The characters of a text are defined by a text font. If a certain character is not defined by the font or if the appropriate text font is not currently loaded, a default box is drawn for this character.
A text is defined by the following parameters:
slist: | the stringlist containing the text strings for each text block line. |
origin_mp: | the model point defining the text origin position. |
fontname: | the name of the used text font for character layout definition. |
fontname_2byte | the name of the used 2-byte text font for character layout definition. |
char_height: | the height of a character cell defined by the font height parameter and measured perpendicular to the text baseline. |
ratio: | the width of a character cell defined by the font width parameter relative to the char_height (e.g. character width = ratio * char_height) and measured in the direction of the text baseline. |
char_slant: |
the slant angle of the characters within a text line. Has a direct
influence on the shape of a character since it tilts the upright
direction of the character layout vectors. A positive slant tilts the
vectors to the right, a negative one to the left of the perpendicular
from the character baseline.
The user can set the char_slant by the TEXT_SLANT function.
Possible values: -80 deg <= char_slant <= +80 deg |
block_slant: |
the slant of the entire text block. The block_slant offsets the text lines parallel
to the text baseline and therefore tilts the text block upright direction. Therefore
the block_slant does not affect the bottom text line.
A positive block_slant tilts to the right, a negative one to the left of the
perpendicular from the text baseline. The block_slant cannot be set directly by
the user, it is changed automatically after affine modifications of a text element.
Possible values: -80 deg <= block_slant <= +80 deg and |
angle: | the angle of the text block baseline relative to the positive x-axis direction. |
linedist: | the ratio of the distance between two lines in a text block and the char_height, measured perpendicular to the baseline. The real distance is therefore equal to linedist * char_height. |
adjust: |
the position of the text origin model point within the text block.
Possible values are 1 to 9: |
Value | Origin position in text block |
---|---|
1 | Lower left endpoint of bottom text baseline |
2 | Middle of bottom text baseline |
3 | Lower right endpoint of bottom text baseline |
4 | Left boundary of text block at half of its height |
5 | Center of text block |
6 | Right boundary of text block at half of its height |
7 | Upper left text block corner |
8 | Upper text block boundary at half of its width |
9 | Upper right text block corner |
Note that adjust positions 1 to 3 are on the bottom text baseline which is not necessarily the same as the lower text block boundary. So the origin model point can never be positioned within the character underlength area of the bottom text line. Adjust positions 4 to 9 refer to the text block height measured from the bottom text baseline to the top of the highest character of the top text line.
frame: |
describes the type of a frame around the text block. Possible values:
NO_FRAME, BOX_FRAME or BALLOON_FRAME | ||||
fill: | if the used text font is fillable, the text characters will be displayed filled. | ||||
keep_orientation: |
possible values:
|
me_change_text_slist changes the strings of the text elem to the new strings given by new_slist.
The current text parameters, handled by the functions me_set_curr_text_params and me_get_curr_text_params do not influence the creation of a text element by the AI function me_create_elem_text. They only influence the current settings used by the interactive ME10 text commands and functions.
The function me_set_curr_text_params ignores the values for block_slant and keep_orientation, because there are no appropriate current text parameter values. The text color of text elements created by the AI function me_create_elem_text is defined for each text element individually by the struct elem2d_attr.
struct keyword *me_token_keyword()
struct token *me_append_token(tokenlist,type,valueptr)
struct token *tokenlist;
int type;
void *valueptr;
struct token *me_get_tokenlist_of_macro(macro)
struct macro *macro;
struct token *me_eval_factor()
int me_type_of_token(p)
struct token *p;
struct keyword *me_keyword_of_token(p)
struct token *p;
int me_symbol_of_token(p)
struct token *p;
char *me_string_of_token(p)
struct token *p;
float64 me_number_of_token(p)
struct token *p;
void me_set_number_of_token(p, value)
struct token *p;
float64 value;
struct fvec2 me_pnt2d_of_token(p)
struct token *p;
me_token_unget() returns the token, which has been read by me_token_get() but cannot be handled, back to the system.
me_token_keyword() retrieves the keyword pointer from a COMMAND_TOKEN, FUNCTION_TOKEN, QUALIFIER_TOKEN, PSEUDO_COMMAND_TOKEN, or ARITHM_FUNCTION_TOKEN.
me_token_symbol() retrieves the symbol type from a SYMBOL_TOKEN.
me_token_string() retrieves the pointer to the character string of a STRING_TOKEN.
me_token_number() retrieves the double precision number of a NUMBER_TOKEN.
me_token_pnt2d() retrieves the 2D point of a POINT_TOKEN.
me_append_token creates a new token of the specified type and appends it at the end of the specified token list. If tokenlist is NULL, a new list will be created. me_append_token returns the updated pointer to the head of the token list. Type is the type of the token to be created. Valueptr is a pointer to the value of the token to be created.
me_get_tokenlist_of_macro retrieves the tokenlist of the macro specified by the parameter macro. If you have a macro which defines a simple number, this function retrieves a NUMBER_TOKEN.
me_eval_factor evaluates a user input (which may contain numbers, other arithmetic functions or arithmetic expressions). Then, a new token is created representing the input.
me_type_of_token retrieves the type of a token, specified by p.
me_keyword_of_token retrieves the keyword pointer from the COMMAND_TOKEN, FUNCTION_TOKEN, QUALIFIER_TOKEN, PSEUDO_COMMAND_TOKEN, or ARITHM_FUNCTION_TOKEN, which has been specified by p.
me_symbol_of_token retrieves the symbol type from the SYMBOL_TOKEN p.
me_string_of_token retrieves the pointer to the character string of the STRING_TOKEN p.
me_number_of_token retrieves the double precision number of the NUMBER_TOKEN p.
me_set_number_of_token this function will change the contents of the number token p to the value, specified by the parameter value.
me_pnt2d_of_token retrieves the 2D of the POINT_TOKEN p.
struct list_node *me_create_cont_list_by_pnt(part,pnt)
struct elem2d *part;
struct fvec3 *pnt;
struct list_node *me_create_outer_cont_list_of_net(elem_list)
struct list_node *elem_list;
int me_point_in_cont(pnt,cont)
struct fvec3 *pnt;
struct elem2d *cont;
struct list_node *me_get_related_elems(elem,typeset,ref_typ)
struct elem2d *elem;
int32 typeset;
int ref_typ;
struct elem2d *me_get_face_outer_cont(face)
struct elem2d *face;
struct elem2d *me_get_face_first_inner_cont(face)
struct elem2d *face;
struct elem2d *me_get_face_next_inner_cont()
struct elem2d *me_create_elem_face(part,cont_list,elem2d_attr)
struct elem2d *part;
struct list_node *cont_list;
struct elem2d_attr *elem2d_attr;
struct elem2d *me_create_elem_polyelem(part,elem_list,elem2d_attr)
struct elem2d *part;
struct list_node *elem_list;
struct elem2d_attr *elem2d_attr;
me_smash_elem_polyelem(part,polyelement)
struct elem2d *part;
struct elem2d *polyelement;
me_create_elem_contour
Creates a 2D element of type contour and adds it to the part given by the parameter part. The parameter elem_list is the head of a list of 2D elements, which form the boundary of the contour. Every element in the list must share exactly one vertex with the element previous to it. Additionally the first and the last element of the list can have a common vertex. If they do, the contour is closed. The elements of the list must be in the same part as specified by the parameter part. The parameter elem2d_attr specifies the element attributes, which will be attached to the contour.
me_create_cont_list_by_pnt
Tries to find elements, which form a closed boundary around a point. If the boundary is found, the boundary element list is returned, otherwise the null pointer is returned. For the boundary search, only elements of the part given by the parameter part are used.
me_create_outer_cont_list_of_net
Tries to find elements, which form the closed outer contour of a list of elements, given by the parameter elem_list. All the elements of elem_list must be in the same part. If the boundary is found, the boundary element list is returned, otherwise the null pointer is returned.
me_point_in_cont returns 1 if pnt is inside the given contour, else 0 is returned.
me_create_elem_polyelem
Creates a 2D element of type polyelement (a list of connected geometry that may be of different types) and adds it to the part given by the parameter part. The parameter elem_list is the head of a list of 2D elements that form the sequence of the polyelement. Every element in the list must share one vertex with the element previous to it. Additionally, the first and the last element of the list can have a common vertex. If they do, the polyelement is closed. The elements of the list must be in the same part as specified by the parameter part. Finally, all geometry elements in elem_list must have the same attributes (for example, the same color and the same linetype). The parameter elem2d_attr specifies the element attributes which will be attached to the polyelement.
me_smash_elem_polyelem(part,polyelement)
Smashes or deletes a given polyelement (see me_create_elem_polyelem). The polyelement must be in the same part as specified by the parameter part. The attached geometry will not be deleted in the data structure of ME10.
Get Related 2D Elements :
me_get_related_elems returns a list of elements, which are related to the element specified by the parameter elem. The parameter typeset specifies the types of the related elements to be fetched. If no element of the specified types is related to the element, the null pointer is returned. The parameter ref_typ can have the values TO_ELEM_REL or FROM_ELEM_REL.
The following TO_ELEM_REL exist:
The simple elements of the contour are returned in the order of the contour list. The contours of the face are returned so that the first list element is the outer contour of the face.
The FROM_ELEM_REL are the reverse relation of the above.
me_get_face_outer_cont returns the outer contour of the given face.
me_get_face_first_inner_cont returns the first inner contour of the given face if an inner contour exists, otherwise it returns NULLELEM2D.
me_get_face_next_inner_cont returns the next inner contour of the given face if a next inner contour exists, otherwise it returns NULLELEM2D. me_get_face_first_inner_cont has to be called once prior to me_get_face_next_inner_cont.
Create 2D Element Face :
me_create_elem_face creates a 2D element of type face and adds it to the part given by the parameter part. The parameter cont_list is the head of a list of 2D elements of type contour. The first contour of the list is taken to be the outer contour of the face. The other contours are taken to be inner contours. The function me_create_elem_face doesn't make any topological checks, whether the inner contours are really in the outer contour, or whether the inner contours intersect with each other. The elements of the list must be in the same part as specified by the parameter part. The parameter elem2d_attr specifies the element attributes, which will be attached to the face.
void me_display_error(prompt)
char *prompt;
void me_set_default_input(s)
char *s;
me_token_error() should be called if a token was entered by the user which is illegal for this action routine. It clears all input buffers, issues a beep, and then starts error processing if an ON_ERROR is active.
me_wait_for_ack() waits for the user to press a key on the keyboard or mouse or the tablet stylus. It may be used to give the user some time to read a message, before it will be overwritten by the next input prompt.
me_display_error() is a convenient combination of me_token_error() , me_display_prompt() and me_wait_for_ack() .
me_set_default_input() is used to provide a default for the next user input. This default will be put on the system input line and may be edited by the user. The default will be ignored if the input request can be satisfied from an executing macro, input file or from previously buffered user input.
struct fbox3 *me_get_gport_window(gport,window)
int gport;
struct fbox3 *window;
void me_clear_gport(gport)
int gport;
int me_get_last_picked_gport()
float64 me_get_gport_search_range(gport)
int gport;
The window of a gport (graphical viewport) could be set by me_set_gport_window_by_two_pts and can be inquired by me_get_gport_window.
me_clear_gport clears the specified gport with the background color.
After the identification of a gport, me_get_last_picked_gport contains the number of the picked gport.
me_get_gport_search_range returns the current search range of the specified gport depending on the current catch info and the current window settings of the gport.
void me_inq_wp_coordinate_system(wp,u,v,w,origin)
struct workplane * wp;
struct fvec3 *u, *v, *w, *origin;
Returns the current workplane if any; the NULL pointer otherwise
me_inq_wp_coordinate_system
Returns the characteristic parameters of the local coordinate system associated with the workplane given by wp:
All returned vectors are expressed in terms of the global (world) coordinate system.