Due to the difficulty of pipeline design and layout for complex mechanical products, a virtual reality-based method is proposed for pipeline design and routing in virtual environment. A parameter database is established for geometric design of pipelines according to their basic parameters in 3D models. Controlled-points and controlled-vectors are introduced to determine the position and direction of pipelines. Dynamic adjusting algorithm for straight pipelines and elbow pipelines in virtual environment are implemented respectively to joint and layout pipelines according to surrounding environment and features. A pipeline oriented virtual assembly environment system is developed, and some examples are given to demonstrate its function and validation.