Thank you for the explanation! I will try to improve the placment with these functions.oddtopus wrote: ↑Sat Aug 04, 2018 1:37 pm ...
Hi @rus, I think you can refer to functions pipeCmd.portsDir(o) and pipeCmd.portsPos(o), that return an array of Vectors of ports' directions and positions respectively of object "o", respect to the ActiveDocument general origin.
Here directions are defined according the object shape orientation, from the origin of the Shape to the relative position of the port.
If I remember well how I did it, I guess that to place one object respect to a port you can assign to it aand aCode: Select all
Placement.Base=pipeCmd.portsPos(o)[i]
or something like that.Code: Select all
Placement.Rotation=App.Rotation(<your-reference-direction-vector>,pipeCmd.portsDir(o)[i])
...
Not yet, but I will try. Thank is very useful.By the way, did you see the last feature "Insert Any Shape"? It can insert any object from a step file (or iges or brep) and assign to it ports like a native pype object.
Try to insert a ball valve from the samples and then use the "Join pypes" tool...