CADDIT CAD CAM CNC Software - download AutoCAD compatible design software progeCAD Alibre T-FLEX and more
CADDIT Website Knowledge Base Search:
CL

progeCAD Help

CR
Welcome to progeCAD
Working with progeCAD
Command Reference
CAD System Variables
Programming progeCAD
Full Index (caution - 400kb)

Further Links:

Download progeCAD
Register progeCAD

Learning

T-FLEX PLM tutorial (PDF)
progeCAD IntelliCAD and AutoCAD training 
CATIA 2D 3D design tutorial
Alibre CAD/CAM basic tutorial

Resources

Educational CAD Software Solutions
Python scripting for DOS and Windows
Other free software downloads
CADDIT CAD CAM Forum Australia
__

sds_grread

int sds_grread (int bits, int *answertype, struct sds_resbuf *answer);


Read data from any input device.


This function directly reads the data generated by input devices. A note of caution applies when using this function: the data can become an overwhelming amount.

The argument bits specifies the following:

Track Meaning
1 Returns the coordinates dynamically in the form of a list. The list consists of the value and the 3-D coordinate.
2 Returns keystrokes but does not move the cursor. Returns all key values, including cursor and function key codes.
4 Turn this on if you are going to choose a cursor type.
8 Turns off the error message "console break" when you cancel out of the loop.

Add the bits above to obtain a combination if desired.

The cursor argument is an integer that corresponds to a cursor type:

Cursor Meaning
0 Normal cursor-crosshairs.
1 No cursor.
2 Selection cursor - box.

The following table describes how the information is returned. For example, if you entered the letter, l (keyboard input), the value 2 and the character code would be returned (2 108) in a list.

Type of Input Returned Value Definition
Keyboard 2 Character code.
Selected Point 3 3-dimensional point.
Pulldown menu 4 1,001 to 1,999 POP1 menu
2,001 to 2,999 POP2 menu
16,001 to 16,999 POP16 menu
Mouse (other pointer) 5 3-dimensional point.

The argument answer the actual input, including type and value, is stored in this result buffer.

This function returns RTNORM or RTCAN.

Example

int type;

sds_resbuf readinput;

sds_grread(2,&type,&readinput); // Using 2 returns the value of any key pressed.

switch(type){

case 2: sds_printf("\nYou used the keyboard."); break;

case 3: sds_printf("\nYou selected a point."); break;

etc.

break;

}

switch(readinput.restype){

case RTREAL: sds_printf("\nIts value is %f. ",readinput.resval.rreal)

break;

case RTPOINT: sds_printf("\nThe 2D point is %f,%f.",

readinput.resval.rpoint[X],readinput.resval.rpoint[Y]);

break;

etc.

}     

Programming Overview of SDS (Solutions Development System)

CADDIT® is a registered trademark in Australia. All Rights Reserved. Comments concerning the content of this site should be addressed to our webmaster. progeCAD is a trademark of ProgeCAD srl. Autodesk® and AutoCAD® are both registered trademarks or trademarks of a third party, and used only for comparison purposes. All other trademarks, trade names or company names referenced herein are used for identification only and are the property of their respective owners. Legal and Terms of Use. Google. Find us on Google+.