Skip to content

Commit

Permalink
use_last feature
Browse files Browse the repository at this point in the history
use_last feature
  • Loading branch information
Chengxuan-Li committed Jun 14, 2022
1 parent 25e4e27 commit cecc190
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 33 deletions.
Binary file modified .vs/RPH/v16/.suo
Binary file not shown.
26 changes: 26 additions & 0 deletions Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
# RPH / RhinoPlotHelper
This is a plugin for Rhinoceros 6 that helps to manage rhino layouts, layer properties, and automates batch printing.
This is a plugin for Rhinoceros 6 that helps to create document layouts.
It will support batch print-to-file, layout editing, layout objects preset, and more.

## Rhino Commands (Future Deployments to be Included)

### RPHAddNewLayout

### RPHShowLayoutsDialog (*obsolete*)
``RPHAddNewLayout`` is a command that adds a new layout according to a certain sets of options.

### RPHLayoutManagementDialog
RPHAddNewLayout command exposes the following options:

### RPHLayoutSettings
#### Position

### RPHSearch
``<Position>`` option consists of the following modes of operation: ``<From_Point>``, ``<From_Content_Objects>``.

+ From_Point

``<From_Point>`` has one optional parameter: ``<Justification>`` which could be set to the desired justification method to guide the layout creation process.

+ From_Content_Objects

This option will allow the user to select one or a set of Rhino objects and will calculate the bounding box (world XY) of the selected object(s) automatically to be the layout extent.
After selection, the paper size will change automatically to fit the selected object(s) while remaining the drawing scale. The justification method will be switched to center.

#### Paper

#### Scale

#### Name

#### Edge

#### User_Attributes

### RPHPrint
16 changes: 16 additions & 0 deletions RPH.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -53,6 +59,11 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="RPHAddNewLayout.cs" />
<Compile Include="RPHCommand.cs" />
<Compile Include="RPHPlugIn.cs" />
Expand All @@ -63,6 +74,11 @@
<EmbeddedResource Include="EmbeddedResources\plugin-utility.ico" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="README.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
51 changes: 25 additions & 26 deletions RPHAddNewLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public enum layout_options_name
drawing_alternative_name
}

//FUTURE
public enum layout_options_edge
{
drawing_edge_mm,
printing_edge_mm
}



namespace RPH
{
public class RPHAddNewLayout : Command
Expand Down Expand Up @@ -71,7 +71,9 @@ protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
settings.LayoutCreationPreview(true);

List<string> layout_options_general = new List<string> { "Position", "Paper", "Scale", "Name", "Edge", "User_Attributes" };
// List<string> layout_options_general = new List<string> { "Position", "Paper", "Scale", "Name", "Edge", "User_Attributes" };
List<string> layout_options_general = new List<string> { "Position", "Paper", "Scale", "Name", "Use_Last"};

List<string> layout_options_general_defaults = new List<string> { "", settings.paper_size_name, String.Format("1:{0}", settings.scale), "", "", "" };

List<string> layout_options_position = new List<string> { "From_Point", "From_Content_Objects" };
Expand Down Expand Up @@ -376,9 +378,14 @@ protected override Result RunCommand(RhinoDoc doc, RunMode mode)
break;

case 5:
settings.LayoutCreationPreview(true);
/// edge options

/// use last
doc.Views.Redraw();
settings.LayoutCreationPreview(false);

settings = new RPHLayoutSettings(); //LOAD USERSTRING HERE TO RESTORE LAST SETTINGS, SAVE SETTINGS INTO RHINO USERSTRING IN RPHLayoutSettings CLASS

settings.LayoutCreationPreview(true);
doc.Views.Redraw();
break;

Expand Down Expand Up @@ -506,8 +513,8 @@ public RPHLayoutSettings()

this.drawing_name = "Default Drawing";
this.drawing_alt_name = "Default Drawing Alt Name";
this.printing_edge = 3;
this.drawing_edge = 10;
this.printing_edge = 3; //FUTURE
this.drawing_edge = 10; //FUTURE
layout_preview_display_conduit.Enabled = false; //TODO _ ONLY FOR TESTS

//TEST?
Expand All @@ -521,6 +528,12 @@ public object Clone()
return this.MemberwiseClone();
}

public void StoreToUserStringTable()
{
// TODO
}


public void SetPaperSize(int code)
{
switch (code)
Expand Down Expand Up @@ -713,12 +726,14 @@ public void SetDrawingAltName(string name)
UpdateLocalVariables();
}

//FUTURE
public void SetPrintingEdge(double edge)
{
this.printing_edge = edge;
UpdateLocalVariables();
}

//FUTURE
public void SetDrawingEdge(double edge)
{
this.drawing_edge = edge;
Expand Down Expand Up @@ -834,7 +849,7 @@ public void AddLayout(RhinoDoc doc)
Rhino.DocObjects.DetailViewObject detail = layout.AddDetailView(drawing_name, top_left, bottom_right, DefinedViewportProjection.Top);

layout.SetActiveDetail(detail.Id);
Point3d center = new Point3d(0.5 * model_width, 0.5 * model_height, 0);
Point3d center = this.layout_boundingbox.Center;
detail.Viewport.SetCameraLocation(center, true);
detail.Viewport.SetCameraTarget(center, true);
detail.CommitViewportChanges();
Expand Down Expand Up @@ -876,8 +891,8 @@ public ArchivableDictionary GenerateArchivableDictionary()

user_dictionary.Set("drawing_name", drawing_name);
user_dictionary.Set("drawing_alt_name", drawing_alt_name);
user_dictionary.Set("printing_edge", printing_edge);
user_dictionary.Set("drawing_edge", drawing_edge);
user_dictionary.Set("printing_edge", printing_edge); //FUTURE
user_dictionary.Set("drawing_edge", drawing_edge); //FUTURE

return extended_user_dictionary;
}
Expand All @@ -903,23 +918,7 @@ public RPHLayoutSettings GetLayoutSetting()

}

/*
public class GenericArchivableDictionary<T> : ArchivableDictionary where T: Getba
{
private T t;
public void SetDialogOption(T dialog_option)
{
this.t = dialog_option;
}
public T GetDialogOption()
{
return this.t;
}
}
*/


public class LayoutOptionDialog
{
//private GetOption option = new Rhino.Input.Custom.GetOption();
Expand Down
3 changes: 3 additions & 0 deletions app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>
3 changes: 3 additions & 0 deletions bin/RPH.dll.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>
Binary file modified bin/RPH.pdb
Binary file not shown.
Binary file modified bin/RPH.rhp
Binary file not shown.
Binary file modified obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
2 changes: 1 addition & 1 deletion obj/Debug/RPH.csproj.CoreCompileInputs.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
731f89cbd13079b1a466ad69411c65ec15083f8f
a7f30891b097ad6735410378cac88235f8bb9250
1 change: 1 addition & 0 deletions obj/Debug/RPH.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ C:\Users\liche\source\repos\RPH\obj\Debug\RPH.csproj.AssemblyReference.cache
C:\Users\liche\source\repos\RPH\obj\Debug\RPH.csproj.CoreCompileInputs.cache
C:\Users\liche\source\repos\RPH\obj\Debug\RPH.dll
C:\Users\liche\source\repos\RPH\obj\Debug\RPH.pdb
C:\Users\liche\source\repos\RPH\bin\RPH.dll.config
Binary file modified obj/Debug/RPH.dll
Binary file not shown.
Binary file modified obj/Debug/RPH.pdb
Binary file not shown.

0 comments on commit cecc190

Please sign in to comment.