Jump to content

macoovacany

Member
  • Posts

    15
  • Joined

  • Last visited

Everything posted by macoovacany

  1. {$DEBUG} {Vectorscript dies with assigning a user defined type from a Var array from within a procedure. Although I can expand the specific script I'm writing to avoid this situation, I though I mention this is as it appears to be a bug. } PROCEDURE TEST1; TYPE MyType = STRUCTURE f1 :REAL; f2 :REAL; END; VAR arrMyType : DYNARRAY[] of MyType; instMyType : MyType; PROCEDURE proc1(var procarrMyType :DYNARRAY[] of MyType; num:INTEGER); VAR instMyType: MyType; ind : INTEGER; BEGIN FOR ind := 1 to num DO BEGIN {********* VW crashed here *********} instMyType := procarrMyType[ind]; END; END; {Nothing to see here.} FUNCTION ARandomNumber :REAL; VAR ARndmNum :REAL; BEGIN ARndmNum := 10*random; ARndmNum := 10*ARndmNum + 10*random; ARndmNum := 10*ARndmNum + 10*random; ARandomNumber := ARndmNum; END; BEGIN allocate arrMyType[1..10]; arrMyType[1].f1 := ARandomNumber; arrMyType[1].f2 := ARandomNumber; proc1(arrMyType, 1) END; run(test1);
  2. Every so often I have a problem with the vectorscript editor that it doesn't pick up the changes to the script I have made. 1. Write script. 2. Compile >> missing semicolon (for example) 3. Add in semicolon. 4. Compile >> THE SAME ERROR. ----- OK. So another clue. 1. "Select All" the script. 2. Delete (now a blank script). 3. Compile >> THE SAME ERROR. ---- And another clue. 1. Exit the editor. 2. Delete the plug-in. 3. Create a new plug-in with the same name. 4. Open the plugin (blank) 5. Compile >> THE SAME ERROR ---- Has anyone else come across similar behaviour? VW2008 on Mac OS10.4. Cheers, Timbo
  3. Hello all, Is it possible to save a vectorworks file from vectorscript? I know I can open and read/write text files, but I'm looking for something like: {save the changes to another file} SaveFileAs('/users/macoovacany/clients/bob/default.vw'); Thanks, Tim
  4. > Just to clarify, by "plug-in" do you mean plug-in menus, or do you mean objects and tools as well. Most of my plugins are commands similar to: "count the length of classes that have "some-text" in their name, and print the result to layer X using class Y. or "find the text in layer X and parse it to get some numbers. Count the numbers and print to layer Y" or "find the lines in layer X that don't meet spacing requirements and outline them". etc At the moment there are about a dozen of these plugins, and including all their source code into one command plugin seems ugly. All the commands don't require any inputs, so it's just "GO!" for each. I'd like to have a command like RunPlugin('Plugin1'); RunPlugin('Plugin2'); RunPlugin('Plugin3'); RunPlugin('Plugin4'); RunPlugin('Plugin5'); Timbo
  5. RE criteria: All the times I've had to use the criteria it has been of the form (C=?Edged?) ;{Note the C= isn't a part of the string } I didn't think that 'C=Wall' would work. I'll try it shortly. Re foreach: Yeah that's a pattern I use a lot. Either the ForEachObject or ForEachObjectInLayer function. Re running plugins It would be good to have a 'main' plugin which can then customize when to run other plugins. Including a lot source text seems... ugly. It would cut down on the number of menu items that would clutter the menu system, especially if the sub plugin would only be run as part of a batch. Does the DoMenuTextByName function have to ahve the plugin as part of the menu user visible menu Re ResetObject ??? The API reference seems a bit vague as to how this would work with regard to #4. Miguel: My code for this case is almost exactly the same, except I'm using foreachobjectinlayer. Cheers for your replies. Timbo
  6. Thanks. Somehow I missed this in the function reference. Timbo
  7. Before I go ahead and put the following features on the VS wish list, I'd like to check that they are definitely not possible in VS: 1) Functions as first class objects. So I can have and array of functions can call the specific function I need by looking up into an array. At the moment I use a function with a case statement to act the same. (Ugly, but it works.) 2) Expression matching or regular expression matching in criteria. e.g. length(C=Wall[\wa-zA-z0-9]*))l count(L='Battens'& C='TH4055'& hLength<600); 3) Passing criteria in and out of procedures or functions, to generate them at run time. 4) Calling a plug-in command from another plug-in. NOT $include, and not DoMenuTextByName. I'd be grateful for any comments, particularly of the "VS already does this" variety. Timbo Apologies for any syntax errors.
  8. Check the 'Organize Classes' dialog box. I has a similar problem some time ago, where the problem was that that specific classs had been turned off. Timbo
  9. Thanks to MaxStudio and Pat Stanford for their help in the topic "Saved View / Layer". My code now works fine... however: When I add a new design layer, VS adds it as the first layer. It would be good if the stacking order of the new layer could be changed as part of the script. I've had a look in the function API, but there doesn't appear to be anywhere to access the layer stacking order. Have I missed something? VW2008 on Mac OS-X Regards, Timbo (New Topic, New thread)
  10. Thanks. I'll check it out in the next day or two. Timbo
  11. Sorry, How to set the visibilities using vectorscript. Tim {Layers : A1, A2, A3, A4, etc... B1, B2, B3, B4, etc... C1,...etc Titleblock, A Notes, B Notes, C Notes, etc... View: Layers A1 : A1, TitleBlock, A Notes A2 : A2, TitleBlock, A Notes etc C3 : C3, TitleBlock, C Notes} { type stuff ommitted... } n := 11; {actually... iterates through the layers, parse the name of each to determine the last 'A' layer} {create new layer} layer(concat('A', nums2str(0,n))); {create new view} Vsave(concat('A', nums2str(0,n))); {CODE TO SET THE LAYER VISIBILITIES...} .... Thanks in advance.
  12. Hello, Anyone know how to set the layer visibilities on/off for a particular saved view? Timbo
  13. Hello all, Is it possible to run a script when Vectorworks starts up. Regards, Tim
×
×
  • Create New...