Drafix Macro Help
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 
 
Google
 
Web cadforums.net
Drafix Macro Help

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Drafting
Author Message
Alex Charles
Guest





Posted: Sun Mar 13, 2005 10:42 pm    Post subject: Drafix Macro Help Reply with quote

I need some help using a Macro to run in Drafix Cad to convert .cad
files to .dwg. I found a pretty close example in the help menu and tried to
modify it to do a mass convert and it almost works. It converts the files
and I can read the resulting .dwg in Quickcad but AcadLT97 and
VoloviewExpress 2.01 both complain about invalid file format. Now here is
the kicker, If I convert the files individually in Drafix all three apps can
open the resulting .dwg no problem. Any help appreciated. (macro below)

Thanks
Alex



Macro below:
______________

NUMBER nLengthLessExtension;

STRING sImportFileSpec, sImportFullPath, sImportFileName, sImportFilter;
STRING sConvertDirectory, sExportFileName, sExportFilter, sExportExtension;
HANDLE hPath, hFile;

sConvertDirectory = "C:\\CAD\\CONVERT\\"; //NOTE: "\\" enters "\"
sImportFileSpec = "*.CAD";
sExportExtension = ".DWG";
sImportFilter = "cad";
sExportFilter = "dwg";
sImportFullPath = sConvertDirectory + sImportFileSpec;
SetData("PathDrawing", sConvertDirectory);

procedure PROC_OpenConvertClose()

{

hFile = Import("drawing", sImportFileName, sImportFilter);
nLengthLessExtension = StringLength(sImportFileName) - 4;

sExportFileName = StringMiddle(sImportFileName, 1, nLengthLessExtension) +
sExportExtension;

Export("drawing", sExportFileName, sExportFilter);
Execute("menu", "FileClose");

}

if(hPath = Open("directory", sImportFullPath, "normal"))
{

while (GetNextFile(hPath, &sImportFileName))

PROC_OpenConvertClose();

Close("directory", hPath);

}
Exit(%ok, "Finished running macro.");

Back to top
 
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




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB