nick@e8urban Posted October 7, 2016 Share Posted October 7, 2016 Hi All, I'm trying to work through a bunch of contours imported from GIS information. These contours are all sitting on z=0 and all have an elevation value in their records, but there are thousands of separated lines so elevating all by hand is a large job. I have set up some scripts to select these contours separately, but I would like to add to these scripts, by adding a line that sets the z-value of the selection to the elevation value in the record. I don't need it to be smart or anything.. I just want to know a script that can specify a z-value to multiple 3D Polylines. Help? Thank you in advance. Nick Mac OSX 10.11.6 Vectorworks Architect 2016 Quote Link to comment
JBenghiat Posted October 7, 2016 Share Posted October 7, 2016 Assuming you're setting the z height for the entire object, and it's starting at 0, use Move3DObj http://developer.vectorworks.net/index.php/VS:Move3DObj Move3D will work on selected objects, but you can use ForEachObject to iterate through all your ploys and move by the record value. -Josh Quote Link to comment
nick@e8urban Posted October 7, 2016 Author Share Posted October 7, 2016 Hi Josh, Thank you for your reply. I was looking at move3D, but I wanted something to set the z-value to a definite value. Otherwise I could accidentally run the script twice and ruin myself by compounding mistakes. Otherwise, I could do this and just be careful, but thats not really my strongest suit.. y'know? Nick. Quote Link to comment
JBenghiat Posted October 7, 2016 Share Posted October 7, 2016 Hi Nick, A 3D poly doesn't really have a single z value you can set, as each vertex has its own z height. You could step through the vertices of each object and use SetPolyPt3D to set the 3D location absolutely. You could also add a field to your record that you set after moving the each object, and check before moving. -Josh Quote Link to comment
nick@e8urban Posted October 7, 2016 Author Share Posted October 7, 2016 Hi Josh. Got it.. I understand this, but when I select a single 3d polyline it allows me to enter a z-value for the whole object (which I assume is the lowest point of a '3D object'), but when multiples are selected I don't have this option. I guess your answer above is the reason why. I'll take your first suggestion though. I'll just be careful. Thanks again. Nick. Quote Link to comment
JBenghiat Posted October 7, 2016 Share Posted October 7, 2016 11 hours ago, nick@e8urban said: when I select a single 3d polyline it allows me to enter a z-value for the whole object (which I assume is the lowest point of a '3D object'), but when multiples are selected I don't have this option. Actually what you are seeing in object info is the selected 3D vertex. You use the little black arrows to step through the vertices. You have the option of moving the whole object to the coordinate specified by the selected vertex. If all the vertices are coplanar, that effectively sets the z height. Script Wise, that would be the equivalent of: - Get the coordinates of the first vertex - Move 3D by negative vertex z - Move 3D by the new z value. Or as one statement move by ( newZ - oldZ ) -Josh 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.