draftandfly Posted September 2, 2016 Share Posted September 2, 2016 I am very new to Vectorscript (and first time on the forum) and need help. What I am trying to do is select two 3D locus points in my drawing which represent the start and end of a pipe. I then want to run a script that will calculate the length of the pipe followed by the gradient (as a percentage) and then place a text object above the mid point of the line with the results. I have written a script that works on 2D points and calculates the length of the line and writes the text but after many attempts can't seem to get 3D points to work. Would really appreciate some help from anyone. Quote Link to comment
Hippocode Posted September 3, 2016 Share Posted September 3, 2016 (edited) Have you considered a 3D polygon instead ? You can just draw the centerline/invert of your pipe that way. Say locus one (v0) and locus two (v1) The vector between them is U=v1-v0. The magnitude of U is the length of that segment. The angle depends by which axis but the slope can be calculated by comparing the dz(v1.z-v0.z) with the length. Since you are interested in pipes, we have some improvements coming for our mechanical plug-ins in 2017. All these parameters from the OIP can be shown by tags on the drawing and they update whenever you move the component as well. Edited September 3, 2016 by Hippocode Quote Link to comment
twk Posted September 3, 2016 Share Posted September 3, 2016 15 hours ago, draftandfly said: I am very new to Vectorscript (and first time on the forum) and need help. What I am trying to do is select two 3D locus points in my drawing which represent the start and end of a pipe. I then want to run a script that will calculate the length of the pipe followed by the gradient (as a percentage) and then place a text object above the mid point of the line with the results. I have written a script that works on 2D points and calculates the length of the line and writes the text but after many attempts can't seem to get 3D points to work. Would really appreciate some help from anyone. https://forum.vectorworks.net/index.php?/topic/44934-measure-between-2-3d-points/&do=findComment&comment=228398 its written in Python though, I will attempt to convert back into Vectorscript later on.. Quote Link to comment
draftandfly Posted September 4, 2016 Author Share Posted September 4, 2016 Thanks so much guys, I would be particularly interested in the part of the vectorscript that assigns the 3D point coordinates to a variable so that I can then use them in a formula. Cheers. Quote Link to comment
Hippocode Posted September 4, 2016 Share Posted September 4, 2016 8 hours ago, draftandfly said: Thanks so much guys, I would be particularly interested in the part of the vectorscript that assigns the 3D point coordinates to a variable so that I can then use them in a formula. Cheers. Hi Have a look at this page which clearly describes the difference between a "vector" and other variable types. http://www.vectorlab.info/index.php?title=About_Math_in_Vectorscript Quote Link to comment
Ian M. Posted June 27, 2023 Share Posted June 27, 2023 On 9/3/2016 at 1:07 AM, Hippocode said: Have you considered a 3D polygon instead ? You can just draw the centerline/invert of your pipe that way. Say locus one (v0) and locus two (v1) The vector between them is U=v1-v0. The magnitude of U is the length of that segment. The angle depends by which axis but the slope can be calculated by comparing the dz(v1.z-v0.z) with the length. Since you are interested in pipes, we have some improvements coming for our mechanical plug-ins in 2017. All these parameters from the OIP can be shown by tags on the drawing and they update whenever you move the component as well. What happened to this proposed feature? I am trying to figure out drainage pipe slopes and would love to draw a poly line for the drainage pipe's path, set the end point (the city's curb gutter), then specify a minimum slope for the entire poly line (or pipe object). If the poly line, or pipe object would then display the resulting invert elevations, or if a worksheet would show the vertices, station points, etc. with heights and slopes... 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.