sds_command

int sds_command (int rtype, ...);


Execute this IntelliCAD® 2001 command.


This function allows you to use any IntelliCAD command in an SDS program. Any following arguments will be used for that command. Each argument has two parts. As in public speaking, you tell the SDS program what you are going to tell it, and then tell it just that.

For example, to use the Line command, you need to tell the SDS program the command name, which is a string (RTSTR), "line". So far we have:

sds_command(RTSTR,"line", ...

That gets us into the Line command. Now we need to provide the information that the Line command requests, which is (at least) two 3-D points (RT3DPOINT). These are written:

...RT3DPOINT,point1,RT3DPOINT,point2...

To end the Line command, enter another string, empty this time. To end the sds_command function enter RTNONE or 0 (zero).

To summarize, a complete line command from sds_command would look like this:

sds_command(RTSTR,"line",RT3DPOINT,point1,RT3DPOINT,point2,RTSTR,"",RTNONE);

For the argument int rtype, any of the result types (RTxxx) are allowed. In each case, they are written as pairs, with the result types followed by the appropriate inputs, or variable names of the matching types, all separated by commas.

This function returns one of the following: RTNORM (the function executed normally), RTCAN (the user canceled the command), RTREJ (the command sequence was rejected by IntelliCAD), or RTERROR (some other error).

Example

sds_point point1,point2;

sds_getpoint(NULL,"\nFirst point for a line: ",point1);

sds_getpoint(point1,"\nSecond point: ",point2);

sds_command(RTSTR,"line",RT3DPOINT,point1,RT3DPOINT,point2,RTSTR,"",RTNONE);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_cmd