Rhino 8 Feature: GH1 Is Now More Than Just Geometry!

UserAtribute_TextConversionToDate.gh (9.8 KB)

Sure, here is the isolated case.

@valentin.belets I’m afraid that I need the Rhino document as well. Alternatively, you could use a Model Object param and internalize the data that way. As it stands now, there is no data that contains user text. Also, to simplify the example, you can just create a single Model Object which contains the issue. No need to internalize all 95 elements.

Sorry about that.

I couldn’t find a way to internalise ModelObject:

But here are the Rhino file and Grasshopper script with 10 Dots example, which are referenced to ModelObject node instead of internalised data.
UserAttribute_TextConversionToDate.gh (5.9 KB)
Pts.3dm (44.8 KB)

I appreciate you looking into it @AndyPayne.

Cheers,
Val.

Please have a look at this modified definition. I believe the issue you were seeing was because of User Text values you had set on your points. Each of your points had a value set to 9.9. (notice the extra decimal at the end). This was causing the comparator in the Order Content component to treat this as a date, rather than a number. I’ve modified the example to show how to assign the points you were trying to create at the bottom of the definitions, numeric values that increase by 1.1 each step. You’ll notice that I pass the number through a Text parameter. I only did this because I was getting precision errors where some of the numeric values were coming back as 3.0000000003 instead of just 3.3. So, I was just casting it to a text value, but you could keep it as a number too. Anyway, please have a look and let me know if you have any questions.

UserAttribute_TextConversionToDate_AP.gh (16.7 KB)

Thanks for that @AndyPayne .

It is still a bit confusing cause U-Text component returns values correctly as Text (even if the value has a dot at the end), but filtering and grouping nodes do that conversion to date.

The less confusing behaviour of all the nodes dealing with UserText would be to respect the object type casting at the moment of assigning the values. Within reason of course.

I guess in my case I’d just have to avoid using text values ending with dots. Might just be a bad practice.

It’s not that you can’t end a value with a period (.). I think the issue here is that you’re starting the value with a number and then you have another period followed by another number and a period (ie. 9.9.). This is very close to something that could be interpreted as a date (ie. 9.9.24). The Order Content and Filter Content components have to compare the values of user text in order to determine where they should fall within the sets of data. So, they have to make a judgement as to what type of data it is so that it can then make the comparison to the rest of the values. In this instance, the values you supplied were interpreted as a date rather than a number. If you had just made the value (9.9) then it would have been treated as a number. If instead, you had made the value (This value is 9.9.) then it would have treated that as a sentence (ie. text). Does this make sense?

Are there plans to expand the referencing toolset to include selections for interactive scripts like Human’s Objects by Selection?
afbeelding
I could see filtering and grouping content based on an “is selected” property:
afbeelding

1 Like

We can include this as a wish list item. I know we have plans to enhance/expand the filtering capability, so perhaps that could be introduced then.

2 Likes

Hello! I want to know why when using the latest export function to export Rhino entities, they still display as line segments even after opening CAD. Here is my code, please help me check and optimize it?

import Rhino
import scriptcontext as sc

import os


temp_doc = Rhino.RhinoDoc.CreateHeadless(None)
wait_export_file = Rhino.FileIO.File3dm.Read(Import_File)

for obj in wait_export_file.Objects:
    temp_doc.Objects.Add(obj.Geometry)


file_name, file_extension = os.path.splitext(Import_File)
output_filepath = file_name + '.dwg'



options = Rhino.FileIO.FileDwgWriteOptions()

options.Version = Rhino.FileIO.FileDwgWriteOptions.AutocadVersion.Acad2007
options.Flatten = 0

options.ExportSurfacesAs = Rhino.FileIO.FileDwgWriteOptions.ExportSurfaceMode.Solids
options.ExportMeshesAs = Rhino.FileIO.FileDwgWriteOptions.ExportMeshMode.Meshes



Rhino.FileIO.FileDwg.Write(output_filepath, temp_doc, options)