Beispiel #1
0
        private vdPolyface CreatePolyFaceFromCurve(vdPolyline curvePath, double diameter)
        {
            var pf = new vdPolyface();

            pf.SetUnRegisterDocument(vDraw.ActiveDocument);
            pf.setDocumentDefaults();

            var circle = new vdCircle {
                Radius = diameter / 2.0
            };

            vdCurve path = curvePath;

            if (curvePath.VertexList.Count == 2)
            {
                var line = new vdLine();
                line.SetUnRegisterDocument(vDraw.ActiveDocument);
                line.setDocumentDefaults();
                line.StartPoint = curvePath.getStartPoint();
                line.EndPoint   = curvePath.getEndPoint();
                path            = line;
            }

            pf.Generate3dPathSection(path, circle, new gPoint(0, 0, 0), 6, 1);
            pf.SmoothAngle         = 45;
            pf.PenColor.ColorIndex = 2;
            vDraw.ActiveDocument.ActiveLayOut.Entities.Add(pf);

            return(pf);
        }
Beispiel #2
0
        private void AddPipeToEntities(vdEntities entities, double diameter, gPoint ptStart, gPoint ptEnd, string layerName)
        {
            var pf = new vdPolyface();

            pf.SetUnRegisterDocument(vDraw.ActiveDocument);
            pf.setDocumentDefaults();

            var line   = new vdLine(ptStart, ptEnd);
            var circle = new vdCircle
            {
                Radius = diameter / 2.0
            };

            pf.Generate3dPathSection(line, circle, new gPoint(0, 0, 0), 6, 1);
            pf.Layer       = vDraw.ActiveDocument.Layers.FindName(layerName);
            pf.SmoothAngle = 45;
            entities.Add(pf);
        }