コード例 #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);
        }
コード例 #4
0
 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);