Jump to content
Developer Wiki and Function Reference Links ×

Vectorscript HELP with 3D points


draftandfly

Recommended Posts

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.

Link to comment

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.

Screenshot 2016-09-03 10.05.56.png

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 by Hippocode
Link to comment
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..

Link to comment
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

Link to comment
  • 6 years later...
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.

Screenshot 2016-09-03 10.05.56.png

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...  

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...