diff --git a/rhinocommon/cs/SampleCsCommands/Properties/AssemblyInfo.cs b/rhinocommon/cs/SampleCsCommands/Properties/AssemblyInfo.cs index 563484d2..082fcaf8 100644 --- a/rhinocommon/cs/SampleCsCommands/Properties/AssemblyInfo.cs +++ b/rhinocommon/cs/SampleCsCommands/Properties/AssemblyInfo.cs @@ -1,48 +1,18 @@ -using System.Reflection; +using Rhino.PlugIns; +using System.Reflection; using System.Runtime.InteropServices; -using Rhino.PlugIns; -// Plug-in Description Attributes - all of these are optional -// These will show in Rhino's option dialog, in the tab Plug-ins -[assembly: PlugInDescription(DescriptionType.Address, "3670 Woodland Park Avenue North\r\nSeattle, WA 98103")] +[assembly: PlugInDescription(DescriptionType.Address, "146 North Canal Street, Suite 320\r\nSeattle, WA 98103")] [assembly: PlugInDescription(DescriptionType.Country, "United States")] -[assembly: PlugInDescription(DescriptionType.Email, "devsupport@mcneel.com")] +[assembly: PlugInDescription(DescriptionType.Email, "dale@mcneel.com")] [assembly: PlugInDescription(DescriptionType.Phone, "206-545-6877")] [assembly: PlugInDescription(DescriptionType.Fax, "206-545-7321")] [assembly: PlugInDescription(DescriptionType.Organization, "Robert McNeel & Associates")] [assembly: PlugInDescription(DescriptionType.UpdateUrl, "https://github.com/mcneel/rhino-developer-samples")] -[assembly: PlugInDescription(DescriptionType.WebSite, "http://www.rhino3d.com/")] +[assembly: PlugInDescription(DescriptionType.WebSite, "https://github.com/mcneel/rhino-developer-samples")] [assembly: PlugInDescription(DescriptionType.Icon, "SampleCsCommands.Resources.SampleCs.ico")] -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SampleCsCommands")] // Plug-In title is extracted from this -[assembly: AssemblyDescription("RhinoCommon Sample - SampleCsCommands")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Robert McNeel & Associates")] -[assembly: AssemblyProduct("SampleCsCommands")] -[assembly: AssemblyCopyright("Copyright © 2017, Robert McNeel & Associates")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4d58b9ad-7cfd-47c2-b250-f44001d2cf9f")] // This will also be the Guid of the Rhino plug-in - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.0.0.0")] +[assembly: Guid("4D58B9AD-7CFD-47C2-B250-F44001D2CF9F")] diff --git a/rhinocommon/cs/SampleCsCommands/Properties/launchSettings.json b/rhinocommon/cs/SampleCsCommands/Properties/launchSettings.json new file mode 100644 index 00000000..1eef7cd6 --- /dev/null +++ b/rhinocommon/cs/SampleCsCommands/Properties/launchSettings.json @@ -0,0 +1,14 @@ +{ + "profiles": { + "Rhino 8 (net7.0)": { + "commandName": "Executable", + "executablePath": "C:\\Program Files\\Rhino 8\\System\\Rhino.exe", + "commandLineArgs": "/netcore" + }, + "Rhino 8 net48)": { + "commandName": "Executable", + "executablePath": "C:\\Program Files\\Rhino 8\\System\\Rhino.exe", + "commandLineArgs": "/netfx" + } + } +} \ No newline at end of file diff --git a/rhinocommon/cs/SampleCsCommands/SampleCsClipboard.cs b/rhinocommon/cs/SampleCsCommands/SampleCsClipboard.cs index d44791a9..c2f271ce 100644 --- a/rhinocommon/cs/SampleCsCommands/SampleCsClipboard.cs +++ b/rhinocommon/cs/SampleCsCommands/SampleCsClipboard.cs @@ -98,7 +98,7 @@ private static byte[] GeometryBaseToBytes(GeometryBase src) if (null == src) return null; - var rc = new byte[0]; + var rc = Array.Empty(); try { var formatter = new BinaryFormatter(); diff --git a/rhinocommon/cs/SampleCsCommands/SampleCsCommands.csproj b/rhinocommon/cs/SampleCsCommands/SampleCsCommands.csproj index df69e394..87ccca52 100644 --- a/rhinocommon/cs/SampleCsCommands/SampleCsCommands.csproj +++ b/rhinocommon/cs/SampleCsCommands/SampleCsCommands.csproj @@ -1,290 +1,36 @@ - - + - Debug32 - AnyCPU - 8.0.30703 - 2.0 - {C1498326-89AB-48B0-A148-290C169CAA68} + net7.0-windows;net48 + true + .rhp + ..\Bin\ Library - Properties - SampleCsCommands - SampleCsCommands - v4.8 - 512 - false - + Robert McNeel & Associates + Copyright © 2013-2024, Robert McNeel & Associates + SampleCsUserData + Sample Commands Plug-in + 8.0.0 - - true - full - false - ..\bin\ - DEBUG;TRACE - prompt - false + + 1701;1702;NU1701 - - pdbonly - true - ..\bin\ - TRACE - prompt - 4 - false + + 1701;1702;NU1701 + + + 1701;1702;NU1701 + + + 1701;1702;NU1701 - - C:\Program Files\Rhino 7\System\Eto.dll - False - - - C:\Program Files\Rhino 7\System\Rhino.UI.dll - False - - - C:\Program Files\Rhino 7\System\RhinoCommon.dll - False - - - C:\Program Files\Rhino 7\System\RhinoWindows.dll - False - - - - - - - - - C:\Program Files\Rhino 7\Plug-ins\Xfinium.Pdf.Win.dll - - - - - True - True - Resources.resx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - + - + + - + - - - - Copy "$(TargetPath)" "$(TargetDir)$(ProjectName).rhp" -Erase "$(TargetPath)" - - - en-US - - - C:\Program Files\Rhino WIP\System\Rhino.exe - - - Program - false - \ No newline at end of file diff --git a/rhinocommon/cs/SampleCsCommands/SampleCsContourMesh.cs b/rhinocommon/cs/SampleCsCommands/SampleCsContourMesh.cs index db8743c8..87738b45 100644 --- a/rhinocommon/cs/SampleCsCommands/SampleCsContourMesh.cs +++ b/rhinocommon/cs/SampleCsCommands/SampleCsContourMesh.cs @@ -25,7 +25,7 @@ protected override Result RunCommand(RhinoDoc doc, RunMode mode) Rhino.Geometry.Point3d end_pt = bbox.Corner(false, true, true); double interval = start_pt.DistanceTo(end_pt) / 10; - Rhino.Geometry.Curve[] curves = Rhino.Geometry.Mesh.CreateContourCurves(mesh, start_pt, end_pt, interval); + Rhino.Geometry.Curve[] curves = Rhino.Geometry.Mesh.CreateContourCurves(mesh, start_pt, end_pt, interval, doc.ModelAbsoluteTolerance); if (null != curves && curves.Length > 0) { for (int i = 0; i < curves.Length; i++) diff --git a/rhinocommon/cs/SampleCsCommands/SampleCsExtrudeMeshFace.cs b/rhinocommon/cs/SampleCsCommands/SampleCsExtrudeMeshFace.cs index f3a6f086..fcd6f7eb 100644 --- a/rhinocommon/cs/SampleCsCommands/SampleCsExtrudeMeshFace.cs +++ b/rhinocommon/cs/SampleCsCommands/SampleCsExtrudeMeshFace.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using Rhino; +using Rhino; using Rhino.Commands; using Rhino.DocObjects; using Rhino.Geometry; diff --git a/rhinocommon/cs/SampleCsCommands/SampleCsGumballCylinder.cs b/rhinocommon/cs/SampleCsCommands/SampleCsGumballCylinder.cs index 50869632..156f408b 100644 --- a/rhinocommon/cs/SampleCsCommands/SampleCsGumballCylinder.cs +++ b/rhinocommon/cs/SampleCsCommands/SampleCsGumballCylinder.cs @@ -41,8 +41,8 @@ protected override Result RunCommand(RhinoDoc doc, RunMode mode) var radius_go = new GumballObject(); var height_go = new GumballObject(); - var radius_dc = new GumballDisplayConduit(); - var height_dc = new GumballDisplayConduit(); + var radius_dc = new GumballDisplayConduit(Rhino.DocObjects.ActiveSpace.ModelSpace); + var height_dc = new GumballDisplayConduit(Rhino.DocObjects.ActiveSpace.ModelSpace); var radius_gas = RadiusGumballAppearanceSettings(); var height_gas = HeightGumballAppearanceSettings(); diff --git a/rhinocommon/cs/SampleCsCommands/SampleCsMeshOutline.cs b/rhinocommon/cs/SampleCsCommands/SampleCsMeshOutline.cs index 5da34439..4ab264bf 100644 --- a/rhinocommon/cs/SampleCsCommands/SampleCsMeshOutline.cs +++ b/rhinocommon/cs/SampleCsCommands/SampleCsMeshOutline.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; +using System.Linq; using Rhino; using Rhino.Commands; using Rhino.Display; using Rhino.DocObjects; using Rhino.Geometry; -using Rhino.Input; using Rhino.Input.Custom; namespace SampleCsCommands @@ -44,14 +44,18 @@ protected override Result RunCommand(RhinoDoc doc, RunMode mode) if (InObjects.Count > 0) { - var meshRefs = RhinoObject.GetRenderMeshes(InObjects, true, false); - if (null != meshRefs) + var flags = Rhino.Render.CustomRenderMeshes.RenderMeshProvider.Flags.Recursive; + foreach (RhinoObject obj in InObjects) { - for (int i = 0; i < meshRefs.Length; i++) + var meshRefs = obj.RenderMeshes(MeshType.Render, null, null, ref flags, null, null).ToArray(); + if (null != meshRefs) { - Mesh mesh = meshRefs[i].Mesh(); - if (null != mesh) - InMeshes.Add(mesh); + for (int i = 0; i < meshRefs.Length; i++) + { + Mesh mesh = meshRefs[i].Mesh; + if (null != mesh) + InMeshes.Add(mesh); + } } } } diff --git a/rhinocommon/cs/SampleCsCommands/SampleCsWrite3dmFile.cs b/rhinocommon/cs/SampleCsCommands/SampleCsWrite3dmFile.cs index 85da988d..c35bdfb5 100644 --- a/rhinocommon/cs/SampleCsCommands/SampleCsWrite3dmFile.cs +++ b/rhinocommon/cs/SampleCsCommands/SampleCsWrite3dmFile.cs @@ -1,5 +1,4 @@ -using System; -using System.Drawing; +using System.Drawing; using System.IO; using Rhino; using Rhino.Commands; @@ -15,7 +14,7 @@ public class SampleCsWrite3dmFile : Command protected override Result RunCommand(RhinoDoc doc, RunMode mode) { - var path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); + var path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop); var filename = Path.Combine(path, "SampleCsWrite3dmFile.3dm"); Result rc;