Vector In Vic Posted September 29, 2003 Share Posted September 29, 2003 Is there a way to export all the class names in a drawing to a text file? Maybe a VectorScript or something? Quote Link to comment
kiwi Posted September 29, 2003 Share Posted September 29, 2003 try this vs (bit crude, but does the job!) He will not write the guides class. Procedure TheClass; VAR n,a: LONGINT; fn: STRING; Mcl: DYNARRAY [] OF STRING; BEGIN n:=ClassNum; a:=1; ALLOCATE Mcl [1..n]; REPEAT Mcl[a]:=ClassList(a); a:=a+1; UNTIL (a=n); a:=1; PutFile('Select the file','New File',fn); Message(fn); IF NOT DidCancel THEN REPEAT WriteLn(Mcl[a]); a:=a+1; UNTIL (a=n); Close('class.txt'); END; Run(TheClass); Quote Link to comment
MullinRJ Posted September 30, 2003 Share Posted September 30, 2003 kiwi, The "Guides" class is probably not showing because it was the last class created. You are exiting your repeat loops just before the last element is processed. Try changing the two UNTIL (a=n) statements to UNTIL (a>n). This will print all the classes. Best wishes, Raymond Quote Link to comment
kiwi Posted September 30, 2003 Share Posted September 30, 2003 Yeah! And I've been thinking for a little while why the guides wouldn't show... the original script lists objects with a WHILE (<>NIL): I should be more careful. The Close('class.txt') is wrong and should be replace by Close(fn). The PutFile('Select the file','New File',fn); save the file as a text doc, but even adding the .txt ('New File.txt') the file still try to open on VW: Any idea why? is a bit annoying to try to check a list of groups of objects and, if I forget to "open with", get a error message and a new doc in VW. 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.