CycleThruDir

From scripting
Revision as of 05:21, 22 April 2017 by Nickpisca (talk | contribs) (Created page with " CycleThruDir "C:/MyProjects/Project1/DateModel/SubDir1/OBJ/" 0; global proc CycleThruDir(string $PathStr, int $SubRecBool) { //string $PathStr = "F:/0001dProj/"; if...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
CycleThruDir "C:/MyProjects/Project1/DateModel/SubDir1/OBJ/" 0;


global proc CycleThruDir(string $PathStr, int $SubRecBool) {
	//string $PathStr = "F:/0001dProj/";
	if ($SubRecBool == 1) {
	string $FolderList[] = `getFileList -folder $PathStr`;
	for ($x=0;$x<size($FolderList);$x++) {
		string $CurFolder = $FolderList[$x];
		string $CurPath = $PathStr + $CurFolder + "/";
		CycleThruDir $CurPath $SubRecBool;
	}
	}

	string $FileList[] = `getFileList -folder $PathStr -filespec "*.igs"`;
	for ($y=0;$y<size($FileList);$y++) {
		print ("Importing File:  " + $FileList[$y] + "\n");
		string $CurIGS = $PathStr + $FileList[$y];
		string $buffer[];
  		$numTokens = `tokenize $FileList[$y] "." $buffer`;
		
		file -import -type "IGES" -rpr $buffer[0] $CurIGS;
	}
} 



More information of files and strings, read pages 28-37, 56-58 in YSYT.