Hi,
I have a bunch of 3d models that are referenced in a worksession. My goal is to know the reference file path for each referenced object.
All the models and worksession are stored on a remote storage.
Here is my code:
var rc = RhinoGet.GetMultipleObjects("Select objects", false, ObjectType.AnyObject, out ObjRef[] objRefs);
if (rc != Result.Success)
return rc;
var serialNumbers = new List<uint>();
foreach (var objRef in objRefs)
{
var obj = objRef.Object();
if (obj == null) continue;
if (obj.IsReference == false) continue;
serialNumbers.Add(obj.ReferenceModelSerialNumber);
}
var serialNumbersDistinct = serialNumbers.Distinct().ToList();
foreach (var number in serialNumbersDistinct)
{
RhinoApp.WriteLine(number.ToString());
var path = doc.Worksession.ModelPathFromSerialNumber(number);
RhinoApp.WriteLine(path.ToString());
}
return Result.Success;
The call to the doc.Worksession.ModelPathFromSerialNumber
is taking almost 2 minutes per serial number and I don’t understand why: the path of each referenced file is stored in the worksession so it shouldn’t take that long to translate the serial number into a model path.
Any advice on this?
System Info:
Rhino 8 SR17 2025-2-25 (Rhino 8, 8.17.25056.13001, Git hash:master @ 8d674f13b6b22b7c0498dd9ff031d36e49dcd349)
License type: Commercial, build 2025-02-25
License details: LAN Zoo Network Node
Windows 11 (10.0.26100 SR0.0) or greater (Physical RAM: 63GB)
.NET Framework 4.8.9290.0
Computer platform: DESKTOP
Standard graphics configuration.
Primary display and OpenGL: NVIDIA RTX A4000 (NVidia) Memory: 16GB, Driver date: 11-13-2024 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 553.35
> Accelerated graphics device with 4 adapter port(s)
- Secondary monitor attached to adapter port #0
- Windows Main Display attached to adapter port #1
OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
GPU Tessellation is: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU's maximum)
Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High
Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 11-13-2024
Driver Version: 31.0.15.5335
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 16376 MB