Using Linq in C# scripting component


In the latest Rhino 8 WIP, the C# scripting component doesn’t seem like recognizing the ‘using’ statement complaining about the missing reference.

Hi @woojsung,

The attached seems to work. (4.7 KB)

– Dale

Hi @dale

Maybe it is my installation - I am getting the same error message.

fresh installation might help do you think?

Hi @woojsung,

I just noticed your running on a Mac. Does this work in V7? Can you run the SystemInfo command and post the results?

— Dale

Oh. Right I am on a Mac, it works fine on v7

2022년 4월 28일 (목) 오전 11:05, Dale Fugier via McNeel Forum <>님이 작성:

In the Rhino WIP, please run the SystemInfo command and post the results.

— Dale


Here you are. Thank you.
If you can take a look at the new C# scripting component’s copy and paste issue (doesn’t work) that would be great!

Rhino 8 SR0 2022-4-26 (Rhino WIP, 8.0.22116.12306, Git hash:master @ 03d671c58e622c1af59c363b7c31025cf8e0f70b)
License type: Commercial, build 2022-04-26
License details: Cloud Zoo
Expires on: 2022-06-10

Apple macOS Version 12.3.1 (Build 21E258) (Physical RAM: 32Gb)
Mac Model Identifier: MacBookPro16,4
Language: en-KR (MacOS default)

AMD Radeon Pro 5600M OpenGL Engine (OpenGL ver:4.1 ATI-4.8.15)

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On

Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High

Vendor Name: ATI Technologies Inc.
Render version: 4.1
Shading Language: 4.10
Maximum Texture size: 16384 x 16384
Z-Buffer depth: n/a
Maximum Viewport size: 16384 x 16384
Total Video Memory: 8176 MB
Graphics: AMD Radeon Pro 5600M
Displays: Color LCD (264dpi 2x), U3277WB (219dpi 2x)

Graphics processors
Intel UHD Graphics 630 (1536 MB)
AMD Radeon Pro 5600M (8 GB)
Color LCD (1792 x 1120 @ 59.00Hz)
U3277WB (3008 x 1692 @ 60.00Hz)

USB devices
Apple: composite_device
Apple Inc.: Touch Bar Backlight
Apple Inc.: Touch Bar Display
Apple Inc.: Apple Internal Keyboard / Trackpad
Apple: Headset
Apple Inc.: Ambient Light Sensor
Apple Inc.: FaceTime HD Camera (Built-in)
Apple Inc.: Apple T2 Controller

Bluetooth devices

Third party kernel extensions (3.7.0) 35E739F9-BF6C-3024-A67C-750711B3FB64
com.CalDigit.ThunderboltStationChargingSupport (1.2) 93581301-3B34-39B8-803B-E2F733B2D0D1

Third party plugins

Rhino plugins that do not ship with Rhino
/Users/woojsung/Library/Application Support/McNeel/Rhinoceros/MacPlugIns/Twinmotion Direct Link 2020.2.rhp “Twinmotion Direct Link 2020”

Rhino plugins that ship with Rhino
/Applications/ “RhinoCycles” 8.0.22116.12306
/Applications/ “Snapshots” 8.0.22116.1002
/Applications/ “RhinoRoslyn” 8.0.22116.12306
/Applications/ “Constraints” 8.0.22116.1002
/Applications/ “Constraints UI” 8.0.22116.12306
/Applications/ “Grasshopper” 8.0.22116.12306
/Applications/ “PanelingTools” 8.0.22116.1002
/Applications/ “Commands” 8.0.22116.12306
/Applications/ “Renderer Development Kit” 8.0.22116.1002
/Applications/ “RhinoCPython” 8.0.22116.12306
/Applications/ “RDK_EtoUI” 8.0.22116.12306
/Applications/ “Displacement” 8.0.22116.1002
/Applications/ “Rhino Render” 8.0.22116.12306
/Applications/ “IronPython” 8.0.22116.12306
/Applications/ “RhinoCodePlugin” 8.0.22116.12306

Hi @woojsung,

I can repeat this - I’ve logged the issue.


– Dale

RH-68472 is fixed in the latest WIP

Thanks for the reply. However, Linq still doesn’t work. Please see attached.

I am on Version 8 WIP (8.0.22130.14236, 2022-05-10) updated just now.

Also, line number reporting doesn’t work reporting incorrect numbers, and most importantly copy and paste in the editor doesn’t work. Any chance to use dark mode in the editor?


That is not a problem with LINQ. You need to add using System.Collections.Generic so you can use List<>.

It is already there.

Yes, sorry, I just realized it myself. After a bit of testing it looks like the SQL-like syntax works just fine:

@curtisw any idea why the extension methods from LINQ don’t work? They don’t even autocomplete when typing code. Maybe missing an assembly reference for collections to have these work?

No worries. I think the issue is with ToList(). Please see attached. Thanks,

Also as it is really important to me, could you please take a look at the other issues with the new code editor?

Quite possible. But it should still work (: In this particular case you indeed don’t need it, sorting works without the ToList() just fine.

That’s right. But sometimes I need to use the method in Linq, which is problematic with many existing codes.

Could someone please take a look at this?

Also, again, the other issues with the new code editor should receive more love.

I believe that @Alain and @curtisw are the best people to look at this.


Yes, that’s the problem. Thanks

All these other issues are being worked on and will be fixed soon.
Thanks for the feedback.

1 Like