sle7en7 Posted September 16, 2014 Share Posted September 16, 2014 I was messing with worksheets again to create an areas table with length and width listed but do not want to put the information manually because I'm... umm LAZY, but fell short of the task basically. So after searching the forum a bit, I was unable to find a way to call the Width/Height of a rectangle in a database header. Is there a way to do this (like punching in "=S" to call a symbol's name) or is this information not stored as a default data like area, perimeter or ratio? Thanks for all the help in advance. :blush: Quote Link to comment
michaelk Posted September 16, 2014 Share Posted September 16, 2014 Would you believe =Width and =Height? There are two places to look that will give you all the possible database calls. 1. In VW help search for Retrieving Object Attributes in a Worksheet. That will give you all the cool things like =S for symbol or =T for Type, etc. 2. In the worksheet, click the little triangle under the red X. In the pull down choose Paste Function? That will give you a list of all possible calls. hth mk Quote Link to comment
sle7en7 Posted September 17, 2014 Author Share Posted September 17, 2014 I have been schooled ruthlessly as it seems, thank you very much sir. Never felt dumber Quote Link to comment
Pat Stanford Posted September 17, 2014 Share Posted September 17, 2014 Be careful with the Width and Height commands. They refer to the projection onto the screen, not the object itself. They will work fine if you are working with rectangles that are parallel or perpendicular to the screen, but as soon as you have a rectangle rotated a few degrees it will not give you the dimensions of the rectangle, but rather of the bounding box you would get if you converted the rectangle to a polygon. =Height - Returns the delta Y (height) of objects =Width - Returns the delta X (width) of objects Quote Link to comment
Justin Smith Posted September 17, 2014 Share Posted September 17, 2014 Pat, I've run into that issue myself. Is there a work around to get the actual objects width and height? Quote Link to comment
Pat Stanford Posted September 17, 2014 Share Posted September 17, 2014 (edited) Not that I know of. Sorry, Actually, since this is the Vectorscript forum, the information is valuable with the HHeight and HWidth functions of a script. At least for Rectangles and Ovals which is all I tested this morning. If you then needed that data in a worksheet you could write a script that would attach a custom Record Format to each object and use the above functions to store the VS HHeight and HWidth into the record which could be accessed with a record.field function in the worksheet. The problem is that you would have to remember to run the script every time you changed an object with the attached record. Edited September 17, 2014 by Pat Stanford Quote Link to comment
sle7en7 Posted September 18, 2014 Author Share Posted September 18, 2014 Thank you for the heads up Pat. You think you can send a file with the script you just mentioned? I'm kind of lost at this point but I believe what I'm trying to do is to define the edges of a rectangle in terms of delta Y (height) and delta X (width), so I guess we will write a script in order to accomplish this? Quote Link to comment
Pat Stanford Posted September 19, 2014 Share Posted September 19, 2014 I just posted an example script on the Vectorscript Sharing forum. https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=202373Post202373 Note that this has the same limitations as the rest of VW when it comes to how rectangles are oriented. If your rectangles are rotated after you create them, the Width and Height may not be what you expect them to be, but the two values will be correct. 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.