I have one Custom Curve Preview component connected to a set of curves, and it displays these curves with the chosen color and linetype.
If I then duplicate this component by Alt-dragging, and connect it to another set of curves, these curves are not displayed. If I drag a Custom Curve Preview component fresh from the toolbar and connect it to the second set of curves, it does display these curves.
The same problem occurs when the components are saved to GH file, and re-opened: then they won’t draw curves anymore. Looks like there is an error in serialization/deserialization of this component?
Looks like the linetype parameter is at fault. After deserialization its value is reported to be Model Linetype : Continuous (what I chose when I configured the component), but it is not selected in the list. When I manually select it in the list, the component draws again.
Similar problem here : the "Custom curve Preview component randomly “forgets” which linetype was previously selected and the component is orange when I re-open the file.
I just tested this with the latest internal dev build and it should be serializing the linetypes correctly. We did make a change about a month ago which might have fixed the issue you’re seeing and how persistent data was handled in certain parameters. Can you update to the latest weekly service release and see if this same issue is happening for you?
The problem with serialization has been solved indeedsee my next message for errors with serialization, but the behavior is still not what I expected, this is on 8.6, not the weekly SRC.
Steps:
Open Rhino, draw a curve
Launch Grasshopper, drop curve component, connect to curve just drawn.
Internalize data on curve component, and delete curve from Rhino document.
Drop custom curve preview component
Connect curve to custom curve preview
Attempt to set line type
Result: there is only one line type to choose from:
I was expecting that the line types available from the component would just be a set of line types that you could choose from within Grasshopper, completely unrelated and separate from the Rhino document.
I still see this on version 8.8.24106.18001, 2024-04-15 (even after a Factory Reset)
Also, a bit related, I see the behavior below, a hint to add a name to create a model line type. But this hint only appears if the numbers are connected from a separate number component. If I set them directly on the model line type component, the hint does not appear. Also, I expect not a hint, but a warning: the component does not produce a model line type without a name.
@osuire@menno@wim Ok. I think the primary issue here is that the reference to the linetype is being lost because people are not opening the same Rhino document with their Grasshopper definition. Let me illustrate with an example. Let’s say you have a curve parameter in your Grasshopper definition. You right-click on the parameter and select “Set One Curve” where you then pick a curve from your Rhino file. You then save your Grasshopper file and close the Rhino document for the day. The next day you open a new Rhino document and then open your Grasshopper file. In that case, your curve parameter would throw a warning telling you that it could not find the referenced curve because you’re using a new Grasshopper file and the curve it’s looking for isn’t in the new document. Well, the same thing happens here with the linetypes. If you select a center linetype from the list… it’s going to reference the center linetype from a specific Rhino document. If you then open the Grasshopper file, but don’t use the same Rhino document from before, then the reference will be lost. Does this make sense?
I just test this behavior and everything is working as expected in the latest Rhino service release. Please let me know if you see something different on your machines.
The reason you’re only seeing one linetype is because brand new Rhino documents do not create the standard default linetypes and/or hatches. It was done this way to save the file size of Rhino documents in case you didn’t need to ever use linetypes and/or hatches. To get the standard linetypes and/or hatches to be loaded, you simply need to load one of the Linetypes or Hatches panels, or go to Tools → Options → Linetypes for example. This will then load the default set of linteypes for you and when you go back to your GH definition and hit F5 to recompute your definition, you should then be able to see the full list of linetypes in your parameter.
This seems like if could be a bug. If you could please make a YT for me, I will try to track down what’s happening. The name issue is done correctly. We wanted to make the user aware that a name is needed before a linetype (or really most data types) can be added to the document. It’s shown as a grey “remark” instead of a warning because it should still output a valid linetype that you can use in your GH definition. You just wouldn’t be able to push the linetype to the document with the Content Cache component without having a name. In this particular instance, it looks like it’s not actually returning a linetype until a name is set, which shouldn’t be the case.
Ok. If you open this Grasshopper file along with the Rhino file, does the linetype show up (it should be set to Center). CurveDisplay.3dm (37.6 KB) CurveDisplay.gh (3.1 KB)