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_initget

int sds_initget (int accept, const char *keys);


Accept only input fitting these criteria.


This function defines what input is acceptable for the command immediately following sds_initget. When keywords are allowed, use sds_getinput after this function to get the keyword that the user entered.

The argument accept determines the type of input that will be accepted from the user with the next function. It is the sum of the bit values selected from the list below:

Accept

 

Meaning
1 RSG_NONULL Does not accept a carriage return from the user.
2 RSG_NOZERO Accepts only non-zero input from the user.
4 RSG_NONEG Accepts only non-negative numbers, including zero.
8 RSG_NOLIM Accepts input outside of the limits of the drawing. This has precedence over the LIMCHECK system variable.
16 ... Not used.
32 RSG_DASH Uses dashed lines for selection tools (boxes and rubberband lines).
64 RSG_2D Accepts, but does not use, the z-value for points in the sds_getdist function.
128 RSG_OTHER Accepts anything the user enters, and returns SDS_RTKWORD.

For example, if you want to limit the user's input to only positive numbers (non-negative and non-zero), and draw a rubber-band line with dashes, you add 4 + 2 + 32 to get a value of 38 for the accept variable.

A more verbose-but often clearer way-of using accept is to write an expression using the RSG_XXX words for each of the bits you wish to set. The same example as above written in this way is:

(RSG_NONEG + RSG_NONULL + RSG_DASH)

Once the bit code is set, you use string to determine the values that the user is limited to entering in response to the prompt displayed by the following function. This string is a list of keywords to be accepted by the next command. In essence, initget lets you define keywords. If keywords are not to be used, argument keys should be null or an empty string (""). The function always returns nil.

When defining your list of keywords, separate each keyword with a space. Show allowable abbreviations by capitalizing the required letter(s). When the entire word is in capital letters, the user is required to enter the entire word. Keywords may contain letters, numbers, and dashes. Here is an example of a list of keywords:

"One Two Three Four"

Given this, the user can type "three" or just "th" for three.

An alternative method of listing keywords is to write each word in all-capital letters, followed by a comma and the abbreviation for the word, as in the following example:

"ONE,O TWO,T THREE,TH FOUR,F"

This is usually used with (human) languages that do not use upper- and lower-case letters.

"~A B C _F _G ~_H"

The ~ prefix causes the keyword that follows to not be displayed in the popup menu. Use ~~ if you need to have ~ appear as a keyword.

The first underscore prefix indicates that the remaining keywords are globalized forms of the preceding keywords. The first keyword ("A" in this example) will match the first globalized keyword ("F" in this example), the second keyword will match the next globalized keyword ("B" will match "G" in the example), and so on. The user can enter either the localized or globalized keyword; the globalized keyword will be returned in either case. Only the first globalized keyword is required to have the underscore prefix.

NOTE The following combinations of functions, keywords, and accept bits are allowed:

Function Keywords 1 2 4 8 32 64 128
sds_draggen Yes Yes

 

 

 

 

 

Yes
sds_entsel Yes

 

 

 

 

 

 

 
sds_getangle Yes Yes Yes

 

 

Yes

 

Yes
sds_getcorner Yes Yes

 

 

Yes Yes

 

Yes
sds_getdist Yes Yes Yes Yes

 

Yes Yes Yes
sds_getint Yes Yes Yes Yes

 

 

 

Yes
sds_getkword Yes Yes

 

 

 

 

 

Yes
sds_getorient Yes Yes Yes

 

 

Yes

 

Yes
sds_getpoint Yes Yes

 

 

Yes Yes

 

Yes
sds_getreal Yes Yes Yes Yes

 

 

 

Yes
sds_getstring

 

 

 

 

 

 

 

 
sds_nentsel Yes

 

 

 

 

 

 

 
sds_nentselp Yes

 

 

 

 

 

 

 

This function returns RTNORM, RTKWORD, or RTERROR.

Example

char string1[512];

sds_initget(0,"Cat Dog Horse Bird");

sds_getkword("\nChoose one: Cat/Dog/Horse/Bird ",string1);

sds_printf("\nYour favorite animal is a %s. ",string1);

Programming Overview of SDS (Solutions Development System)

sds_draggen

sds_entsel

sds_getinput

sds_nentsel

sds_nentselp

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+.