Drafix Macro
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Drafix Macro
Post new topic   Reply to topic    CADForums.net Forum Index -> Drafting

Author Message
tvman495



Joined: 27 Apr 2010
Posts: 1

Posted: Tue Apr 27, 2010 1:27 pm    Post subject: Drafix Macro Reply with quote

Hi,

I need hep understanding the Drafix Macro Below. I can't understand where the "patientdetails" is beign pulled from .

Any ideas ???

// Transfers existing patient data from "patientdetails"
// and existing workorder details from common symbols.
// The VB programme can then load the TXF
// and intellegently deal with problems

Display ("cursor", "wait", "Loading Data");

HANDLE
hChan,
hSym,
hDDE,
hEnt;

XY
xySymO,
xyScale;

ANGLE
aAngle;

STRING
sSymName,
sSymSelection,
sPathJOBST,
sWorkOrder,
sWO_TXF,
sCurrentCADFile,
sInitialCADFile,
// Strings are initialized to empty "", this ensures empty strings
// are poked if there is no DB field.
s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s20, s30, s40, s50, s60, s70;

// Start the application and get DDE link
// Find JOB installed directory
//
sPathJOB = GetProfileString("JOB", "PathJOB", "\\JOB", "DRAFIX.INI") ;

Execute ("application", sPathJOB + "\\CADLINK\\CLTXFDIA", "normal");
hDDE = Open ("dde", "cltxfdia", "cltxfdia");
if ( !hDDE) Exit (%abort, "Unable to open \"cltxfdia\" dialogue!") ;

// Get all of the symbols for uploading
//
sSymSelection = "DB SymbolName = 'patientdetails'" ;

hChan = Open ("selection", sSymSelection );
if (hChan && hDDE ) {
ResetSelection(hChan);
// Get Triton eXchange File and Work Order
//
Poke ( hDDE, "txtInvokedFrom", "imageABLE");
GetData ( "UserChar1", &sWO_TXF); // TXF File
Poke ( hDDE, "txtWO_TXF", sWO_TXF);

GetData ( "UserChar2", &sWorkOrder); // Work order
Poke ( hDDE, "txtWorkOrder", sWorkOrder);

GetData ( "UserChar3", &sInitialCADFile ); // The CAD file the Drawing will
Poke ( hDDE, "txtInitialCADFile", sInitialCADFile );// be based on or "NEW" or "INSPECTION"

GetData ("DocFile", &sCurrentCADFile); // The current cad file
Poke ( hDDE, "txtCurrentCADFile", sCurrentCADFile );

// Get Symbol data base fields
//
while (hSym = GetNextSelection(hChan)) {
GetGeometry(hSym, &sSymName, &xySymO, &xyScale, &aAngle);
if(StringCompare(sSymName, "patientdetails" )){
GetDBData( hSym, "fileno", &s1); Poke ( hDDE, "txtFileNo", s1);
GetDBData( hSym, "patient", &s2); Poke ( hDDE, "txtPatientName", s2);
GetDBData( hSym, "age", &s3); Poke ( hDDE, "txtAge", s3);
GetDBData( hSym, "units", &s4); Poke ( hDDE, "txtUnits",s4);
GetDBData( hSym, "sex", &s5); Poke ( hDDE, "txtSex",s5);
GetDBData( hSym, "Diagnosis", &s6); Poke ( hDDE, "txtDiagnosis", s6);
GetDBData( hSym, "WorkOrder", &s7); Poke ( hDDE, "txtMPDwo",s7);
GetDBData( hSym, "orderdate", &sCool; Poke ( hDDE, "txtOrderDate",sCool;
GetDBData( hSym, "TemplateEngineer", &s9); Poke ( hDDE, "txtTemplateEngineer",s9);
Poke ( hDDE, "txtUidMPD", MakeString("long",UID("get",hSym)));
}
}
}

Close ( "selection", hChan);
Close ( "dde", hDDE);

Exit (%ok, "Patient and Work Order Details transfered");

Back to top
View user's profile Send private message
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Drafting All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Access Forum - Microsoft Office Forum - Electronics

Contact Us Powered by phpBB