Is there a list of new items in RhinoCommon 8?
7.0 has this: https://mcneel-apidocs.herokuapp.com/api/rhinocommon/whatsnew/7.0
Is there a list of new items in RhinoCommon 8?
7.0 has this: https://mcneel-apidocs.herokuapp.com/api/rhinocommon/whatsnew/7.0
We’re still working on a new site for the RhinoCommon 8 API, but we have recently updated the what’s new list at
https://mcneel-apidocs.herokuapp.com/api/rhinocommon/whatsnew/8.0
Hi, can this site also support api for grasshopper2?
This site is still very much a work in progress. It was designed so we could eventually support any of our APIs.
Any chance to add access to Containers or the new curve thickness settings? The DisplayAttributes.CurveThickness property and is no longer setting the curve thickness, so there must be an unlisted way to access the new scale property.
Can you provide a small sample that works in 7 but not in 8?
Sure, I will leave a sample command below. This will accept an open curve as input and set the curve thickness to 25 assuming you have the wireframe display mode selected.
// Curve Thickness Command
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
var go = new GetObject();
go.AcceptNothing(false);
// Get Curve from Document
while(go.Result() != GetResult.Object)
{
go.Get();
if (go.Result() == GetResult.Cancel)
{
return Result.Failure;
}
}
// Get current display mode
var currentDisplayMode = RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.DisplayMode;
// Change curve thickness
currentDisplayMode.DisplayAttributes.CurveThickness = 25;
DisplayModeDescription.UpdateDisplayMode(currentDisplayMode);
RhinoDoc.ActiveDoc.Views.Redraw();
return Result.Success;
}
Thanks; I see what is happening. Rhino 8 display modes have object thicknesses come directly from the objects themselves by default. If you change your display mode to have a curve thickness usage of “Pixels” instead of “Use Object’s Width”, then your sample code should work.
I added a bug to the list to expose these usage properties in RhinoCommon
https://mcneel.myjetbrains.com/youtrack/issue/RH-77652
Understood, but another issue is how we would change “Curve Width Usage” setting to Pixels using RhinoCommon. Considering this is a new default, there should be a way to change it without making a user access the rhino settings. I didn’t see a new property added for any relevant classes, is this going to be added?
Edit: Misunderstood ThicknessUsage to be the scale amount, disregard the above. Thank you for the help!
That is the topic of the bug that I added a link for.
RH-77652 is fixed in Rhino 8 Service Release 4 Release Candidate