Tobias Kern Posted November 2, 2022 Share Posted November 2, 2022 Hi VW-User, greetings. Unfortunately, I do not have any experience with scripts yet. I have an idea, but do not know if it is possible to achieve. Often I use symbols with 1 x 1 x 1 cm, in plan I scale these symbol-instances to my needed size. The plan was to get the scaled size into worksheet-reports, but in worksheets, the symbols are reported without my custom scale-factors. All scaled symbols are 1 x 1 x 1 cm in my reporting. For symbols as objects, there are no formulas or other functions to get directly information into worksheets. Now I want to know if it is possible to get the “scale factors” for x, y and z (each separately as own script) with scripts, so that I can use it with “run script” in my worksheets to get accurate reports. / / / It would be great, if we can get functions and formulas for symbol reporting in worksheets directly, without the need of a script. Greetings from Germany Tobi Quote Link to comment
Pat Stanford Posted November 2, 2022 Share Posted November 2, 2022 =OBJECTDATA('OBJECT VARIABLE', 102) This will give you the X scale factor for a scaled symbol. 103 will give you Y, 104 will give you Z. 101 is supposed to return the scaling type (none, Symmetric, Asymetric, probably as 0, 1,2) but in my quick test is is returning something odd instead. 1 Quote Link to comment
MullinRJ Posted November 3, 2022 Share Posted November 3, 2022 To add to @Pat Stanford's reply, ObjVar 101 has an integer value of 1=None, 2=Symmetric, or 3=Asymmetric. ObjVars 102-104 are the XY&Z scaling factors (Real). If ObjVar 101 = 1 (None) then the XY&Z scaling factors = 1. If ObjVar 101 = 2 (Symmetric) then the Y&Z scaling factors = the X Scaling factor. Only when ObjVar 101 = 3 (Asymmetric) do you need to read all two, or three, scaling factors. (X&Y for 2D Symbols, and XY&Z for 3D symbols). Raymond Quote Link to comment
Pat Stanford Posted November 3, 2022 Share Posted November 3, 2022 @MullinRJDid you actually test the return from 101? I did and I do not get the expected 1, 2, 3. I get a large (>1000000) positive or negative integer. Wondering if I did something wrong or if it is broken and needs a bug filed. Quote Link to comment
MullinRJ Posted November 3, 2022 Share Posted November 3, 2022 Hey @Pat Stanford, Did you use GetObjectVariableInt(H, 101), not GetObjectVariableReal(H, 101)? I use it in Reshaper and it's worked for years. I didn't test today, but Reshaper is still working for symbols so I assume these commands are still working as advertised. All the best, Raymond Quote Link to comment
Pat Stanford Posted November 3, 2022 Share Posted November 3, 2022 I used the worksheet equivalent and get funky numbers. Positive and negative hundreds of millions. If it weren't for the negative I would think it was returning the LongInt equivalent of a Handle. =OBJECTDATA('OBJECT VARIABLE', 101) 1 Quote Link to comment
Tobias Kern Posted November 4, 2022 Author Share Posted November 4, 2022 Hi and Mercy beaucoup! I will try it out in the comming days! Greetings from Germany Tobi Quote Link to comment
Tobias Kern Posted November 4, 2022 Author Share Posted November 4, 2022 Hi Pat, is there an overview for all 'object variables'? Greetings Tobi Quote Link to comment
Tobias Kern Posted November 4, 2022 Author Share Posted November 4, 2022 Hi, tried … … and works! Perfect. This solution means a lot for quantity take-offs of "simple" 3D geometries! Greetings and many many Thnx Tobi Quote Link to comment
Tobias Kern Posted November 4, 2022 Author Share Posted November 4, 2022 Hi, I found a overview here: https://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix_G#Symbols … but the "scale factors" are not listed there. It seems the overview is not really complete! Greetings Tobi Quote Link to comment
Pat Stanford Posted November 4, 2022 Share Posted November 4, 2022 Interesting that the online Appendix G is so much shorter than the installed version. In you Applications folder Vectorworks 2021:VWHelp:Script Reference:ScriptFunctionReference.html you will find "All" of the Vectorscript documentation. Click on Additional References at the upper left and then on Script Appendix. There is a fuller version of Appendix G there. Quote Link to comment
MullinRJ Posted November 5, 2022 Share Posted November 5, 2022 On 11/3/2022 at 6:10 PM, Pat Stanford said: I used the worksheet equivalent and get funky numbers. Positive and negative hundreds of millions. If it weren't for the negative I would think it was returning the LongInt equivalent of a Handle. =OBJECTDATA('OBJECT VARIABLE', 101) That's what I like about you @Pat Stanford, you always show me something I wasn't expecting. After looking at it your way, I'd agree — it's a BUG. It should be returning a very small integer. Raymond 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.