twk Posted February 23, 2014 Share Posted February 23, 2014 In the link below Joel talks about using Include files in script/PIO development. He talked about setting Vectorworks to recompile the script at every invocation. How can we do this? VectorLab - Include File Management Quote Link to comment
Hippocode Posted February 23, 2014 Share Posted February 23, 2014 SetPref(407,TRUE); Ideal for testing your changes instantly, but you should disable it afterwards I think its kinda heavy if you reset 100 objects Quote Link to comment
MullinRJ Posted February 23, 2014 Share Posted February 23, 2014 In VW 2013 and earlier, you can also toggle it manually under menu Tools > Scripts > VS Compiler Mode. If you intend to toggle it often, use the SetPref() route. Raymond Quote Link to comment
twk Posted February 23, 2014 Author Share Posted February 23, 2014 (edited) Thanks guys, I'm using a script for this, however I was also looking for it in the Menu's. Appreciate the help. Furthermore on the include file approach, I managed to get the include to point to a file on network drive. However trying to add another include in the code on a network drive throws an error. Working structure: {$INCLUDE L:\VWScripting\PIOCodes\PortalFrame.vss} Procedure PotalFrame; VAR PIOh, hParm, hParmRecord, hWall : HANDLE; PIONameh : STRING; BoolCheck : BOOLEAN; PROCEDURE A_TextureByClass(h: HANDLE); VAR i : INTEGER; BEGIN IF (h <> NIL) THEN IF IsTextureableObject(h) THEN FOR i := 0 TO 2 DO { primary, secondary, tertiary } SetTextureRef(h, -1, i); { -1 as texture ID is "byClass" flag } { walls will need all parts set, roofs only 0 and 1, the rest only 0 } END; <..code continues..> And this compiles nicely. However trying to add an include in that PortalFrame.vss throws an error. The include file is in the same location as the portalFrame.vss Procedure PotalFrame; VAR PIOh, hParm, hParmRecord, hWall : HANDLE; PIONameh : STRING; BoolCheck : BOOLEAN; {$INCLUDE TextureByClass.vss} Error says 'The specified file cannot be found, etc etc' Any idea what I'm doing wrong? Edited February 23, 2014 by TuiWalker Quote Link to comment
Miguel Barrera Posted February 23, 2014 Share Posted February 23, 2014 Have you tried using the complete path instead? Quote Link to comment
twk Posted February 23, 2014 Author Share Posted February 23, 2014 Yes just tried, threw the same error.. Quote Link to comment
MullinRJ Posted February 24, 2014 Share Posted February 24, 2014 If you use absolute paths, you should be able to nest your includes several files deep. I've succeeded nesting 4 levels deep and even get it to work across a network, PC to Mac. Keep playing with it. It should work. At one point I did have to add extra backslashes to the front of the volume name of the Mac address when running from the PC. {$Include \\\minimac\etc. } Not sure if this is pertinent to PC addresses running across a PC network. Raymond Quote Link to comment
twk Posted February 24, 2014 Author Share Posted February 24, 2014 (edited) My bad, I forgot the 'end;' statement from the code I used from the vectorlab subroutines page All Attr By Class working now using the full file path method. FYI, it's pointing to a mapped network drive. Thanks for the help! Edited February 24, 2014 by TuiWalker Quote Link to comment
twk Posted February 24, 2014 Author Share Posted February 24, 2014 Very strange, actually that wasn't the fix. I mean it fixed it, but its stange. Every $include file(sub-include?) I include into the main $include file I need to add an extra 'end;' statement to the code. The subroutine written as code working in the main file: Procedure CustomRect(rectx, recty, Movx, Movy: REAL); Begin Rect(0,recty, rectx, 0); HMove(LNewObj, Movx, Movy); End; However saving this code as a customrect.vss and including it in the main include file won't work unless an extra 'end;' statement is added, like this: Procedure CustomRect(rectx, recty, Movx, Movy: REAL); Begin Rect(0,recty, rectx, 0); HMove(LNewObj, Movx, Movy); End; END; Anyone know why this is so? Quote Link to comment
Hippocode Posted February 25, 2014 Share Posted February 25, 2014 (edited) Not sure If you did this, but remember to add a newline(enter) before and after the code block you include. newline procedure x; BEGIN END; procedure y; BEGIN END; newline If not vs will always give a compile error Edited February 25, 2014 by hippothamus 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.