Petri Posted January 5, 2007 Share Posted January 5, 2007 I can't figure out how to save a file with a name generated in a script. My last hurrah was to create a text object with the file name and copy that to the clipboard, for the user to paste in the dialog, but (of course) even that failed. I've even copied the text by selecting the text in a text object and it has not crossed Jordan to the Save-dialog. The only AppleScript event we have is DoScript. No VW-specific AS-library, no way to do even the most basic file operations. If Windows-compatibility means lack of capabilities for all, why do the Rest of Us need to suffer? Quote Link to comment
Rick Francken Posted January 5, 2007 Share Posted January 5, 2007 Petri, Are you saving a text file or a VW drawing? Quote Link to comment
Petri Posted January 5, 2007 Author Share Posted January 5, 2007 VW files. I want to create files, "do stuff" and save & export them. Should we have a decent AppleScript-library, someone cleverer than myself might be able to do this. It's no exactly rocket science. Quote Link to comment
Rick Francken Posted January 5, 2007 Share Posted January 5, 2007 If you are going the route of dialogs, have you tried the "GetFileN" function? FUNCTION GetFileN(title :STRING; defaultFolder :STRING; mask :STRING; VAR fileName :STRING) :BOOLEAN; Also, does the "SaveActiveDocument" function work? FUNCTION SaveActiveDocument(filePath :STRING) :LONGINT; I have not tried SaveActiveDocument yet, but I have used GetFileN and passed in a generated file name. Quote Link to comment
Petri Posted January 5, 2007 Author Share Posted January 5, 2007 Looks promising for "step 1". I don't think I've used GetFileN, definitely not SaveActiveDocument. Little by little, step by step: now I still need to Export as DWG... or rather as Industry Foundation Classes! Quote Link to comment
Rick Francken Posted January 5, 2007 Share Posted January 5, 2007 ..now I still need to Export as DWG... or rather as Industry Foundation Classes! Hmmm. Well I wrote a DXF exporter and an EJE and Fabtrol KISS exporter for a structural steel application some years ago. There is an IFC XML schema. And it looks like Vectorscript can read and write XML. If somebody will pay me to do it, I can develop an IFC import/export program. Cheers, Quote Link to comment
Petri Posted January 6, 2007 Author Share Posted January 6, 2007 Actually, the IFC XML might be quite an interesting one. It might be a means of exporting non-graphic data to non-CAD -programs directly. I once wrote a MapInfo export translator which, among other things, translated graphic data to non-graphic. One version created graphic data that did not correspond to VW data at all, except for the location. The representation was done in the translation. I think there could well be a future market for intelligent translators. The DXF/DWG format is, after all, extremely dumb data dumping - so dumb that even Autodesk does not support translation from AutoCAD to Revit. This comment is not intended to belittle the heroic efforts of countless talented programmers who - under the auspices of Open DWG Alliance and NNA - have been able to make sense of DXF/DWG and introduce syntactic structures well beyond the capabilities of Autodesk programmers and lexical translations in which the toddler-speak of AutoCAD has been interpreted as something meaningful. Quote Link to comment
supermannetje Posted January 10, 2007 Share Posted January 10, 2007 (edited) SaveActiveDocument works for me. It returns -1 if the document already exists and a zero if it doesn't. (And it saves the document...) {start} Procedure Saveme; VAR en:STRING; nu:LONGINT; BEGIN nu:=SaveActiveDocument('testdoc'); en:=Num2Str(0,nu); AlertInform('output:',en,TRUE); END; RUN (Saveme); {end} Edited January 10, 2007 by supermannetje Quote Link to comment
Petri Posted January 10, 2007 Author Share Posted January 10, 2007 OK, thanks to all. Now the only thing that is missing is Batch Export as DXF/DWG. I can generate the scripts in FileMaker Pro and even run them directly from FMP - but in this case I don't have use for a series of VW files. The idea is to be able to split a VW symbol library document into individual AutoCAD-files. Possibly also doing "symbol assemblies" on the fly. Quote Link to comment
Rick Francken Posted January 10, 2007 Share Posted January 10, 2007 Petri, how complex are the symbols? Can you export the symbol library document successfully as one single AutoCAD drawing where the AutoCAD block definitions are consistent with the Vectorworks symbol definitions? If you can export an uncorrupted AutoCAD drawing, it might be easier to write a simple LISP or VBA routine that will split them into individual AutoCAD files. Regards, Quote Link to comment
Petri Posted January 10, 2007 Author Share Posted January 10, 2007 Simple LISP... Actually, my situation would be fixed with "Save Design Layers as Files" -option in DXF/DWG -export. I'm sure many others could use this as well when exporting stuff to consultants & clients. The reverse can be done. 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.