FMA Posted April 24 Share Posted April 24 In the function list in Vectorworks there are the commands CE_TransformVector and CE_invTransformVector. They appear to be meant to transform a vector using a matrix (Matrix multiplication). It also says it requires the Handle of the transformation matrix (But I don't know how I can get the handle of a matrix). Has anybody ever used these commands? I can't find anything about them online. I think this might be quite a useful feature if it would be working somehow. Quote Link to comment
Pat Stanford Posted April 25 Share Posted April 25 What function reference are you looking in? I can't find those functions in the version shipping with VW2024 nor in the on-line Developer version. Quote Link to comment
FMA Posted April 25 Author Share Posted April 25 I don't know what it is called but I mean the little command library that you open when you press the first button at the top left within the VS Script interface (Im using VW 2023). In the category Miscellaneous there is CE_TransformVector(h: HANDLE; VAR dx: REAL; VAR dy: REAL; VAR dz: REAL); with the description: 'Transforms a vector using h TransformMatrix' Maybe it doesn't exist in VW 24 Quote Link to comment
Pat Stanford Posted April 25 Share Posted April 25 I do not see those items in the stock VW2024. In the Miscellaneous category of the Script Editor window I do see a number of CW_ functions, but none related to matrices. I know the Computerworks (the German distributor) often prefixes their commands CW_ My guess is the CE_ is something similar and is not provided by Vectorworks directly but rather by the localizer or some other other source. CE_ may very well be Computer Express who I believe is the Swiss distributor. There is not a Miscellaneous category in the stock Function Reference documentation. Quote Link to comment
FMA Posted April 25 Author Share Posted April 25 Okay that's very interesting, I was not aware that there are different Functions depending on the distributor. Quote Link to comment
Pat Stanford Posted April 25 Share Posted April 25 There only are if they have developed them themselves based on some need in their localized content. Anyone can extend Vectorscript by writing a VWLibrary extension. How you would do that beyond the fact that I believe it requires SDK programming is beyond me. There is a CWLibraryUniversal1.vwlibrary that is included in my version of VW. Probably due to the fact that the the Stair tool (and others) are actually CW code that has been licensed back to VW for inclusion in the base version of VW. 1 Quote Link to comment
MullinRJ Posted April 25 Share Posted April 25 The command must be distributor specific. I just placed your command as you defined it in a simple script and got the following syntax error: Line #10: CE_TransformVector(H, dx, dy, dz); | { Error: Identifier not declared. } The same error appears in VW 2023 and 2024. Raymond Quote Link to comment
FMA Posted April 25 Author Share Posted April 25 Yeah, I can get it to work but I have no idea what the matrix handle is supposed to be. Maybe it's just for internal use. Quote Link to comment
MullinRJ Posted April 25 Share Posted April 25 @FMA, Assuming it does exist on your machine, why not try to use it to see what it does? 1) Draw an object. Start simple (line, rect, poly, text, etc.) and work your way up to more complicated objects (symbol, extrude, PIO, etc.) 2) Create a script. PROCEDURE xxx; VAR dx, dy, dz :Real; BEGIN CE_TransformVector(FSActLayer, 1, 1, 1); SysBeep; END; Run(xxx); 3) If it compiles, select one of your objects and run the script. 4) If it doesn't compile, try: PROCEDURE xxx; VAR dx, dy, dz :Real; V :Vector; BEGIN V := CE_TransformVector(FSActLayer, 1, 1, 1); Message(V); SysBeep; END; Run(xxx); 5) If you do get it to compile, try changing the constants for dx, dy, and dz and rerun the script to see what happens. Try (1,0,0), (1,1,0), (1,0,1), (2,1,1); (1,2,1); (1,1,2); etc. 6) Write back if you find anything interesting. Raymond Quote Link to comment
MullinRJ Posted April 25 Share Posted April 25 Also try objects on the Screen Plane vs objects on the Layer Plane. Raymond Quote Link to comment
FMA Posted April 25 Author Share Posted April 25 I think the correct way to go about this would be: PROCEDURE xxx; VAR dx, dy, dz :Real; BEGIN dx:= 2; dy:= 4; dz:= 6; CE_TransformVector(FSActLayer, dx, dy, dz); message(dx, dy, dz); SysBeep; END; Run(xxx); I think the function is supposed to take a coordinate and multiply it with a transformation matrix, the return values will be the new coordinate. However I have tried all kinds of objects, layers etc and the output values always remain the same. I don't know how to get a handle to the matrix. There is a bunch more functions in the category but none of them appear to work with matrices: 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.