uvegot2mr Posted October 8, 2004 Share Posted October 8, 2004 I understand the database features of worksheets. The question is how do I assign the realtime X,Y,Z coordinates found in the Object Info window of my symbol to a record attachment automatically? I understand and know how to assign data entry record attachments like "dimmer" or "channel". But realtime X,Y,Z coordinates are different unless I enter them manually based on placement of the fixture. Is there a way to link the realtime X,Y,Z information of the Object Info palette so that the X,Y,Z coordinates are automatically assigned to a record format? Specifically I want to be able to create a database worksheet with this coordinate information for export into 3D visualization software. Maybe the process is much simpler than I can figure. Is there an existent link from the symbol that is not a record attachment recognizable in the paste function of the worksheet? Does anyone know of a script or a process? Greatly appreciated. Quote Link to comment
tom kyler_dup1 Posted October 8, 2004 Share Posted October 8, 2004 If you're looking for an active link that updates XYZ data as you move an object on screen, that isn't going to happen; however, scripting would allow you to select all the items, run the script and have all that data sent to a worksheet in XY & Z columns. You could generate a script that reads the XYZ values all your selected symbols (which would be the center of your symbols) and write that data into records which can then be placed into a worksheet. Quote Link to comment
uvegot2mr Posted October 9, 2004 Author Share Posted October 9, 2004 Thanks Tom. Do you know where I might find some more specifics of building the kind of script you describe? Quote Link to comment
tom kyler_dup1 Posted October 9, 2004 Share Posted October 9, 2004 Well an example script is certainly the best way to learn, if I have time, I'll try to put together an example for you over the weekend. There are a multitude of ways to handle it, but the way I would do it would to be create a record with three fields for X, Y, and Z info. I would then select all the symbols that I wanted X,Y, & Z info for and then run the script. The script would go through all the selected symbols one by one and write the X, Y, and Z values into records attached to all the symbols. Once the X, Y, and Z data is in the database record for each symbol, I would create a worksheet that includes the X,Y, and Z fields. This is an overview of how the script would work, but a sample would explain it better I think. Try the following link for some vectorscript exmaples: http://www.nemetschek.net/support/custom/vscript/example.html Specifically, check out the "intermediate" examples on attaching records to objects. This would be a good start I believe. If I can post some Vectorscript specific to your problem during the weekend, I will. Quote Link to comment
uvegot2mr Posted October 10, 2004 Author Share Posted October 10, 2004 Thank you so much. I appreciate your time and effort. Quote Link to comment
tom kyler_dup1 Posted October 11, 2004 Share Posted October 11, 2004 Ok, here's the script: PROCEDURE GetXYZ; VAR hsymbol :HANDLE; XValue, YValue, ZValue :REAL; BEGIN hsymbol:=FSActLayer; WHILE hsymbol<>NIL DO BEGIN GetSymLoc3D(hsymbol,XValue,YValue,ZValue); SetRField(hsymbol,'XYZData','XValue',num2str(4,XValue)); SetRField(hsymbol,'XYZData','YValue',num2str(4,YValue)); SetRField(hsymbol,'XYZData','ZValue',num2str(4,ZValue)); hsymbol:=NextSObj(hsymbol); END; END; Run(GetXYZ); For the script to work, you have to create a record called "XYZData" and in that record you have to create 3 text fields "XValue" "YValue" and "ZValue". You could set these fields to number, but most import and export formats for 3D programs read text data fine. For the script to work, the symbols you need XY & Z data for need to be selected. When you run the script, all it does is write the XYZ value of the center of the symbol into the record attached to that symbol....and of course the record "XYZData" has to be attached to all these symbols too. Of course you can change the name of the record or the name of the field, or adjust the script to whatever record you may attached to your symbols already. Then if you run a report, you can get all these values into the worksheet and export it. There's some downsides to using the report to get the data into a worksheet, but it's the quickest and easiest. The main problem is that if you have 10 symbols with the same record and you only want 5 of those objects XYZ data, then when you run the report, you'll end up with 10 entries, even though 5 of them may not have XYZ data...but hopefully this will get you in the right direction. Quote Link to comment
uvegot2mr Posted October 12, 2004 Author Share Posted October 12, 2004 Thanks Tom! I will give it a go. I appreciate your time. Quote Link to comment
Don Seidel Posted October 28, 2004 Share Posted October 28, 2004 Similarly, you can link text to record and display the 3 values alongside each symbol. But note that the values here (or in Tom's script) are NOT dynamic. You have to re-run the script whenever you move the objects. Quote Link to comment
Petri Posted October 28, 2004 Share Posted October 28, 2004 And THAT is where the danger hides - and the reason for suggesting the PIO option. Perhaps one could incorporate an update script (using FOREACHOBJECT(doIt, S='locationsymbol')) in a Saved Sheet or a printing command such as my little 'Print and stamp' (date and filename stamps updated, printing launched), but one beautiful day you forget... Well, the latter would be fairly fail-safe if CMD-P would be the shortcut for that and standard Print 'hidden' in a submenu. Whether one uses PIOs or symbols, there is the additional matter of remembering to recalculate the report. Quote Link to comment
Aqueous Posted June 23, 2005 Share Posted June 23, 2005 Tom, many thanks, this proved to be just the job for the conversion of 20,000 points needed for a large terrain model I have been working on. Quote Link to comment
gmcevoy Posted February 9, 2006 Share Posted February 9, 2006 So using this script how would you incorporate referencing to a user set origin. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted February 9, 2006 Vectorworks, Inc Employee Share Posted February 9, 2006 quote: So using this script how would you incorporate referencing to a user set origin. Call GetSymLoc2D(hsymbol,XValue,YValue); after GetSymLoc3D. GetSymLoc2D should account for a user moved origin. Quote Link to comment
gmcevoy Posted February 9, 2006 Share Posted February 9, 2006 Okay, unfortunately I'm really new at the script thing and need a really clear explanation of exactly where it fits in the script. Quote Link to comment
gmcevoy Posted February 11, 2006 Share Posted February 11, 2006 Well, you try for long enough and you are bound to figure it out. Thanks to everybody! 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.