03/02/2018 at 14:40 #2282235
I would like to build an in-house tool for automatic pipeline generation using guidelines created by the user. Idea is to number a given set of guidelines say 01 to 10. The script should then perform the following steps:
(1) Start the ‘Create Pipeline’ Command
(2) Use the mid-points of the lines 01 to 10 in sequence in order to create a pipeline
(3) Size of the pipe must be specified by user
Is it generally possible to do the above using a Python script?
The problem i’m currently facing is the following:
Once I start the ‘Create Pipeline’ command by means of the Python script, the user is prompted to pick the points for creation of the pipeline. I would like to replace this step of picking of the points by automatically specifying the mid-points of lines 01 to 10.
Any help would be highly appreciated!
03/02/2018 at 18:15 #2282236
Here is an example of RhinoPiping scripting with Rhinoscript:
-RP_CreatePipeline _NominalDiameter DN100 _Elbows TabulatedCurvature:VALLOUREC:3D 0,0,0 1500,0,0 1500,0,-800 3000,0,-800 3000,0,-1600 3000,2000,-1600 _Enter
I don’t know about Python script but it should be nearly the same, I assume you woul’d have to call rhinoscriptsyntax.
import rhinoscriptsyntax as rs
03/03/2018 at 16:25 #2282237
Thanks a lot for the tip! This is very helpful!
One last question… The co-ordinates for the points of the pipeline.
Do they need to be entered as values or can they also be entered as variables.
I tried entering them as variables but they aren’t recognized.
Is there something i’m missing?
03/05/2018 at 14:18 #2282239
Hi, basically a rhinoscript is a string (a text) that will be sent in Rhino command line.
If you want the values to be variables, you should buid the appropriate string beforehand.
For exemple (in vbscript):
dim x1,y1,z1, x2, y2, z2 'Variables for location dim MyScript 'Temporary variable where you'll store the script x1=0 y1=20 z1=30 x2=1000 y2=20 z2=20 MyScript = "-RP_CreatePipeline _NominalDiameter DN100 _Elbows TabulatedCurvature:VALLOUREC:3D " & x1 & "," & y1 & "," & z1 & " " & x2 & "," & y2 & "," & z2 & " _Enter" runscript MyScript
03/06/2018 at 11:48 #2282240
Got it! I will try and modify my Python Script to do something similar.
Thanks so much!
You must be logged in to reply to this topic.