I am using Rino.Inside.Revit 7.0.20309.6003, 11/04/2020
I am not sure why my
args.Display.Draw3dText(text3d, System.Drawing.Color.Black);
text3d does not work for Rhino 7?
Rhino 6
Rhino 7
List<Text3d> text3ds = GetText3ds();
if (text3ds != null)
{
Point3d cameraLocation = RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.CameraLocation;
foreach (Text3d text3d in text3ds)
{
if (text3d == null)
continue;
Point3d point = text3d.TextPlane.Origin;
if (point.DistanceTo(cameraLocation) > 16) continue;
args.Display.Draw3dText(text3d, System.Drawing.Color.Black);
}
}
base.DrawViewportMeshes(args);
}
#endregion IGH_PreviewObject
}
}
dale
(Dale Fugier)
November 11, 2020, 8:25pm
2
@kike - is this something you can help with?
1 Like
@kike let me know if you need any explanation I am happy to assist to get it solved
kike
(Kike Garcia)
February 18, 2021, 6:47pm
4
Hi @michaldengusiak ,
Sorry for the late reply.
Please test this Grasshopper document and tell me if it works for you.
Are you overriding Component.ClippingBox ?
Draw3dText.gh (10.3 KB)
yes your script works fine,
yes, we have ClippingBox included in line 98 of the same code… can you spot any issue there…?
we have clipping box
if (!panel.TryGetValue(name, out text, true))
text = "???";
double value = double.NaN;
if (double.TryParse(text, out value))
text = value.Round(Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance).ToString();
dataAccess.SetData(0, text);
}
public override Rhino.Geometry.BoundingBox ClippingBox
{
get
{
Rhino.Geometry.BoundingBox boundingBox = base.ClippingBox;
List<Text3d> text3ds = GetText3ds();
if (text3ds != null && text3ds.Count != 0)
{
foreach (Text3d text3d in text3ds)
{
kike
(Kike Garcia)
February 18, 2021, 8:45pm
6
You are calling Draw3dText from GH_Component.DrawViewportMeshes I would try doing it from GH_Component.DrawViewportWires .
OK we tested two method and it still does not work…
I mean it works on Rhino 6 but it does not on Rhino 7…
if (point.DistanceTo(cameraLocation) > 16)
continue;
args.Display.Draw3dText(text3d, System.Drawing.Color.Black);
}
}
base.DrawViewportMeshes(args);
}
public override void DrawViewportWires(IGH_PreviewArgs args)
{
List<Text3d> text3ds = GetText3ds();
if (text3ds != null)
{
Point3d cameraLocation = RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.CameraLocation;
foreach (Text3d text3d in text3ds)
{
if (text3d == null)
continue;
any idea what could be wrong …we still unable to get it to work
kike
(Kike Garcia)
March 12, 2021, 11:21am
9
What happens if you draw the texts a bit offseted from the planes?
I’m wondering if is a z-fighting problem.
we implemented, move along normal vector and still the same issue
we tested again on Rhino 6 and is working perfectly and Rhino 7 is not.
We also added baking and works fine in Rhino 6 and in Rhino 7 give some very thing sth that we can not zoom into or select…it disappears when zoon in or out
We strongly belive is Rhino 7 issue as it works perfectly on Rhino 6.
as we tested today…this must be Rhino 7 issue here is video with 1 element in Rhino 6 and Rhino 7