g5 Molinengo Posted March 6 Share Posted March 6 Hello everyone, I need to create a series of spreadsheet folders, divided by project specifications, in which to store the various Sheets that are subsequently created. I therefore created routines in creo I create the folder and then with a separator I move the sheets. I had the scruples to check, before creating the folder, not to use a name already used for another folder (eg texture). I thought about using the command i:= GetTypeN(GetObject('tmp_s')); but always returns 92 for all folder types. Someone can tell me how to do it. Thank you Quote Link to comment
Pat Stanford Posted March 6 Share Posted March 6 It does not matter what the object type is. VW will not let you use the same name for multiple objects or classes. Only Layers have a separate name space. So since there is a Door object, you can't name a class or a resource folder 'Door'. Doors, DoorF, DFolder would all be OK. So I think (not tested) you can just use If GetObject('Name you want to use') <> Nil Then (Pseudo code create folder and move worksheets) Quote Link to comment
g5 Molinengo Posted March 6 Author Share Posted March 6 Thank you, But the concept is that the folder must exist. In practice, spreadsheets are created by executing the I attach images script several times A.pdf B.pdf Quote Link to comment
g5 Molinengo Posted March 12 Author Share Posted March 12 Hello everyone, I couldn't find another solution so I found this solution, a bit artisanal but functioning. If the folder exists I create a test resource, and then I try to move it to the folders with the Setparentt function. If I receive an error I deduce that the folder is incorrect. If it can be useful I attach the script Creation/Placement} proseguo:=True; if Not (PSuff_cartella='') THEN {caso in cui non voglio creare una cartella} begin temp_H0:=GetObject(PSuff_cartella); {ricavo HANDLE da Nome} if temp_H0=NIL THEN begin NameObject(PSuff_cartella); BeginFolderN(ktype); { creo la cartella} EndFolder; temp_H0:=GetObject(PSuff_cartella); {ricavo HANDLE da Nome cartella} end ELSE BEGIN {Controllo che la cartella esistente sia dello stesso tipo della risorsa da creare} nomefoglio:=Concat('Test_',date(1,1)); tempHandle := CreateWS(nomefoglio,1,3); temp_b := SetParent(tempHandle, temp_H0); {sposto il foglio nella cartella } DelObject(tempHandle); nomefoglio:=''; IF temp_b=False THEN {vuol dire che il nome della cartella è già usato da un'altra risorsa} BEGIN proseguo:=FALSE; AlrtDialog(concat('Esiste già una cartella "',PSuff_cartella,'" usata da altre risorse modificare Parametro !!!')); end; end; end; Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.