Пример #1
0
        void ReconstructDirectShapeByPoint
        (
            DB.Document doc,
            ref DB.Element element,

            Rhino.Geometry.Point3d point
        )
        {
            if (!ThrowIfNotValid(nameof(point), point))
            {
                return;
            }

            if (element is DB.DirectShape ds)
            {
            }
            else
            {
                ds = DB.DirectShape.CreateElement(doc, new DB.ElementId(DB.BuiltInCategory.OST_GenericModel));
            }

            using (var ctx = GeometryEncoder.Context.Push(ds))
            {
                ctx.RuntimeMessage = (severity, message, invalidGeometry) =>
                                     AddGeometryConversionError((GH_RuntimeMessageLevel)severity, message, invalidGeometry);

                var shape = new DB.Point[] { DB.Point.Create(point.ToXYZ()) };
                ds.SetShape(shape);
            }

            ReplaceElement(ref element, ds);
        }
Пример #2
0
        public static DB.Point[] ToPoints(this PointCloud value, double factor)
        {
            var array = new DB.Point[value.Count];
            int index = 0;

            if (factor == 1.0)
            {
                foreach (var point in value)
                {
                    var location = point.Location;
                    array[index++] = DB.Point.Create(new DB::XYZ(location.X, location.Y, location.Z));
                }
            }
            else
            {
                foreach (var point in value)
                {
                    var location = point.Location;
                    array[index++] = DB.Point.Create(new DB::XYZ(location.X * factor, location.Y * factor, location.Z * factor));
                }
            }

            return(array);
        }
Пример #3
0
        void ReconstructDirectShapeByPoint
        (
            DB.Document doc,
            ref DB.Element element,

            Rhino.Geometry.Point3d point
        )
        {
            ThrowIfNotValid(nameof(point), point);

            if (element is DB.DirectShape ds)
            {
            }
            else
            {
                ds = DB.DirectShape.CreateElement(doc, new DB.ElementId(DB.BuiltInCategory.OST_GenericModel));
            }

            var shape = new DB.Point[] { DB.Point.Create(point.ToXYZ()) };

            ds.SetShape(shape);

            ReplaceElement(ref element, ds);
        }
 public static Autodesk.DesignScript.Geometry.Point ToProtoType(this Autodesk.Revit.DB.Point point, bool convertUnits = true)
 {
     return(point.Coord.ToPoint(convertUnits));
 }
Пример #5
0
 public static Autodesk.DesignScript.Geometry.Point ToProtoType(this Autodesk.Revit.DB.Point point)
 {
     return(point.Coord.ToPoint());
 }
Пример #6
0
 private static Autodesk.DesignScript.Geometry.Point InternalConvert(Autodesk.Revit.DB.Point geom)
 {
     return(geom.ToProtoType());
 }
Пример #7
0
 public static Point ToRhino(DB.Point point)
 {
     return(new Point(AsPoint3d(point.Coord)));
 }
Пример #8
0
 public static Point ToPoint(this DB.Point value)
 {
     var rhino = RawDecoder.ToRhino(value); UnitConverter.Scale(rhino, UnitConverter.ToRhinoUnits); return(rhino);
 }
Пример #9
0
 public static Point ToRhino(this DB.Point point)
 {
     return(new Point(point.Coord.ToRhino()));
 }
Пример #10
0
 public static Point ToRhino(this DB.Point point) => RawDecoder.ToRhino(point);