Skip to content

Commit

Permalink
update rhino3dm cs sample
Browse files Browse the repository at this point in the history
  • Loading branch information
fraguada committed Nov 17, 2023
1 parent fe284fb commit 3e8e594
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion rhino3dm/cs/SampleCSViewports/Program.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
using Rhino.DocObjects;
using System.ComponentModel;
using Rhino.DocObjects;
using Rhino.FileIO;

File3dm file3dm = File3dm.Read("../../models/Rhino_Logo_Mesh8_NamedViews.3dm");



Console.WriteLine("--- Views ---");
Console.WriteLine("nº of views: {0}", file3dm.AllViews.Count);
for ( var i = 0; i < file3dm.AllViews.Count; i ++ ) {
var view = file3dm.AllViews[i];
Console.WriteLine(view.Name);
ViewPortInfo(view.Viewport);
}

Console.WriteLine("--- Named Views ---");
Console.WriteLine("nº of named views: {0}", file3dm.AllNamedViews.Count);
for ( var i = 0; i < file3dm.AllNamedViews.Count; i ++ ) {
var view = file3dm.AllNamedViews[i];
Console.WriteLine(view.Name);
ViewPortInfo(view.Viewport);
}

// Add view to file
ViewInfo vi = new ViewInfo();
vi.Name = "Added from rhino3dm";
file3dm.AllViews.Add(vi);

void ViewPortInfo(ViewportInfo vp) {

//Console.WriteLine("IsValidCameraFrame: {0}",vp.IsIsValidCameraFrame);
Expand Down
4 changes: 2 additions & 2 deletions rhino3dm/cs/SampleCSViewports/SampleCSViewports.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Rhino3dm" Version="8.0.0-beta3" />
<ItemGroup>
<PackageReference Include="Rhino3dm" Version="8.0.1" />
</ItemGroup>

</Project>

0 comments on commit 3e8e594

Please sign in to comment.