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_setcallbackfunc

int sds_setcallbackfunc (int [int flag, void *arg1, void *arg2, void *arg3]);


progeCAD... call me at this function.


This function intercepts callbacks from progeCAD commands and sends them to a specified function. For example, progeCAD sends a callback that it is going to erase an entity before doing so. This callback could be sent to the function specified by sds_setcallbackfunc..

The sds_setcallbackfunc function is unique to the implementation of SDS for progeCAD.

Example

Suppose you need to know whenever the ERASE command is used in progeCAD so that application-specific data can be stripped from entities before they are erased. You create a function named cbfunc to monitor callbacks from progeCAD so you can trap all uses of the ERASE command.

First, you would issue the following when your SDS application is loaded:

sds_setcallbackfunc(cbfunc);

From then on, all callbacks from progeCAD will pass through cbfunc. When the ERASE command is used in progeCAD, cbfunc will detect it, as in the following section of code:

int cbfunc(int flag,void *arg1,void *arg2,void *arg3)

{

int res = RTNORM;

switch (flag) {

// Command Start/End.

case SDS_CBCMDBEGIN:

// arg1="command name" cast as (char *)

// Callback return RTERROR will cause command to not be called.

// Any processing needed for the erase command goes here.

// For example, if you wanted to disable the erase command to

// prevent users from erasing entities, you could use the

// following code:

if (!stricmp(arg1, "erase"))

res = RTERROR;

break;

case default:

break;

}

return res;

}

As the comment above indicates, the callback return of RTERROR will cause the command not to be issued. This is because progeCAD broadcasted the fact that it is about to run the ERASE command. The program intercepted ERASE so a different action could be taken. If you wanted to know when the ERASE command had been completed, you could add a case for SDS_CBCMDBEGIN and compare the argument sent by IntellCAD to see if it is what you are looking for.

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