Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 53888617f5 | |||
| 6a0b126e5b | |||
| a7d2e047b3 | |||
| 938bc803c6 | |||
| ecbb2244a1 | |||
| 0792192b27 | |||
| ef56b9c331 | |||
| eb65b91e43 | |||
| 782c87cda8 | |||
| 6bdd0a5bce | |||
| 628c6b4f8f | |||
| b629dc6721 | |||
| b90ed44ac7 | |||
| f76714132d | |||
| b33487a40d | |||
| 6f32921f57 | |||
| eb555b49e8 | |||
| 79a6e15210 | |||
| 706b788177 | |||
| f33df66c0d | |||
| 36f7f4bd3d | |||
| 5ba0a5d19e | |||
| 1a3a35b753 | |||
| da8b6cd2d3 | |||
| 573f6f22a1 | |||
| 475d8d889e |
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"csharpier": {
|
||||
"version": "0.28.2",
|
||||
"commands": [
|
||||
"dotnet-csharpier"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
printWidth: 120
|
||||
useTabs: false
|
||||
tabWidth: 2
|
||||
preprocessorSymbolSets:
|
||||
- ""
|
||||
- "DEBUG"
|
||||
- "DEBUG,CODE_STYLE"
|
||||
+305
@@ -0,0 +1,305 @@
|
||||
root = true
|
||||
# Don't use tabs for indentation.
|
||||
[*]
|
||||
indent_style = space
|
||||
|
||||
# Microsoft .NET properties
|
||||
csharp_using_directive_placement = outside_namespace:silent
|
||||
|
||||
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
|
||||
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:none
|
||||
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
|
||||
|
||||
|
||||
# Standard properties
|
||||
insert_final_newline = true
|
||||
|
||||
# (Please don't specify an indent_size here; that has too many unintended consequences.)
|
||||
|
||||
# Code files
|
||||
[*.{cs,csx,vb,vbx}]
|
||||
indent_size = 2
|
||||
charset = utf-8
|
||||
|
||||
# Xml project files
|
||||
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
|
||||
indent_size = 2
|
||||
space_after_last_pi_attribute = false
|
||||
# Xml config files
|
||||
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
|
||||
indent_size = 2
|
||||
space_after_last_pi_attribute = false
|
||||
|
||||
# JSON files
|
||||
[*.json]
|
||||
indent_size = 2
|
||||
|
||||
# Dotnet code style settings:
|
||||
[*.{cs,vb}]
|
||||
# Sort using and Import directives with System.* appearing first
|
||||
dotnet_sort_system_directives_first = true
|
||||
dotnet_separate_import_directive_groups = false
|
||||
|
||||
# Avoid "this." and "Me." if not necessary
|
||||
dotnet_style_qualification_for_field = false:suggestion
|
||||
dotnet_style_qualification_for_property = false:suggestion
|
||||
dotnet_style_qualification_for_method = false:suggestion
|
||||
dotnet_style_qualification_for_event = false:suggestion
|
||||
|
||||
# Use language keywords instead of framework type names for type references
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
|
||||
dotnet_style_predefined_type_for_member_access = true:suggestion
|
||||
# Parentheses preferences
|
||||
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent
|
||||
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:silent
|
||||
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:silent
|
||||
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
||||
|
||||
# Modifier preferences
|
||||
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
|
||||
dotnet_style_readonly_field = true:suggestion
|
||||
|
||||
# Expression-level preferences
|
||||
dotnet_style_object_initializer = true:suggestion
|
||||
dotnet_style_collection_initializer = true:suggestion
|
||||
dotnet_style_coalesce_expression = true:suggestion
|
||||
dotnet_style_null_propagation = true:suggestion
|
||||
dotnet_style_explicit_tuple_names = true:suggestion
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
|
||||
dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
||||
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
|
||||
dotnet_style_prefer_auto_properties = true:warning
|
||||
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
|
||||
dotnet_style_prefer_conditional_expression_over_return = true:silent
|
||||
|
||||
|
||||
# CSharp code style settings:
|
||||
[*.cs]
|
||||
# Prefer "var" everywhere
|
||||
csharp_style_var_elsewhere = false:none
|
||||
csharp_style_var_for_built_in_types = false:none
|
||||
csharp_style_var_when_type_is_apparent = false:none
|
||||
|
||||
# Prefer method-like constructs to have a block body
|
||||
csharp_style_expression_bodied_methods = true:suggestion
|
||||
csharp_style_expression_bodied_constructors = false:suggestion
|
||||
csharp_style_expression_bodied_operators = true:suggestion
|
||||
|
||||
# Prefer property-like constructs to have an expression-body
|
||||
csharp_style_expression_bodied_properties = true:suggestion
|
||||
csharp_style_expression_bodied_indexers = true:suggestion
|
||||
csharp_style_expression_bodied_accessors = true:suggestion
|
||||
|
||||
# Suggest more modern language features when available
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||
csharp_style_inlined_variable_declaration = true:suggestion
|
||||
csharp_style_throw_expression = true:suggestion
|
||||
csharp_style_conditional_delegate_call = true:suggestion
|
||||
csharp_style_namespace_declarations = file_scoped
|
||||
|
||||
# Newline settings
|
||||
csharp_new_line_before_open_brace = all
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_catch = true
|
||||
csharp_new_line_before_finally = true
|
||||
csharp_new_line_before_members_in_object_initializers = true
|
||||
csharp_new_line_before_members_in_anonymous_types = true
|
||||
|
||||
# Space preferences
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_after_keywords_in_control_flow_statements = true
|
||||
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||
csharp_space_between_parentheses = false
|
||||
csharp_space_before_colon_in_inheritance_clause = true
|
||||
csharp_space_after_colon_in_inheritance_clause = true
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||
|
||||
# Wrapping preferences
|
||||
csharp_preserve_single_line_statements = true
|
||||
csharp_preserve_single_line_blocks = true
|
||||
|
||||
|
||||
|
||||
# SYMBOL NAMING RULES
|
||||
# Copied from https://github.com/dotnet/roslyn/blob/main/.editorconfig
|
||||
# Adapted rules:
|
||||
# - Constants are ALL_UPPER
|
||||
# - Non-private fields are PascalCase
|
||||
|
||||
# Non-private fields are PascalCase
|
||||
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = warning
|
||||
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
|
||||
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_field_style
|
||||
|
||||
dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
|
||||
|
||||
dotnet_naming_style.non_private_readonly_field_style.capitalization = pascal_case
|
||||
|
||||
# Constants are ALL_UPPER
|
||||
dotnet_naming_rule.constants_should_be_all_upper.severity = warning
|
||||
dotnet_naming_rule.constants_should_be_all_upper.symbols = constants
|
||||
dotnet_naming_rule.constants_should_be_all_upper.style = constant_style
|
||||
|
||||
dotnet_naming_symbols.constants.applicable_kinds = field, local
|
||||
dotnet_naming_symbols.constants.required_modifiers = const
|
||||
|
||||
dotnet_naming_style.constant_style.capitalization = all_upper
|
||||
|
||||
# Private static fields are camelCase and start with s_
|
||||
dotnet_naming_rule.static_fields_should_be_camel_case.severity = warning
|
||||
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
|
||||
dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style
|
||||
|
||||
dotnet_naming_symbols.static_fields.applicable_accessibilities = private
|
||||
dotnet_naming_symbols.static_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.static_fields.required_modifiers = static
|
||||
|
||||
dotnet_naming_style.static_field_style.capitalization = camel_case
|
||||
dotnet_naming_style.static_field_style.required_prefix = s_
|
||||
|
||||
|
||||
# Instance fields are camelCase and start with _
|
||||
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = warning
|
||||
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
|
||||
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
|
||||
|
||||
dotnet_naming_symbols.instance_fields.applicable_kinds = field
|
||||
|
||||
dotnet_naming_style.instance_field_style.capitalization = camel_case
|
||||
dotnet_naming_style.instance_field_style.required_prefix = _
|
||||
|
||||
# Locals and parameters are camelCase
|
||||
dotnet_naming_rule.locals_should_be_camel_case.severity = warning
|
||||
dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
|
||||
dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
|
||||
|
||||
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local
|
||||
|
||||
dotnet_naming_style.camel_case_style.capitalization = camel_case
|
||||
|
||||
# Local functions are PascalCase
|
||||
dotnet_naming_rule.local_functions_should_be_pascal_case.severity = warning
|
||||
dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
|
||||
dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style
|
||||
|
||||
dotnet_naming_symbols.local_functions.applicable_kinds = local_function
|
||||
|
||||
dotnet_naming_style.local_function_style.capitalization = pascal_case
|
||||
|
||||
# By default, name items with PascalCase
|
||||
dotnet_naming_rule.members_should_be_pascal_case.severity = warning
|
||||
dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
|
||||
dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
|
||||
|
||||
dotnet_naming_symbols.all_members.applicable_kinds = *
|
||||
|
||||
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
|
||||
|
||||
|
||||
# Analyzer settings
|
||||
dotnet_analyzer_diagnostic.category-Style.severity = warning # All rules will use this severity unless overriden
|
||||
dotnet_diagnostic.ide0055.severity = none # Formatting rule: Incompatible with CSharpier
|
||||
dotnet_diagnostic.ide0007.severity = none # Use var instead of explicit type: Preference
|
||||
dotnet_diagnostic.ide0009.severity = none # Add this or Me qualification: Preference
|
||||
dotnet_diagnostic.ide0200.severity = none # Remove unnecessary lambda expression: may be performance reasons not to
|
||||
dotnet_diagnostic.ide0058.severity = none # Remove unnecessary expression value: Subjective
|
||||
dotnet_diagnostic.ide0010.severity = none # Add missing cases to switch statement: Too verbose
|
||||
dotnet_diagnostic.ide0200.severity = none # Remove unnecessary lambda expression: may be performance reasons not to
|
||||
dotnet_diagnostic.ide0058.severity = none # Remove unnecessary expression value: Subjective
|
||||
dotnet_diagnostic.ide0001.severity = suggestion # Name can be simplified: Non enforceable in build
|
||||
dotnet_diagnostic.ide0046.severity = suggestion # Use conditional expression for return: Subjective
|
||||
dotnet_diagnostic.ide0045.severity = suggestion # Use conditional expression for assignment: Subjective
|
||||
dotnet_diagnostic.ide0078.severity = suggestion # Use pattern matching: Subjective
|
||||
dotnet_diagnostic.ide0260.severity = suggestion # Use pattern matching: Subjective
|
||||
dotnet_diagnostic.ide0022.severity = suggestion # Use expression body for method: Subjective
|
||||
dotnet_diagnostic.ide0061.severity = suggestion # Use expression body for local functions: Subjective
|
||||
dotnet_diagnostic.ide0063.severity = suggestion # Using directive can be simplified
|
||||
dotnet_diagnostic.ide0066.severity = suggestion # Use switch expression: Subjective
|
||||
dotnet_diagnostic.ide0029.severity = suggestion # Null check can be simplified: Subjective
|
||||
dotnet_diagnostic.ide0030.severity = suggestion # Null check can be simplified: Subjective
|
||||
dotnet_diagnostic.ide0270.severity = suggestion # Null check can be simplified: Subjective
|
||||
dotnet_diagnostic.ide0042.severity = suggestion # Deconstruct variable declaration: Subjective
|
||||
dotnet_diagnostic.ide0039.severity = suggestion # Use local function instead of lambda: Subjective
|
||||
dotnet_diagnostic.ide0029.severity = suggestion # Null check can be simplified: Subjective
|
||||
dotnet_diagnostic.ide0030.severity = suggestion # Null check can be simplified: Subjective
|
||||
dotnet_diagnostic.ide0270.severity = suggestion # Null check can be simplified: Subjective
|
||||
dotnet_diagnostic.ide0042.severity = suggestion # Deconstruct variable declaration: Subjective
|
||||
dotnet_diagnostic.ide0028.severity = suggestion # Use collection initializers: Subjective
|
||||
dotnet_diagnostic.ide0072.severity = suggestion # Populate switch statement: Subjective
|
||||
dotnet_diagnostic.ide0074.severity = suggestion # Use compound assignment: Subjective
|
||||
|
||||
# Maintainability rules
|
||||
dotnet_diagnostic.ca1501.severity = warning # Avoid excessive inheritance
|
||||
dotnet_diagnostic.ca1502.severity = warning # Avoid excessive complexity
|
||||
dotnet_diagnostic.ca1505.severity = warning # Avoid unmaintainable code
|
||||
dotnet_diagnostic.ca1506.severity = warning # Avoid excessive class coupling
|
||||
dotnet_diagnostic.ca1507.severity = warning # Use nameof in place of string
|
||||
dotnet_diagnostic.ca1508.severity = warning # Avoid dead conditional code
|
||||
dotnet_diagnostic.ca1509.severity = warning # Invalid entry in code metrics configuration file
|
||||
dotnet_diagnostic.ca1861.severity = none # Prefer 'static readonly' fields over constant array arguments if the called method is called repeatedly and is not mutating the passed array (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1861)
|
||||
|
||||
|
||||
# Performance rules
|
||||
dotnet_diagnostic.ca1849.severity = suggestion # Call async methods when in an async method: May decrease performance
|
||||
dotnet_diagnostic.ca1822.severity = suggestion # Mark member as static
|
||||
dotnet_diagnostic.ca1859.severity = suggestion # Use concrete types when possible for improved performance
|
||||
|
||||
# Design rule
|
||||
dotnet_diagnostic.ca1002.severity = suggestion # Do not expose generic lists
|
||||
dotnet_diagnostic.ca1051.severity = warning # Do not declare visible instance fields
|
||||
dotnet_diagnostic.ca1056.severity = suggestion # URI properties should not be strings
|
||||
dotnet_diagnostic.ca1062.severity = none # Public method must check all parameters for null
|
||||
|
||||
# Naming
|
||||
dotnet_diagnostic.ca1707.severity = none # Remove underscores in names
|
||||
|
||||
# Usage
|
||||
dotnet_diagnostic.ca2227.severity = suggestion # Collection props should be read-only
|
||||
|
||||
dotnet_code_quality.ca1051.exclude_structs = true # CA1051 is excluded in structs
|
||||
dotnet_code_quality.dispose_ownership_transfer_at_constructor = true # CA2000 has a lot of false positives without this
|
||||
dotnet_code_quality.dispose_ownership_transfer_at_method_call = true # CA2000 has a lot of false positives without this
|
||||
dotnet_code_quality.dispose_analysis_kind = NonExceptionPathsOnlyNotDisposed # CA2000 has a lot of false positives without this
|
||||
|
||||
# NUnit
|
||||
dotnet_diagnostic.NUnit2001.severity = warning # Consider using Assert.That(expr, Is.False) instead of Assert.False(expr)
|
||||
dotnet_diagnostic.NUnit2002.severity = warning # Consider using Assert.That(expr, Is.False) instead of Assert.IsFalse(expr)
|
||||
dotnet_diagnostic.NUnit2003.severity = warning # Consider using Assert.That(expr, Is.True) instead of Assert.IsTrue(expr)
|
||||
dotnet_diagnostic.NUnit2004.severity = warning # Consider using Assert.That(expr, Is.True) instead of Assert.True(expr)
|
||||
dotnet_diagnostic.NUnit2005.severity = warning # Consider using Assert.That(actual, Is.EqualTo(expected)) instead of Assert.AreEqual(expected, actual)
|
||||
dotnet_diagnostic.NUnit2006.severity = warning # Consider using Assert.That(actual, Is.Not.EqualTo(expected)) instead of Assert.AreNotEqual(expected, actual)
|
||||
|
||||
dotnet_diagnostic.NUnit2010.severity = warning # Use EqualConstraint for better assertion messages in case of failure
|
||||
dotnet_diagnostic.NUnit2011.severity = warning # Use ContainsConstraint for better assertion messages in case of failure
|
||||
dotnet_diagnostic.NUnit2011.severity = warning # Use StartsWithConstraint for better assertion messages in case of failure
|
||||
dotnet_diagnostic.NUnit2011.severity = warning # Use EndsWithConstraint for better assertion messages in case of failure
|
||||
dotnet_diagnostic.NUnit2014.severity = warning # Use SomeItemsConstraint for better assertion messages in case of failure
|
||||
|
||||
dotnet_diagnostic.NUnit2015.severity = warning # Consider using Assert.That(actual, Is.SameAs(expected)) instead of Assert.AreSame(expected, actual)
|
||||
dotnet_diagnostic.NUnit2016.severity = warning # Consider using Assert.That(expr, Is.Null) instead of Assert.Null(expr)
|
||||
dotnet_diagnostic.NUnit2017.severity = warning # Consider using Assert.That(expr, Is.Null) instead of Assert.IsNull(expr)
|
||||
dotnet_diagnostic.NUnit2018.severity = warning # Consider using Assert.That(expr, Is.Not.Null) instead of Assert.NotNull(expr)
|
||||
dotnet_diagnostic.NUnit2028.severity = warning # Consider using Assert.That(actual, Is.GreaterThanOrEqualTo(expected)) instead of Assert.GreaterOrEqual(actual, expected)
|
||||
dotnet_diagnostic.NUnit2027.severity = warning # Consider using Assert.That(actual, Is.GreaterThan(expected)) instead of Assert.Greater(actual, expected)
|
||||
dotnet_diagnostic.NUnit2029.severity = warning # Consider using Assert.That(actual, Is.LessThan(expected)) instead of Assert.Less(actual, expected)
|
||||
dotnet_diagnostic.NUnit2030.severity = warning # Consider using Assert.That(actual, Is.LessThanOrEqualTo(expected)) instead of Assert.LessOrEqual(actual, expected)
|
||||
dotnet_diagnostic.NUnit2031.severity = warning # Consider using Assert.That(actual, Is.Not.SameAs(expected)) instead of Assert.AreNotSame(expected, actual)
|
||||
dotnet_diagnostic.NUnit2032.severity = warning # Consider using Assert.That(expr, Is.Zero) instead of Assert.Zero(expr)
|
||||
dotnet_diagnostic.NUnit2033.severity = warning # Consider using Assert.That(expr, Is.Not.Zero) instead of Assert.NotZero(expr)
|
||||
dotnet_diagnostic.NUnit2034.severity = warning # Consider using Assert.That(expr, Is.NaN) instead of Assert.IsNaN(expr)
|
||||
dotnet_diagnostic.NUnit2035.severity = warning # Consider using Assert.That(collection, Is.Empty) instead of Assert.IsEmpty(collection)
|
||||
dotnet_diagnostic.NUnit2036.severity = warning # Consider using Assert.That(collection, Is.Not.Empty) instead of Assert.IsNotEmpty(collection)
|
||||
dotnet_diagnostic.NUnit2037.severity = warning # Consider using Assert.That(collection, Does.Contain(instance)) instead of Assert.Contains(instance, collection)
|
||||
dotnet_diagnostic.NUnit2038.severity = warning # Consider using Assert.That(actual, Is.InstanceOf(expected)) instead of Assert.IsInstanceOf(expected, actual)
|
||||
dotnet_diagnostic.NUnit2039.severity = warning # Consider using Assert.That(actual, Is.Not.InstanceOf(expected)) instead of Assert.IsNotInstanceOf(expected, actual)
|
||||
|
||||
[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,cc,cginc,compute,cp,cpp,cs,cshtml,cu,cuh,cxx,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,vb,xaml,xamlx,xoml,xsd}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
@@ -0,0 +1,5 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# need original files to be windows
|
||||
*.txt text eol=crlf
|
||||
@@ -0,0 +1,76 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at hello@speckle.systems. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
||||
@@ -0,0 +1,58 @@
|
||||
# Speckle Contribution Guidelines
|
||||
|
||||
## Introduction
|
||||
|
||||
Thank you for reading this! Speckle's a rather wide network of parts that depend on each other, either directly, indirectly or even just cosmetically.
|
||||
|
||||
> **Speckle** is a quite large ecosystem of moving parts. Any changes may have unintended effects, that can cause problems quickly for many people (and processes) that rely on Speckle.
|
||||
|
||||
This means that what might look like a simple quick change in one repo may have a big hidden cost that propagates around other parts of the project. We're all here to help each other, and this guide is meant to help you get started and promote a framework that can untangle all these dependecies through discussion!
|
||||
|
||||
## Bugs & Issues 🐞
|
||||
|
||||
### Found a new bug?
|
||||
|
||||
- First step is to check whether this is a new bug! We encourage you to search through the issues of the project in question **and** associated repos!
|
||||
|
||||
- If you come up with nothing, **open a new issue with a clear title and description**, as much relevant information as possible: system configuration, code samples & steps to reproduce the problem.
|
||||
|
||||
- Can't mention this often enough: tells us how to reproduce the problem! We will ignore or flag as such issues without reproduction steps.
|
||||
|
||||
- Try to reference & note all potentially affected projects.
|
||||
|
||||
### Sending a PR for Bug Fixes
|
||||
|
||||
You fixed something! Great! We hope you logged it first :) Make sure though that you've covered the lateral thinking needed for a bug report, as described above, also in your implementation! If there any tests, make sure they all pass. If there are none, it means they're missing - so add them!
|
||||
|
||||
### Code Style
|
||||
|
||||
When collaborating on a project in GitHub, it's important to follow coding conventions and style guidelines to ensure consistency and readability of the codebase. One commonly used convention is to use two spaces for indentation.
|
||||
|
||||
To use two spaces for indentation in GitHub, you can configure your text editor or IDE to use this indentation style. Once you've written your code, you can commit and push your changes to GitHub.
|
||||
|
||||
When collaborating with others on GitHub, it's important to communicate any changes to coding conventions or style guidelines, and to work together to maintain a consistent coding style throughout the project. Code reviews can also help ensure that code is well-formatted and easy to read.
|
||||
|
||||
## New Features 🎉
|
||||
|
||||
The golden rule is to Discuss First!
|
||||
|
||||
- Before embarking on adding a new feature, suggest it first as an issue with the `enhancement` label and/or title - this will allow relevant people to pitch in
|
||||
- We'll now discuss your requirements and see how and if they fit within the Speckle ecosystem.
|
||||
- The last step is to actually start writing code & submit a PR so we can follow along!
|
||||
- All new features should, if and where possible, come with tests. We won't merge without!
|
||||
|
||||
> Many clients may potentially have overlapping scopes, some features might already be in dev somewhere else, or might have been postponed to the next major release due to api instability in that area. For example, adding a delete stream button in the accounts panel in rhino: this feature was planned for speckle admin, and the whole functionality of the accounts panel in rhino is to be greatly reduced!
|
||||
|
||||
## Cosmetic Patches ✨
|
||||
|
||||
Changes that are cosmetic in nature and do not add anything substantial to the stability or functionality of Speckle **will generally not be accepted**.
|
||||
|
||||
Why? However trivial the changes might seem, there might be subtle reasons for the original code to be as it is. Furthermore, there are a lot of potential hidden costs (that even maintainers themselves are not aware of fully!) and they eat up review time unncessarily.
|
||||
|
||||
> **Examples**: modifying the colour of an UI element in one client may have a big hidden cost and need propagation in several other clients that implement a similar ui element. Changing the default port or specifiying `localhost` instead of `0.0.0.0` breaks cross-vm debugging and developing.
|
||||
|
||||
## Wrap up
|
||||
|
||||
Don't worry if you get things wrong. We all do, including project owners: this document should've been here a long time ago. There's plenty of room for discussion on our community [forum](https://discourse.speckle.works).
|
||||
|
||||
🙌❤️💙💚💜🙌
|
||||
@@ -0,0 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions" # search for actions - there are other options available
|
||||
directory: "/" # search in .github/workflows under root `/`
|
||||
schedule:
|
||||
interval: "weekly" # check for action update every week
|
||||
@@ -0,0 +1,29 @@
|
||||
name: .NET CI Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
filter: tree:0
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.x.x
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-nuget-
|
||||
|
||||
- name: 🔫 Build All
|
||||
run: ./build.ps1
|
||||
@@ -0,0 +1,33 @@
|
||||
name: .NET Build and Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
filter: tree:0
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.x.x
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-nuget-
|
||||
|
||||
- name: 🔫 Build and Pack
|
||||
run: ./build.ps1 pack
|
||||
|
||||
- name: Push to nuget.org
|
||||
run: dotnet nuget push output\*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{secrets.CONNECTORS_NUGET_TOKEN }} --skip-duplicate
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
**/bin/*
|
||||
**/obj/*
|
||||
_ReSharper.SharpCompress/
|
||||
bin/
|
||||
*.suo
|
||||
*.user
|
||||
TestArchives/Scratch/
|
||||
TestArchives/Scratch2/
|
||||
TestResults/
|
||||
*.nupkg
|
||||
packages/*/
|
||||
project.lock.json
|
||||
tests/TestArchives/Scratch
|
||||
.vs
|
||||
tools
|
||||
.vscode
|
||||
.idea/
|
||||
|
||||
.DS_Store
|
||||
*.snupkg
|
||||
/tests/TestArchives/6d23a38c-f064-4ef1-ad89-b942396f53b9/Scratch
|
||||
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Bullseye" />
|
||||
<PackageReference Include="Glob" />
|
||||
<PackageReference Include="SimpleExec" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Build;
|
||||
|
||||
public static class Consts
|
||||
{
|
||||
public static readonly string[] Solutions = { "Speckle.Host.Apis.sln" };
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
using Build;
|
||||
using GlobExpressions;
|
||||
using static Bullseye.Targets;
|
||||
using static SimpleExec.Command;
|
||||
|
||||
const string CLEAN = "clean";
|
||||
const string RESTORE = "restore";
|
||||
const string BUILD = "build";
|
||||
const string TEST = "test";
|
||||
const string FORMAT = "format";
|
||||
const string RESTORE_TOOLS = "restore-tools";
|
||||
const string PACK = "pack";
|
||||
|
||||
Target(
|
||||
CLEAN,
|
||||
ForEach("**/output"),
|
||||
dir =>
|
||||
{
|
||||
IEnumerable<string> GetDirectories(string d)
|
||||
{
|
||||
return Glob.Directories(".", d);
|
||||
}
|
||||
|
||||
void RemoveDirectory(string d)
|
||||
{
|
||||
if (Directory.Exists(d))
|
||||
{
|
||||
Console.WriteLine(d);
|
||||
Directory.Delete(d, true);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var d in GetDirectories(dir))
|
||||
{
|
||||
RemoveDirectory(d);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Target(
|
||||
RESTORE_TOOLS,
|
||||
() =>
|
||||
{
|
||||
Run("dotnet", "tool restore");
|
||||
}
|
||||
);
|
||||
|
||||
Target(
|
||||
FORMAT,
|
||||
DependsOn(RESTORE_TOOLS),
|
||||
() =>
|
||||
{
|
||||
Run("dotnet", "csharpier --check .");
|
||||
}
|
||||
);
|
||||
|
||||
Target(
|
||||
RESTORE,
|
||||
Consts.Solutions,
|
||||
s =>
|
||||
{
|
||||
Run("dotnet", $"restore {s} --locked-mode");
|
||||
}
|
||||
);
|
||||
|
||||
Target(
|
||||
BUILD,
|
||||
DependsOn(RESTORE),
|
||||
Consts.Solutions,
|
||||
s =>
|
||||
{
|
||||
Run("dotnet", $"build {s} -c Release --no-restore");
|
||||
}
|
||||
);
|
||||
|
||||
Target(
|
||||
TEST,
|
||||
DependsOn(BUILD),
|
||||
() =>
|
||||
{
|
||||
IEnumerable<string> GetFiles(string d)
|
||||
{
|
||||
return Glob.Files(".", d);
|
||||
}
|
||||
|
||||
foreach (var file in GetFiles("**/*.Tests.csproj"))
|
||||
{
|
||||
Run("dotnet", $"test {file} -c Release --no-build --verbosity=normal");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Target(
|
||||
PACK,
|
||||
DependsOn(TEST),
|
||||
Consts.Solutions,
|
||||
s =>
|
||||
{
|
||||
Run("dotnet", $"pack {s} -c Release -o output --no-build");
|
||||
}
|
||||
);
|
||||
|
||||
Target("default", DependsOn(FORMAT, TEST), () => Console.WriteLine("Done!"));
|
||||
|
||||
await RunTargetsAndExitAsync(args).ConfigureAwait(true);
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dependencies": {
|
||||
"net8.0": {
|
||||
"Bullseye": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.0.0, )",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "bqyt+m17ym+5aN45C5oZRAjuLDt8jKiCm/ys1XfymIXSkrTFwvI/QsbY3ucPSHDz7SF7uON7B57kXFv5H2k1ew=="
|
||||
},
|
||||
"Glob": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.1.9, )",
|
||||
"resolved": "1.1.9",
|
||||
"contentHash": "AfK5+ECWYTP7G3AAdnU8IfVj+QpGjrh9GC2mpdcJzCvtQ4pnerAGwHsxJ9D4/RnhDUz2DSzd951O/lQjQby2Sw=="
|
||||
},
|
||||
"SimpleExec": {
|
||||
"type": "Direct",
|
||||
"requested": "[12.0.0, )",
|
||||
"resolved": "12.0.0",
|
||||
"contentHash": "ptxlWtxC8vM6Y6e3h9ZTxBBkOWnWrm/Sa1HT+2i1xcXY3Hx2hmKDZP5RShPf8Xr9D+ivlrXNy57ktzyH8kyt+Q=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<Project>
|
||||
<PropertyGroup Label="Company Info">
|
||||
<Authors>Speckle</Authors>
|
||||
<Company>Speckle</Company>
|
||||
<Copyright>Copyright (c) AEC Systems Ltd</Copyright>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
<WarningsAsErrors>true</WarningsAsErrors>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
|
||||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<RunAnalyzersDuringLiveAnalysis>False</RunAnalyzersDuringLiveAnalysis>
|
||||
<RunAnalyzersDuringBuild>False</RunAnalyzersDuringBuild>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<MinVerDefaultPreReleaseIdentifiers>preview.0</MinVerDefaultPreReleaseIdentifiers>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,18 @@
|
||||
<Project>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Bullseye" Version="5.0.0" />
|
||||
<PackageVersion Include="Glob" Version="1.1.9" />
|
||||
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
|
||||
<PackageVersion Include="SimpleExec" Version="12.0.0" />
|
||||
<PackageVersion Include="Speckle.ProxyGenerator" Version="0.1.6" />
|
||||
<PackageVersion Include="Mapster" Version="7.3.0" />
|
||||
<PackageVersion Include="MinVer" Version="5.0.0" />
|
||||
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
|
||||
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
|
||||
<PackageVersion Include="Moq" Version="4.20.70" />
|
||||
<PackageVersion Include="NUnit" Version="4.1.0" />
|
||||
<PackageVersion Include="NUnit.Analyzers" Version="4.2.0" />
|
||||
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1 +1,3 @@
|
||||
# speckle-csharp-api
|
||||
# Speckle Host Apis
|
||||
|
||||
This repo uses https://github.com/specklesystems/ProxyGenerator to generate wrappers around various Host Applications. This makes the result interfaces usable in unit tests as the host application API only allows it usable as a plugin.
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project>
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />
|
||||
<PropertyGroup>
|
||||
<IsPackable>true</IsPackable>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\README.md" Pack="true" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<Project>
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Packages.props, $(MSBuildThisFileDirectory)..))" />
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Speckle.Revit.API" Version="2023.0.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\Speckle.Revit.Api\Speckle.Revit.Api.projitems" Label="Shared" />
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Speckle.Revit.API" />
|
||||
<PackageReference Include="Mapster" />
|
||||
<PackageReference Include="Speckle.ProxyGenerator" PrivateAssets="All"/>
|
||||
<PackageReference Include="MinVer" PrivateAssets="All"/>
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Speckle.Revit2023.Interfaces\Speckle.Revit2023.Interfaces.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dependencies": {
|
||||
".NETFramework,Version=v4.8": {
|
||||
"Mapster": {
|
||||
"type": "Direct",
|
||||
"requested": "[7.3.0, )",
|
||||
"resolved": "7.3.0",
|
||||
"contentHash": "NrCUX/rJa5PTyo6iW4AL5dZLU9PDNlYnrJOVjgdpo5OQM9EtWH2CMHnC5sSuJWC0d0b0SnmeRrIviEem6WxtuQ==",
|
||||
"dependencies": {
|
||||
"Mapster.Core": "1.2.0",
|
||||
"Microsoft.CSharp": "4.3.0",
|
||||
"System.Reflection.Emit": "4.3.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.SourceLink.GitHub": {
|
||||
"type": "Direct",
|
||||
"requested": "[8.0.0, )",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Build.Tasks.Git": "8.0.0",
|
||||
"Microsoft.SourceLink.Common": "8.0.0"
|
||||
}
|
||||
},
|
||||
"MinVer": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.0.0, )",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw=="
|
||||
},
|
||||
"Speckle.ProxyGenerator": {
|
||||
"type": "Direct",
|
||||
"requested": "[0.1.6, )",
|
||||
"resolved": "0.1.6",
|
||||
"contentHash": "SO9Udllol9Krpq+UFBr54Es79kmiIQmtSRXKFcvplnisdwmjo5CBlucuuvgZYmQUSvF/9KC4BcuVllZRTCBDHQ=="
|
||||
},
|
||||
"Speckle.Revit.API": {
|
||||
"type": "Direct",
|
||||
"requested": "[2023.0.0, )",
|
||||
"resolved": "2023.0.0",
|
||||
"contentHash": "tq40eD7psgTbV+epNouYyqfo6+hEi7FmXZqcxEOsAV7zfYyWhL6Rt3vmojkWGNuerGbH6oRI6KIIxrnlCNb8Hw=="
|
||||
},
|
||||
"Mapster.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.2.0",
|
||||
"contentHash": "TNdqZk2zAuBYfJF88D/3clQTOyOdqr1crU81yZQtlGa+e7FYWhJdK/buBWT+TpM3qQko9UzmzfOT4iq3JCs/ZA=="
|
||||
},
|
||||
"Microsoft.Build.Tasks.Git": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
|
||||
},
|
||||
"Microsoft.CSharp": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.3.0",
|
||||
"contentHash": "P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA=="
|
||||
},
|
||||
"Microsoft.SourceLink.Common": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
|
||||
},
|
||||
"System.Reflection.Emit": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.3.0",
|
||||
"contentHash": "228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg=="
|
||||
},
|
||||
"speckle.revit2023.interfaces": {
|
||||
"type": "Project"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\Speckle.Revit.Interfaces\Speckle.Revit.Interfaces.projitems" Label="Shared" />
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MinVer" PrivateAssets="All"/>
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dependencies": {
|
||||
".NETStandard,Version=v2.0": {
|
||||
"Microsoft.SourceLink.GitHub": {
|
||||
"type": "Direct",
|
||||
"requested": "[8.0.0, )",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Build.Tasks.Git": "8.0.0",
|
||||
"Microsoft.SourceLink.Common": "8.0.0"
|
||||
}
|
||||
},
|
||||
"MinVer": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.0.0, )",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw=="
|
||||
},
|
||||
"NETStandard.Library": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.0.3, )",
|
||||
"resolved": "2.0.3",
|
||||
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.1.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Build.Tasks.Git": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
|
||||
},
|
||||
"Microsoft.NETCore.Platforms": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.1.0",
|
||||
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
|
||||
},
|
||||
"Microsoft.SourceLink.Common": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<Project>
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Packages.props, $(MSBuildThisFileDirectory)..))" />
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Speckle.Revit.API" Version="2024.0.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\Speckle.Revit.Api\Speckle.Revit.Api.projitems" Label="Shared" />
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Speckle.Revit.API" />
|
||||
<PackageReference Include="Mapster" />
|
||||
<PackageReference Include="Speckle.ProxyGenerator" PrivateAssets="All"/>
|
||||
<PackageReference Include="MinVer" PrivateAssets="All"/>
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Speckle.Revit2024.Interfaces\Speckle.Revit2024.Interfaces.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dependencies": {
|
||||
".NETFramework,Version=v4.8": {
|
||||
"Mapster": {
|
||||
"type": "Direct",
|
||||
"requested": "[7.3.0, )",
|
||||
"resolved": "7.3.0",
|
||||
"contentHash": "NrCUX/rJa5PTyo6iW4AL5dZLU9PDNlYnrJOVjgdpo5OQM9EtWH2CMHnC5sSuJWC0d0b0SnmeRrIviEem6WxtuQ==",
|
||||
"dependencies": {
|
||||
"Mapster.Core": "1.2.0",
|
||||
"Microsoft.CSharp": "4.3.0",
|
||||
"System.Reflection.Emit": "4.3.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.SourceLink.GitHub": {
|
||||
"type": "Direct",
|
||||
"requested": "[8.0.0, )",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Build.Tasks.Git": "8.0.0",
|
||||
"Microsoft.SourceLink.Common": "8.0.0"
|
||||
}
|
||||
},
|
||||
"MinVer": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.0.0, )",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw=="
|
||||
},
|
||||
"Speckle.ProxyGenerator": {
|
||||
"type": "Direct",
|
||||
"requested": "[0.1.6, )",
|
||||
"resolved": "0.1.6",
|
||||
"contentHash": "SO9Udllol9Krpq+UFBr54Es79kmiIQmtSRXKFcvplnisdwmjo5CBlucuuvgZYmQUSvF/9KC4BcuVllZRTCBDHQ=="
|
||||
},
|
||||
"Speckle.Revit.API": {
|
||||
"type": "Direct",
|
||||
"requested": "[2024.0.0, )",
|
||||
"resolved": "2024.0.0",
|
||||
"contentHash": "a4dsvZ00ocvzTgCD6dUdydf0jIZDVcDhs6dUX9cv+y3aTDbU8rmzhYXWt8sThedIG+IPSVa0vHmAH9pKiJL3SQ=="
|
||||
},
|
||||
"Mapster.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.2.0",
|
||||
"contentHash": "TNdqZk2zAuBYfJF88D/3clQTOyOdqr1crU81yZQtlGa+e7FYWhJdK/buBWT+TpM3qQko9UzmzfOT4iq3JCs/ZA=="
|
||||
},
|
||||
"Microsoft.Build.Tasks.Git": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
|
||||
},
|
||||
"Microsoft.CSharp": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.3.0",
|
||||
"contentHash": "P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA=="
|
||||
},
|
||||
"Microsoft.SourceLink.Common": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
|
||||
},
|
||||
"System.Reflection.Emit": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.3.0",
|
||||
"contentHash": "228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg=="
|
||||
},
|
||||
"speckle.revit2024.interfaces": {
|
||||
"type": "Project"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\Speckle.Revit.Interfaces\Speckle.Revit.Interfaces.projitems" Label="Shared" />
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MinVer" PrivateAssets="All"/>
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dependencies": {
|
||||
".NETStandard,Version=v2.0": {
|
||||
"Microsoft.SourceLink.GitHub": {
|
||||
"type": "Direct",
|
||||
"requested": "[8.0.0, )",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Build.Tasks.Git": "8.0.0",
|
||||
"Microsoft.SourceLink.Common": "8.0.0"
|
||||
}
|
||||
},
|
||||
"MinVer": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.0.0, )",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw=="
|
||||
},
|
||||
"NETStandard.Library": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.0.3, )",
|
||||
"resolved": "2.0.3",
|
||||
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.1.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.Build.Tasks.Git": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
|
||||
},
|
||||
"Microsoft.NETCore.Platforms": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.1.0",
|
||||
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
|
||||
},
|
||||
"Microsoft.SourceLink.Common": {
|
||||
"type": "Transitive",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Autodesk.Revit.DB;
|
||||
using Speckle.ProxyGenerator;
|
||||
using Speckle.Revit.Interfaces;
|
||||
#pragma warning disable CA1010
|
||||
#pragma warning disable CA1710
|
||||
|
||||
namespace Speckle.Revit.Api;
|
||||
|
||||
[Proxy(
|
||||
typeof(Document),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "PlanTopology", "PlanTopologies", "TypeOfStorage", "Equals" }
|
||||
)]
|
||||
[SuppressMessage("Maintainability", "CA1506:Avoid excessive class coupling")]
|
||||
public partial interface IRevitDocumentProxy : IRevitDocument;
|
||||
|
||||
[Proxy(
|
||||
typeof(ForgeTypeId),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Equals" }
|
||||
)]
|
||||
public partial interface IRevitForgeTypeIdProxy : IRevitForgeTypeId;
|
||||
|
||||
[Proxy(
|
||||
typeof(Element),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Parameter", "BoundingBox", "Geometry", "Location" }
|
||||
)]
|
||||
public partial interface IRevitElementProxy : IRevitElement;
|
||||
|
||||
public partial class ElementProxy
|
||||
{
|
||||
public IRevitParameter GetParameter(RevitBuiltInParameter builtInParameter) =>
|
||||
new ParameterProxy(
|
||||
_Instance.get_Parameter(EnumUtility<RevitBuiltInParameter, BuiltInParameter>.Convert(builtInParameter))
|
||||
);
|
||||
|
||||
public IRevitBoundingBoxXYZ GetBoundingBox() => new BoundingBoxXYZProxy(_Instance.get_BoundingBox(null));
|
||||
|
||||
public IRevitGeometryElement GetGeometry(IRevitOptions options) =>
|
||||
new GeometryElementProxy(_Instance.get_Geometry(((OptionsProxy)options)._Instance));
|
||||
|
||||
public IRevitFamilySymbol? ToFamilySymbol()
|
||||
{
|
||||
if (_Instance is FamilySymbol s)
|
||||
{
|
||||
return new FamilySymbolProxy(s);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitMaterial? ToMaterial()
|
||||
{
|
||||
if (_Instance is Material m)
|
||||
{
|
||||
return new MaterialProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitHostObject? ToHostObject()
|
||||
{
|
||||
if (_Instance is HostObject m)
|
||||
{
|
||||
return new HostObjectProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitGroup? ToGroup()
|
||||
{
|
||||
if (_Instance is Group m)
|
||||
{
|
||||
return new GroupProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitGraphicsStyle? ToGraphicsStyle()
|
||||
{
|
||||
if (_Instance is GraphicsStyle m)
|
||||
{
|
||||
return new GraphicsStyleProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitElementType? ToType()
|
||||
{
|
||||
if (_Instance is ElementType m)
|
||||
{
|
||||
return new ElementTypeProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitSketch? ToSketch()
|
||||
{
|
||||
if (_Instance is Sketch m)
|
||||
{
|
||||
return new SketchProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitFloor? ToFloor()
|
||||
{
|
||||
if (_Instance is Floor m)
|
||||
{
|
||||
return new FloorProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitModelLine? ToModelLine()
|
||||
{
|
||||
if (_Instance is ModelLine m)
|
||||
{
|
||||
return new ModelLineProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitLevel? ToLevel()
|
||||
{
|
||||
if (_Instance is Level m)
|
||||
{
|
||||
return new LevelProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitLocationPoint? GetLocationAsLocationPoint()
|
||||
{
|
||||
if (_Instance.Location is LocationPoint l)
|
||||
{
|
||||
return new LocationPointProxy(l);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitLocationCurve? GetLocationAsLocationCurve()
|
||||
{
|
||||
if (_Instance.Location is LocationCurve l)
|
||||
{
|
||||
return new LocationCurveProxy(l);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
//location can be 3 types and need to handle it?
|
||||
public IRevitLocation Location
|
||||
{
|
||||
get
|
||||
{
|
||||
IRevitLocation? location = GetLocationAsLocationPoint();
|
||||
if (location is not null)
|
||||
{
|
||||
return location;
|
||||
}
|
||||
location = GetLocationAsLocationCurve();
|
||||
if (location is not null)
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
return new LocationProxy(_Instance.Location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(typeof(FamilySymbol), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitFamilySymbolProxy : IRevitFamilySymbol;
|
||||
|
||||
[Proxy(typeof(ElementType), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitElementTypeProxy : IRevitElementType;
|
||||
|
||||
[Proxy(
|
||||
typeof(Category),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "AllowsVisibilityControl", "Visible" }
|
||||
)]
|
||||
public partial interface IRevitCategoryProxy : IRevitCategory;
|
||||
|
||||
[Proxy(
|
||||
typeof(ElementId),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Equals" }
|
||||
)]
|
||||
public partial interface IRevitElementIdProxy : IRevitElementId;
|
||||
|
||||
[Proxy(typeof(CurtainGrid), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitCurtainGridProxy : IRevitCurtainGrid;
|
||||
|
||||
[Proxy(typeof(Wall), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitWallProxy : IRevitWall;
|
||||
|
||||
[Proxy(typeof(WallType), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitWallTypeProxy : IRevitWallType;
|
||||
|
||||
[Proxy(typeof(HostObject), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitHostObjectProxy : IRevitHostObject;
|
||||
|
||||
[Proxy(typeof(Ellipse), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitEllipseProxy : IRevitEllipse;
|
||||
@@ -0,0 +1,97 @@
|
||||
using System.Collections;
|
||||
using Autodesk.Revit.DB;
|
||||
using Speckle.ProxyGenerator;
|
||||
using Speckle.Revit.Interfaces;
|
||||
|
||||
namespace Speckle.Revit.Api;
|
||||
|
||||
[Proxy(
|
||||
typeof(ModelCurveArrArray),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator", "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitModelCurveArrArrayProxy : IRevitModelCurveArrArray;
|
||||
|
||||
public partial class ModelCurveArrArrayProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public int Count => Size;
|
||||
|
||||
public IEnumerator<IRevitModelCurveArray> GetEnumerator() =>
|
||||
new RevitModelCurveArrayIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct RevitModelCurveArrayIterator : IEnumerator<IRevitModelCurveArray>
|
||||
{
|
||||
private readonly ModelCurveArrArrayIterator _curveArrayIterator;
|
||||
|
||||
public RevitModelCurveArrayIterator(ModelCurveArrArrayIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitModelCurveArray Current => new ModelCurveArrayProxy((ModelCurveArray)_curveArrayIterator.Current);
|
||||
}
|
||||
|
||||
public IRevitModelCurveArray this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
var obj = _Instance.get_Item(index);
|
||||
return Mapster.TypeAdapter.Adapt<IRevitModelCurveArray>(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(CurveArrArray),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator", "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitCurveArrArrayProxy : IRevitCurveArrArray;
|
||||
|
||||
public partial class CurveArrArrayProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public int Count => Size;
|
||||
|
||||
public IEnumerator<IRevitCurveArray> GetEnumerator() => new RevitCurveArrayIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct RevitCurveArrayIterator : IEnumerator<IRevitCurveArray>
|
||||
{
|
||||
private readonly CurveArrArrayIterator _curveArrayIterator;
|
||||
|
||||
public RevitCurveArrayIterator(CurveArrArrayIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitCurveArray Current => new CurveArrayProxy((CurveArray)_curveArrayIterator.Current);
|
||||
}
|
||||
|
||||
public IRevitCurveArray this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
var obj = _Instance.get_Item(index);
|
||||
return Mapster.TypeAdapter.Adapt<IRevitCurveArray>(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
using System.Collections;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.PointClouds;
|
||||
using Speckle.ProxyGenerator;
|
||||
using Speckle.Revit.Interfaces;
|
||||
|
||||
namespace Speckle.Revit.Api;
|
||||
|
||||
[Proxy(
|
||||
typeof(ModelCurveArray),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator", "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitModelCurveArrayProxy : IRevitModelCurveArray;
|
||||
|
||||
public partial class ModelCurveArrayProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public int Count => Size;
|
||||
|
||||
public IEnumerator<IRevitModelCurve> GetEnumerator() =>
|
||||
new RevitModelCurveCollectionIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct RevitModelCurveCollectionIterator : IEnumerator<IRevitModelCurve>
|
||||
{
|
||||
private readonly ModelCurveArrayIterator _curveArrayIterator;
|
||||
|
||||
public RevitModelCurveCollectionIterator(ModelCurveArrayIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitModelCurve Current => new ModelCurveProxy((ModelCurve)_curveArrayIterator.Current);
|
||||
}
|
||||
|
||||
public IRevitModelCurve this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
var obj = _Instance.get_Item(index);
|
||||
return Mapster.TypeAdapter.Adapt<IRevitModelCurve>(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(CurveArray),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator", "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitCurveArrayProxy : IRevitCurveArray;
|
||||
|
||||
public partial class CurveArrayProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public int Count => Size;
|
||||
|
||||
public IEnumerator<IRevitCurve> GetEnumerator() => new RevitCurveCollectionIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct RevitCurveCollectionIterator : IEnumerator<IRevitCurve>
|
||||
{
|
||||
private readonly CurveArrayIterator _curveArrayIterator;
|
||||
|
||||
public RevitCurveCollectionIterator(CurveArrayIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitCurve Current => new CurveProxy((Curve)_curveArrayIterator.Current);
|
||||
}
|
||||
|
||||
public IRevitCurve this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
var obj = _Instance.get_Item(index);
|
||||
return Mapster.TypeAdapter.Adapt<IRevitCurve>(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(DoubleArray),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator", "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitDoubleArrayProxy : IRevitDoubleArray;
|
||||
|
||||
public partial class DoubleArrayProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public int Count => Size;
|
||||
|
||||
public IEnumerator<double> GetEnumerator() => new DoubleArrayProxyIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct DoubleArrayProxyIterator : IEnumerator<double>
|
||||
{
|
||||
private readonly DoubleArrayIterator _curveArrayIterator;
|
||||
|
||||
public DoubleArrayProxyIterator(DoubleArrayIterator doubleArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = doubleArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public double Current => (double)_curveArrayIterator.Current;
|
||||
}
|
||||
|
||||
public double this[int index] => _Instance.get_Item(index);
|
||||
}
|
||||
|
||||
public struct RevitCloudPoint : IRevitCloudPoint
|
||||
{
|
||||
public float X { get; }
|
||||
public float Y { get; }
|
||||
public float Z { get; }
|
||||
public int Color { get; }
|
||||
|
||||
public RevitCloudPoint(float x, float y, float z, int color)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
Color = color;
|
||||
}
|
||||
|
||||
public IRevitXYZ ToXYZ() => new XYZProxy(new XYZ(X, Y, Z));
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(RevitCloudPoint),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitCloudPointProxy : IRevitCloudPointList;
|
||||
|
||||
[Proxy(
|
||||
typeof(PointCollection),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator", "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitCloudPointListProxy : IRevitCloudPointList;
|
||||
|
||||
public partial class PointCollectionProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public IEnumerator<IRevitCloudPoint> GetEnumerator() => new RevitCloudPointListIterator(_Instance.GetPointIterator());
|
||||
|
||||
private readonly struct RevitCloudPointListIterator : IEnumerator<IRevitCloudPoint>
|
||||
{
|
||||
private readonly PointIterator _curveArrayIterator;
|
||||
|
||||
public RevitCloudPointListIterator(PointIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitCloudPoint Current
|
||||
{
|
||||
get
|
||||
{
|
||||
var current = _curveArrayIterator.Current;
|
||||
return new RevitCloudPoint(current.X, current.Y, current.Z, current.Color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using Autodesk.Revit.DB;
|
||||
using Speckle.ProxyGenerator;
|
||||
using Speckle.Revit.Interfaces;
|
||||
|
||||
namespace Speckle.Revit.Api;
|
||||
|
||||
[Proxy(typeof(ModelCurve), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitModelCurveProxy : IRevitModelCurve;
|
||||
|
||||
[Proxy(typeof(CurveElement), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitCurveElementProxy : IRevitCurveElement;
|
||||
|
||||
[Proxy(typeof(Curve), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitCurveProxy : IRevitCurve;
|
||||
|
||||
public partial class CurveProxy
|
||||
{
|
||||
public IRevitLine? ToLine()
|
||||
{
|
||||
if (_Instance is Line m)
|
||||
{
|
||||
return new LineProxy(m);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitArc? ToArc()
|
||||
{
|
||||
if (_Instance is Arc m)
|
||||
{
|
||||
return new ArcProxy(m);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitEllipse? ToEllipse()
|
||||
{
|
||||
if (_Instance is Ellipse m)
|
||||
{
|
||||
return new EllipseProxy(m);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitNurbSpline? ToNurbSpline()
|
||||
{
|
||||
if (_Instance is NurbSpline m)
|
||||
{
|
||||
return new NurbSplineProxy(m);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitHermiteSpline? ToHermiteSpline()
|
||||
{
|
||||
if (_Instance is HermiteSpline m)
|
||||
{
|
||||
return new HermiteSplineProxy(m);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(typeof(XYZ), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitXYZProxy : IRevitXYZ;
|
||||
|
||||
[Proxy(
|
||||
typeof(LocationCurve),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "JoinType", "ElementsAtJoin" }
|
||||
)]
|
||||
public partial interface IRevitLocationCurveProxy : IRevitLocationCurve;
|
||||
|
||||
[Proxy(typeof(Location), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitLocationProxy : IRevitLocation;
|
||||
|
||||
[Proxy(
|
||||
typeof(LocationPoint),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitLocationPointProxy : IRevitLocationPoint;
|
||||
@@ -0,0 +1,412 @@
|
||||
using System.Collections;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.Architecture;
|
||||
using Mapster.Utils;
|
||||
using Speckle.ProxyGenerator;
|
||||
using Speckle.Revit.Interfaces;
|
||||
|
||||
namespace Speckle.Revit.Api;
|
||||
|
||||
[Proxy(typeof(Units), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitUnitsProxy : IRevitUnits;
|
||||
|
||||
[Proxy(
|
||||
typeof(FormatOptions),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitFormatOptionsProxy : IRevitFormatOptions;
|
||||
|
||||
[Proxy(
|
||||
typeof(Transform),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Basis" }
|
||||
)]
|
||||
public partial interface IRevitTransformProxy : IRevitTransform;
|
||||
|
||||
public partial class TransformProxy
|
||||
{
|
||||
public void Dispose() => _Instance.Dispose();
|
||||
}
|
||||
|
||||
[Proxy(typeof(BasePoint), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitBasePointProxy : IRevitBasePoint;
|
||||
|
||||
[Proxy(typeof(ParameterSet), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitParameterSetProxy : IRevitParameterSet;
|
||||
|
||||
public partial class ParameterSetProxy
|
||||
{
|
||||
public void Dispose() => _Instance.Dispose();
|
||||
|
||||
IEnumerator<IRevitParameter> IEnumerable<IRevitParameter>.GetEnumerator() =>
|
||||
new ParameterSetProxyIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct ParameterSetProxyIterator : IEnumerator<IRevitParameter>
|
||||
{
|
||||
private readonly ParameterSetIterator _curveArrayIterator;
|
||||
|
||||
public ParameterSetProxyIterator(ParameterSetIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitParameter Current => new ParameterProxy((Parameter)_curveArrayIterator.Current);
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(Parameter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "IsReadOnly", "StorageType" }
|
||||
)]
|
||||
public partial interface IRevitParameterProxy : IRevitParameter;
|
||||
|
||||
public partial class ParameterProxy
|
||||
{
|
||||
public bool IsReadOnly => _Instance.IsReadOnly;
|
||||
public IRevitStorageType StorageType => EnumUtility<StorageType, IRevitStorageType>.Convert(_Instance.StorageType);
|
||||
}
|
||||
|
||||
[Proxy(typeof(Definition), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitDefinitionProxy : IRevitDefinition;
|
||||
|
||||
public partial class DefinitionProxy
|
||||
{
|
||||
public IRevitInternalDefinition? ToInternal()
|
||||
{
|
||||
var id = _Instance as InternalDefinition;
|
||||
if (id is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new InternalDefinitionProxy(id);
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(InternalDefinition),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "ParameterGroup", "Name", "GetGroupTypeId", "BuiltInParameter", "get_ParameterGroup", "set_ParameterGroup" }
|
||||
)]
|
||||
public partial interface IRevitInternalDefinitionProxy : IRevitInternalDefinition;
|
||||
|
||||
public partial class InternalDefinitionProxy
|
||||
{
|
||||
public RevitBuiltInParameter BuiltInParameter =>
|
||||
EnumUtility<BuiltInParameter, RevitBuiltInParameter>.Convert(_Instance.BuiltInParameter);
|
||||
}
|
||||
|
||||
[Proxy(typeof(PolyLine), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitPolyLineProxy : IRevitPolyLine;
|
||||
|
||||
[Proxy(typeof(Point), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitPointProxy : IRevitPoint;
|
||||
|
||||
[Proxy(typeof(Plane), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitPlaneProxy : IRevitPlane;
|
||||
|
||||
public partial class PlaneProxy
|
||||
{
|
||||
public void Dispose() => _Instance.Dispose();
|
||||
}
|
||||
|
||||
[Proxy(typeof(Arc), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitArcProxy : IRevitArc;
|
||||
|
||||
[Proxy(
|
||||
typeof(BoundingBoxXYZ),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "BoundEnabled", "MaxEnabled", "MinEnabled", "Bounds" }
|
||||
)]
|
||||
public partial interface IRevitBoundingBoxXYZProxy : IRevitBoundingBoxXYZ;
|
||||
|
||||
[Proxy(typeof(Line), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitLineProxy : IRevitLine;
|
||||
|
||||
[Proxy(
|
||||
typeof(Mesh),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Transformed", "Triangle" }
|
||||
)]
|
||||
public partial interface IRevitMeshProxy : IRevitMesh;
|
||||
|
||||
public partial class MeshProxy
|
||||
{
|
||||
public IRevitMeshTriangle GetTriangle(int index) => new MeshTriangleProxy(_Instance.get_Triangle(index));
|
||||
|
||||
public IRevitMesh GetTransformed(IRevitTransform inverseTransform) =>
|
||||
new MeshProxy(_Instance.get_Transformed(((TransformProxy)inverseTransform)._Instance));
|
||||
}
|
||||
|
||||
[Proxy(typeof(Material), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitMaterialProxy : IRevitMaterial;
|
||||
|
||||
[Proxy(
|
||||
typeof(MeshTriangle),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Vertex", "Index" }
|
||||
)]
|
||||
public partial interface IRevitMeshTriangleProxy : IRevitMeshTriangle;
|
||||
|
||||
public partial class MeshTriangleProxy
|
||||
{
|
||||
public uint GetIndex(int index) => _Instance.get_Index(index);
|
||||
}
|
||||
|
||||
[Proxy(typeof(NurbSpline), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitNurbSplineProxy : IRevitNurbSpline;
|
||||
|
||||
public partial class NurbSplineProxy
|
||||
{
|
||||
public bool IsRational => _Instance.isRational;
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(HermiteSpline),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitHermiteSplineProxy : IRevitHermiteSpline;
|
||||
|
||||
[Proxy(
|
||||
typeof(PointCloudInstance),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitPointCloudInstanceProxy : IRevitPointCloudInstance;
|
||||
|
||||
[Proxy(typeof(Instance), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitInstanceProxy : IRevitInstance;
|
||||
|
||||
[Proxy(typeof(Level), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitLevelProxy : IRevitLevel;
|
||||
|
||||
[Proxy(
|
||||
typeof(FamilyInstance),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "ToRoom", "FromRoom", "Space", "Room", "StructuralType", "Location" }
|
||||
)]
|
||||
public partial interface IRevitFamilyInstanceProxy : IRevitFamilyInstance;
|
||||
|
||||
public partial class FamilyInstanceProxy
|
||||
{
|
||||
public RevitStructuralType StructuralType =>
|
||||
EnumUtility<Autodesk.Revit.DB.Structure.StructuralType, RevitStructuralType>.Convert(_Instance.StructuralType);
|
||||
}
|
||||
|
||||
[Proxy(typeof(Solid), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitSolidProxy : IRevitSolid;
|
||||
|
||||
[Proxy(
|
||||
typeof(Group),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Location" }
|
||||
)]
|
||||
public partial interface IRevitGroupProxy : IRevitGroup;
|
||||
|
||||
[Proxy(
|
||||
typeof(GeometryObject),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Equals" }
|
||||
)]
|
||||
public partial interface IRevitGeometryObjectProxy : IRevitGeometryObject;
|
||||
|
||||
[Proxy(
|
||||
typeof(Options),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "DetailLevel" }
|
||||
)]
|
||||
public partial interface IRevitOptionsProxy : IRevitOptions;
|
||||
|
||||
public partial class OptionsProxy
|
||||
{
|
||||
public RevitViewDetailLevel DetailLevel =>
|
||||
EnumUtility<ViewDetailLevel, RevitViewDetailLevel>.Convert(_Instance.DetailLevel);
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(Face),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Period", "IsCyclic" }
|
||||
)]
|
||||
public partial interface IRevitFaceProxy : IRevitFace;
|
||||
|
||||
[Proxy(
|
||||
typeof(FaceArray),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitFaceArrayProxy : IRevitFaceArray;
|
||||
|
||||
public partial class FaceArrayProxy
|
||||
{
|
||||
public int Count => _Instance.Size;
|
||||
public IRevitFace this[int index] => new FaceProxy(_Instance.get_Item(index));
|
||||
|
||||
IEnumerator<IRevitFace> IEnumerable<IRevitFace>.GetEnumerator() =>
|
||||
new ParameterSetProxyIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct ParameterSetProxyIterator : IEnumerator<IRevitFace>
|
||||
{
|
||||
private readonly FaceArrayIterator _curveArrayIterator;
|
||||
|
||||
public ParameterSetProxyIterator(FaceArrayIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitFace Current => new FaceProxy((Face)_curveArrayIterator.Current);
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(GeometryElement),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator" }
|
||||
)]
|
||||
public partial interface IRevitGeometryElementProxy : IRevitGeometryElement;
|
||||
|
||||
public partial class GeometryElementProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => new GeometryElementProxyIterator(_Instance.GetEnumerator());
|
||||
|
||||
IEnumerator<IRevitGeometryObject> IEnumerable<IRevitGeometryObject>.GetEnumerator() =>
|
||||
new GeometryElementProxyIterator(_Instance.GetEnumerator());
|
||||
|
||||
private readonly struct GeometryElementProxyIterator : IEnumerator<IRevitGeometryObject>
|
||||
{
|
||||
private readonly IEnumerator<GeometryObject> _curveArrayIterator;
|
||||
|
||||
public GeometryElementProxyIterator(IEnumerator<GeometryObject> curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitGeometryObject Current => new GeometryObjectProxy((GeometryObject)_curveArrayIterator.Current);
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(GeometryInstance),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitGeometryInstanceProxy : IRevitGeometryInstance;
|
||||
|
||||
[Proxy(
|
||||
typeof(GraphicsStyle),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitGraphicsStyleProxy : IRevitGraphicsStyle;
|
||||
|
||||
[Proxy(
|
||||
typeof(BoundarySegment),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitBoundarySegmentProxy : IRevitBoundarySegment;
|
||||
|
||||
[Proxy(typeof(Color), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitColorProxy : IRevitColor;
|
||||
|
||||
[Proxy(typeof(Ceiling), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitCeilingProxy : IRevitCeiling;
|
||||
|
||||
[Proxy(
|
||||
typeof(CeilingAndFloor),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitCeilingAndFloorProxy : IRevitCeilingAndFloor;
|
||||
|
||||
[Proxy(typeof(Sketch), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitSketchProxy : IRevitSketch;
|
||||
|
||||
[Proxy(typeof(SketchBase), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitSketchBaseProxy : IRevitSketchBase;
|
||||
|
||||
[Proxy(typeof(DirectShape), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitDirectShapeProxy : IRevitDirectShape;
|
||||
|
||||
[Proxy(
|
||||
typeof(ExtrusionRoof),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitExtrusionRoofProxy : IRevitExtrusionRoof;
|
||||
|
||||
[Proxy(typeof(RoofBase), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitRoofBaseProxy : IRevitRoofBase;
|
||||
|
||||
[Proxy(typeof(SketchPlane), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitSketchPlaneProxy : IRevitSketchPlane;
|
||||
|
||||
[Proxy(typeof(Floor), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitFloorProxy : IRevitFloor;
|
||||
|
||||
[Proxy(typeof(ModelLine), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitModelLineProxy : IRevitModelLine;
|
||||
|
||||
[Proxy(
|
||||
typeof(FootPrintRoof),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Overhang", "ExtendIntoWall", "Offset", "SlopeAngle", "DefinesSlope" }
|
||||
)]
|
||||
public partial interface IRevitFootPrintRoofProxy : IRevitFootPrintRoof;
|
||||
|
||||
[Proxy(typeof(Room), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitRoomProxy : IRevitRoom;
|
||||
|
||||
[Proxy(
|
||||
typeof(TopographySurface),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitTopographySurfaceProxy : IRevitTopographySurface;
|
||||
|
||||
[Proxy(
|
||||
typeof(SpatialElement),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetBoundarySegments", "Location" }
|
||||
)]
|
||||
public partial interface IRevitSpatialElementProxy : IRevitSpatialElement;
|
||||
|
||||
public partial class SpatialElementProxy
|
||||
{
|
||||
public IEnumerable<IEnumerable<IRevitBoundarySegment>> GetBoundarySegments()
|
||||
{
|
||||
var segments = _Instance.GetBoundarySegments(new SpatialElementBoundaryOptions());
|
||||
foreach (var seg in segments)
|
||||
{
|
||||
yield return GetSegments(seg);
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<IRevitBoundarySegment> GetSegments(IList<BoundarySegment> segments) =>
|
||||
segments.Select(seg => new BoundarySegmentProxy(seg));
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(Panel),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetRefGridLines" }
|
||||
)]
|
||||
public partial interface IRevitPanelProxy : IRevitPanel;
|
||||
@@ -0,0 +1,109 @@
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.PointClouds;
|
||||
using Speckle.ProxyGenerator;
|
||||
using Speckle.Revit.Interfaces;
|
||||
|
||||
namespace Speckle.Revit.Api;
|
||||
|
||||
public class RevitFilterFactory : IRevitFilterFactory
|
||||
{
|
||||
public IRevitElementIsElementTypeFilter CreateElementIsElementTypeFilter(bool inverted) =>
|
||||
new ElementIsElementTypeFilterProxy(new ElementIsElementTypeFilter());
|
||||
|
||||
public IRevitLogicalAndFilterFilter CreateLogicalAndFilter(params IRevitElementFilter[] filters) =>
|
||||
new LogicalAndFilterProxy(
|
||||
new LogicalAndFilter(filters.Cast<ElementFilterProxy>().Select(x => x._Instance).ToList())
|
||||
);
|
||||
|
||||
public IRevitElementMulticategoryFilter CreateElementMulticategoryFilter(
|
||||
ICollection<RevitBuiltInCategory> categories,
|
||||
bool inverted
|
||||
) =>
|
||||
new ElementMulticategoryFilterProxy(
|
||||
instance: new ElementMulticategoryFilter(
|
||||
categories.Select(EnumUtility<RevitBuiltInCategory, BuiltInCategory>.Convert).ToArray(),
|
||||
inverted
|
||||
)
|
||||
);
|
||||
|
||||
public IRevitFilteredElementCollector CreateFilteredElementCollector(
|
||||
IRevitDocument document,
|
||||
params IRevitElementId[] elementIds
|
||||
)
|
||||
{
|
||||
if (elementIds.Any())
|
||||
{
|
||||
return new FilteredElementCollectorProxy(
|
||||
new FilteredElementCollector(
|
||||
((DocumentProxy)document)._Instance,
|
||||
elementIds.Cast<ElementIdProxy>().Select(x => x._Instance).ToList()
|
||||
)
|
||||
);
|
||||
}
|
||||
return new FilteredElementCollectorProxy(new FilteredElementCollector(((DocumentProxy)document)._Instance));
|
||||
}
|
||||
|
||||
public IRevitPointCloudFilter CreateMultiPlaneFilter(params IRevitPlane[] planes) =>
|
||||
new PointCloudFilterProxy(
|
||||
PointCloudFilterFactory.CreateMultiPlaneFilter(planes.Cast<PlaneProxy>().Select(x => x._Instance).ToList())
|
||||
);
|
||||
|
||||
public IRevitElementCategoryFilter CreateElementCategoryFilter(RevitBuiltInCategory category) =>
|
||||
new ElementCategoryFilterProxy(
|
||||
new ElementCategoryFilter(EnumUtility<RevitBuiltInCategory, BuiltInCategory>.Convert(category))
|
||||
);
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(PointCloudFilter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitPointCloudFilterProxy : IRevitPointCloudFilter;
|
||||
|
||||
[Proxy(
|
||||
typeof(ElementFilter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitElementFilterProxy : IRevitElementFilter;
|
||||
|
||||
[Proxy(
|
||||
typeof(ElementCategoryFilter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitElementCategoryFilterProxy : IRevitElementCategoryFilter;
|
||||
|
||||
[Proxy(
|
||||
typeof(ElementIsElementTypeFilter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitElementIsElementTypeFilterProxy : IRevitElementIsElementTypeFilter;
|
||||
|
||||
[Proxy(
|
||||
typeof(ElementMulticategoryFilter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitElementMulticategoryFilterProxy : IRevitElementMulticategoryFilter;
|
||||
|
||||
[Proxy(
|
||||
typeof(LogicalAndFilter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitLogicalAndFilterProxy : IRevitLogicalAndFilterFilter;
|
||||
|
||||
[Proxy(
|
||||
typeof(FilteredElementCollector),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitFilteredElementCollectorProxy : IRevitFilteredElementCollector;
|
||||
|
||||
public partial class FilteredElementCollectorProxy
|
||||
{
|
||||
public IEnumerable<T> OfClass<T>(IProxyMap proxyMap) =>
|
||||
_Instance
|
||||
.OfClass(
|
||||
proxyMap.UnmapType(typeof(T))
|
||||
?? throw new InvalidOperationException($"Could not unmap type: {typeof(T).FullName}")
|
||||
)
|
||||
.Select(x => proxyMap.CreateProxy(typeof(T), x))
|
||||
.Cast<T>();
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using Autodesk.Revit.DB;
|
||||
using Mapster.Utils;
|
||||
using Speckle.Revit.Interfaces;
|
||||
|
||||
namespace Speckle.Revit.Api;
|
||||
|
||||
public class RevitUnitUtils : IRevitUnitUtils
|
||||
{
|
||||
public double ConvertFromInternalUnits(double value, IRevitForgeTypeId forgeTypeId) =>
|
||||
UnitUtils.ConvertFromInternalUnits(value, ((ForgeTypeIdProxy)forgeTypeId)._Instance);
|
||||
|
||||
public IRevitForgeTypeId Length => new ForgeTypeIdProxy(SpecTypeId.Length);
|
||||
public IRevitForgeTypeId Millimeters => new ForgeTypeIdProxy(UnitTypeId.Millimeters);
|
||||
public IRevitForgeTypeId Centimeters => new ForgeTypeIdProxy(UnitTypeId.Centimeters);
|
||||
public IRevitForgeTypeId Meters => new ForgeTypeIdProxy(UnitTypeId.Meters);
|
||||
public IRevitForgeTypeId MetersCentimeters => new ForgeTypeIdProxy(UnitTypeId.MetersCentimeters);
|
||||
public IRevitForgeTypeId Inches => new ForgeTypeIdProxy(UnitTypeId.Inches);
|
||||
public IRevitForgeTypeId FractionalInches => new ForgeTypeIdProxy(UnitTypeId.FractionalInches);
|
||||
public IRevitForgeTypeId Feet => new ForgeTypeIdProxy(UnitTypeId.Feet);
|
||||
public IRevitForgeTypeId FeetFractionalInches => new ForgeTypeIdProxy(UnitTypeId.FeetFractionalInches);
|
||||
}
|
||||
|
||||
public class RevitTransformUtils : IRevitTransformUtils
|
||||
{
|
||||
public IRevitTransform Identity => new TransformProxy(Transform.Identity);
|
||||
|
||||
public IRevitTransform CreateTranslation(IRevitXYZ vector) =>
|
||||
new TransformProxy(Transform.CreateTranslation(((XYZProxy)vector)._Instance));
|
||||
|
||||
public IRevitTransform CreateRotation(IRevitXYZ axis, double angle) =>
|
||||
new TransformProxy(Transform.CreateRotation(((XYZProxy)axis)._Instance, angle));
|
||||
}
|
||||
|
||||
public class RevitXYZUtils : IRevitXYZUtils
|
||||
{
|
||||
public IRevitXYZ Zero => new XYZProxy(XYZ.Zero);
|
||||
public IRevitXYZ BasisX => new XYZProxy(XYZ.BasisX);
|
||||
public IRevitXYZ BasisY => new XYZProxy(XYZ.BasisY);
|
||||
public IRevitXYZ BasisZ => new XYZProxy(XYZ.BasisZ);
|
||||
}
|
||||
|
||||
public class RevitElementIdUtils : IRevitElementIdUtils
|
||||
{
|
||||
public IRevitElementId InvalidElementId => new ElementIdProxy(ElementId.InvalidElementId);
|
||||
}
|
||||
|
||||
public class RevitPlaneUtils : IRevitPlaneUtils
|
||||
{
|
||||
public IRevitPlane CreateByOriginAndBasis(IRevitXYZ center, IRevitXYZ xDirection, IRevitXYZ yDirection) =>
|
||||
new PlaneProxy(
|
||||
Plane.CreateByOriginAndBasis(
|
||||
((XYZProxy)center)._Instance,
|
||||
((XYZProxy)xDirection)._Instance,
|
||||
((XYZProxy)yDirection)._Instance
|
||||
)
|
||||
);
|
||||
|
||||
public IRevitPlane CreateByNormalAndOrigin(IRevitXYZ normal, IRevitXYZ center) =>
|
||||
new PlaneProxy(Plane.CreateByNormalAndOrigin(((XYZProxy)normal)._Instance, ((XYZProxy)center)._Instance));
|
||||
}
|
||||
|
||||
public class RevitNurbSplineUtils : IRevitNurbSplineUtils
|
||||
{
|
||||
public IRevitNurbSpline Create(IRevitHermiteSpline hermiteSpline) =>
|
||||
new NurbSplineProxy(NurbSpline.Create(((HermiteSplineProxy)hermiteSpline)._Instance));
|
||||
}
|
||||
|
||||
public class RevitFormatOptionsUtils : IRevitFormatOptionsUtils
|
||||
{
|
||||
public bool CanHaveSymbol(IRevitForgeTypeId forgeTypeId) =>
|
||||
FormatOptions.CanHaveSymbol(((ForgeTypeIdProxy)forgeTypeId)._Instance);
|
||||
|
||||
public IList<IRevitForgeTypeId> GetValidSymbols(IRevitForgeTypeId forgeTypeId) =>
|
||||
FormatOptions
|
||||
.GetValidSymbols(((ForgeTypeIdProxy)forgeTypeId)._Instance)
|
||||
.Select(x => new ForgeTypeIdProxy(x))
|
||||
.ToList<IRevitForgeTypeId>();
|
||||
|
||||
public string GetLabelForSymbol(IRevitForgeTypeId symbolId) =>
|
||||
LabelUtils.GetLabelForSymbol(((ForgeTypeIdProxy)symbolId)._Instance);
|
||||
}
|
||||
|
||||
public class RevitSolidUtils : IRevitSolidUtils
|
||||
{
|
||||
public IRevitSolid CreateTransformed(IRevitSolid solid, IRevitTransform inverseTransform) =>
|
||||
new SolidProxy(
|
||||
SolidUtils.CreateTransformed(((SolidProxy)solid)._Instance, ((TransformProxy)inverseTransform)._Instance)
|
||||
);
|
||||
}
|
||||
|
||||
public class RevitOptionsFactory : IRevitOptionsFactory
|
||||
{
|
||||
public IRevitOptions Create(RevitViewDetailLevel viewDetailLevel) =>
|
||||
new OptionsProxy(
|
||||
new Options() { DetailLevel = EnumUtility<RevitViewDetailLevel, ViewDetailLevel>.Convert(viewDetailLevel) }
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' < '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
<HasSharedItems>true</HasSharedItems>
|
||||
<SharedGUID>9655be78-8070-4b9f-b0dc-68bb6150b52d</SharedGUID>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<Import_RootNamespace>Speckle.Revit.Api</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)**\*.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E1C43415-3200-45F4-8BF9-A4DD7D7F2ED7}</ProjectGuid>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
|
||||
<PropertyGroup />
|
||||
<Import Project="Speckle.Revit.Api.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace Speckle.Revit.Interfaces
|
||||
{
|
||||
public static class EnumUtility<TSource, TDestination>
|
||||
where TSource : struct, Enum
|
||||
where TDestination : struct, Enum
|
||||
{
|
||||
private static readonly ConcurrentDictionary<TSource, TDestination> _destinations = new();
|
||||
|
||||
static EnumUtility()
|
||||
{
|
||||
var sources = ((TSource[])Enum.GetValues(typeof(TSource))).Select(x => (x.ToString(), x));
|
||||
var destinations = Enum.GetNames(typeof(TDestination))
|
||||
.Select(x => (x, (TDestination)Enum.Parse(typeof(TDestination), x.ToString())))
|
||||
.ToList();
|
||||
foreach (var (name, val) in sources)
|
||||
{
|
||||
var d = destinations.Where(x => x.Item1 == name).ToList();
|
||||
if (d.Any())
|
||||
{
|
||||
foreach (var v in d)
|
||||
{
|
||||
destinations.Remove(v);
|
||||
}
|
||||
_destinations.TryAdd(val, d.Single().Item2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static TDestination Convert(TSource source)
|
||||
{
|
||||
if (_destinations.TryGetValue(source, out var destination))
|
||||
{
|
||||
return destination;
|
||||
}
|
||||
|
||||
throw new InvalidOperationException($"{source} does not exist in destination enum: {typeof(TDestination)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitCategory : IRevitObject
|
||||
{
|
||||
string Name { get; }
|
||||
IRevitElementId Id { get; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitCurtainGrid : IRevitObject
|
||||
{
|
||||
ICollection<IRevitElementId> GetMullionIds();
|
||||
ICollection<IRevitElementId> GetPanelIds();
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitCurve : IRevitGeometryObject
|
||||
{
|
||||
IRevitXYZ GetEndPoint(int index);
|
||||
double Length { get; }
|
||||
IRevitXYZ Evaluate(double parameter, bool normalized);
|
||||
double GetEndParameter(int index);
|
||||
bool IsBound { get; }
|
||||
IList<IRevitXYZ> Tessellate();
|
||||
IRevitLine? ToLine();
|
||||
IRevitArc? ToArc();
|
||||
IRevitEllipse? ToEllipse();
|
||||
IRevitNurbSpline? ToNurbSpline();
|
||||
IRevitHermiteSpline? ToHermiteSpline();
|
||||
}
|
||||
|
||||
public interface IRevitCloudPoint
|
||||
{
|
||||
float X { get; }
|
||||
float Y { get; }
|
||||
float Z { get; }
|
||||
int Color { get; }
|
||||
IRevitXYZ ToXYZ();
|
||||
}
|
||||
|
||||
public interface IRevitCloudPointList : IEnumerable<IRevitCloudPoint>;
|
||||
|
||||
public interface IRevitPointCloudInstance : IRevitInstance
|
||||
{
|
||||
IRevitCloudPointList GetPoints(IRevitPointCloudFilter filter, double averageDistance, int numPoints);
|
||||
}
|
||||
|
||||
public interface IRevitInstance : IRevitElement
|
||||
{
|
||||
IRevitTransform GetTransform();
|
||||
}
|
||||
|
||||
public interface IRevitCurveArray : IReadOnlyList<IRevitCurve>;
|
||||
|
||||
public interface IRevitCurveArrArray : IReadOnlyList<IRevitCurveArray>;
|
||||
|
||||
public interface IRevitEllipse : IRevitCurve
|
||||
{
|
||||
IRevitXYZ Center { get; }
|
||||
IRevitXYZ XDirection { get; }
|
||||
IRevitXYZ YDirection { get; }
|
||||
double RadiusX { get; }
|
||||
double RadiusY { get; }
|
||||
}
|
||||
|
||||
public interface IRevitLevel : IRevitDatumPlane
|
||||
{
|
||||
double Elevation { get; }
|
||||
}
|
||||
|
||||
public interface IRevitDatumPlane : IRevitElement;
|
||||
|
||||
public interface IRevitFamilyInstance : IRevitInstance
|
||||
{
|
||||
IRevitFamilySymbol Symbol { get; }
|
||||
bool FacingFlipped { get; }
|
||||
bool HandFlipped { get; }
|
||||
bool IsSlantedColumn { get; }
|
||||
RevitStructuralType StructuralType { get; }
|
||||
}
|
||||
|
||||
public enum RevitStructuralType
|
||||
{
|
||||
NonStructural,
|
||||
Beam,
|
||||
Brace,
|
||||
Column,
|
||||
Footing,
|
||||
UnknownFraming,
|
||||
}
|
||||
|
||||
public interface IRevitOptionsFactory
|
||||
{
|
||||
IRevitOptions Create(RevitViewDetailLevel viewDetailLevel);
|
||||
}
|
||||
|
||||
public enum RevitViewDetailLevel
|
||||
{
|
||||
Undefined,
|
||||
Coarse,
|
||||
Medium,
|
||||
Fine,
|
||||
}
|
||||
|
||||
public interface IRevitOptions
|
||||
{
|
||||
RevitViewDetailLevel DetailLevel { get; }
|
||||
bool ComputeReferences { get; set; }
|
||||
}
|
||||
|
||||
public interface IRevitGroup : IRevitElement
|
||||
{
|
||||
IList<IRevitElementId> GetMemberIds();
|
||||
}
|
||||
|
||||
public interface IRevitSolid : IRevitGeometryObject
|
||||
{
|
||||
IRevitFaceArray Faces { get; }
|
||||
double SurfaceArea { get; }
|
||||
}
|
||||
|
||||
public interface IRevitFace
|
||||
{
|
||||
IRevitMesh Triangulate();
|
||||
IRevitElementId MaterialElementId { get; }
|
||||
}
|
||||
|
||||
public interface IRevitFaceArray : IReadOnlyList<IRevitFace>;
|
||||
|
||||
public interface IRevitGeometryElement : IRevitGeometryObject, IEnumerable<IRevitGeometryObject>;
|
||||
|
||||
public interface IRevitFloor : IRevitCeilingAndFloor
|
||||
{
|
||||
IRevitElementId SketchId { get; }
|
||||
}
|
||||
|
||||
public interface IRevitModelLine : IRevitModelCurve;
|
||||
|
||||
public interface IRevitFootPrintRoof : IRevitRoofBase
|
||||
{
|
||||
IRevitModelCurveArrArray GetProfiles();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitCurveElement : IRevitElement
|
||||
{
|
||||
IRevitCurve GeometryCurve { get; }
|
||||
IRevitSketchPlane SketchPlane { get; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma warning disable CA1040
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitDocument : IRevitObject
|
||||
{
|
||||
string PathName { get; }
|
||||
bool IsFamilyDocument { get; }
|
||||
IRevitUnits GetUnits();
|
||||
|
||||
IRevitElement GetElement(IRevitElementId elementId);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitElement : IRevitObject
|
||||
{
|
||||
IList<IRevitElementId> GetDependentElements(IRevitElementFilter filter);
|
||||
|
||||
IRevitElementId Id { get; }
|
||||
string UniqueId { get; }
|
||||
IRevitElementId LevelId { get; }
|
||||
IRevitCategory Category { get; }
|
||||
IRevitDocument Document { get; }
|
||||
IRevitElementId GetTypeId();
|
||||
string Name { get; }
|
||||
IRevitBoundingBoxXYZ GetBoundingBox();
|
||||
|
||||
IRevitFamilySymbol? ToFamilySymbol();
|
||||
IRevitMaterial? ToMaterial();
|
||||
IRevitHostObject? ToHostObject();
|
||||
IRevitGroup? ToGroup();
|
||||
IRevitGraphicsStyle? ToGraphicsStyle();
|
||||
IRevitElementType? ToType();
|
||||
IRevitSketch? ToSketch();
|
||||
IRevitFloor? ToFloor();
|
||||
IRevitModelLine? ToModelLine();
|
||||
IRevitLevel? ToLevel();
|
||||
IRevitLocation Location { get; }
|
||||
|
||||
IRevitLocationPoint? GetLocationAsLocationPoint();
|
||||
IRevitLocationCurve? GetLocationAsLocationCurve();
|
||||
|
||||
IRevitParameterSet Parameters { get; }
|
||||
|
||||
IRevitParameter? GetParameter(RevitBuiltInParameter parameter);
|
||||
|
||||
IRevitGeometryElement GetGeometry(IRevitOptions options);
|
||||
}
|
||||
|
||||
public interface IRevitParameterSet : IEnumerable<IRevitParameter>, IDisposable;
|
||||
|
||||
public interface IRevitElementType
|
||||
{
|
||||
string Name { get; }
|
||||
string FamilyName { get; }
|
||||
}
|
||||
|
||||
public interface IRevitFamilySymbol : IRevitElementType;
|
||||
|
||||
public interface IRevitBasePoint : IRevitElement
|
||||
{
|
||||
bool IsShared { get; }
|
||||
IRevitXYZ Position { get; }
|
||||
}
|
||||
|
||||
public interface IRevitParameter
|
||||
{
|
||||
bool IsReadOnly { get; }
|
||||
bool HasValue { get; }
|
||||
bool IsShared { get; }
|
||||
Guid GUID { get; }
|
||||
string? AsString();
|
||||
|
||||
int AsInteger();
|
||||
double AsDouble();
|
||||
IRevitElementId? AsElementId();
|
||||
IRevitStorageType StorageType { get; }
|
||||
IRevitForgeTypeId GetUnitTypeId();
|
||||
IRevitDefinition Definition { get; }
|
||||
}
|
||||
|
||||
public interface IRevitDefinition
|
||||
{
|
||||
IRevitInternalDefinition? ToInternal();
|
||||
string Name { get; }
|
||||
IRevitForgeTypeId GetGroupTypeId();
|
||||
IRevitForgeTypeId GetDataType();
|
||||
}
|
||||
|
||||
public interface IRevitInternalDefinition : IRevitDefinition
|
||||
{
|
||||
RevitBuiltInParameter BuiltInParameter { get; }
|
||||
}
|
||||
|
||||
public enum IRevitStorageType
|
||||
{
|
||||
None,
|
||||
Integer,
|
||||
Double,
|
||||
String,
|
||||
ElementId,
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitElementFilter : IRevitObject;
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitElementId : IRevitObject
|
||||
{
|
||||
int IntegerValue { get; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitElementIsElementTypeFilter : IRevitElementFilter;
|
||||
|
||||
public interface IRevitPointCloudFilter : IRevitElementFilter;
|
||||
|
||||
public interface IRevitElementCategoryFilter : IRevitElementFilter, IDisposable;
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitElementMulticategoryFilter : IRevitElementFilter { }
|
||||
public interface IRevitElementMulticategoryFilter : IRevitElementFilter;
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
#pragma warning disable CA1040
|
||||
public interface IRevitFilterFactory
|
||||
{
|
||||
IRevitElementIsElementTypeFilter CreateElementIsElementTypeFilter(bool inverted);
|
||||
IRevitElementMulticategoryFilter CreateElementMulticategoryFilter(
|
||||
ICollection<RevitBuiltInCategory> categories,
|
||||
bool inverted
|
||||
);
|
||||
IRevitLogicalAndFilterFilter CreateLogicalAndFilter(params IRevitElementFilter[] filters);
|
||||
IRevitFilteredElementCollector CreateFilteredElementCollector(
|
||||
IRevitDocument document,
|
||||
params IRevitElementId[] elementIds
|
||||
);
|
||||
|
||||
IRevitPointCloudFilter CreateMultiPlaneFilter(params IRevitPlane[] planes);
|
||||
IRevitElementCategoryFilter CreateElementCategoryFilter(RevitBuiltInCategory category);
|
||||
}
|
||||
|
||||
public interface IProxyMap
|
||||
{
|
||||
Type? GetMappedType(Type type);
|
||||
Type? UnmapType(Type type);
|
||||
|
||||
object CreateProxy(Type type, object toWrap);
|
||||
}
|
||||
|
||||
// ghetto default interface implementation :(
|
||||
public static class ProxyMapExtensions
|
||||
{
|
||||
public static (Type, object)? WrapIfExists(this IProxyMap proxyMap, Type target, object toWrap)
|
||||
{
|
||||
var proxyType = proxyMap.GetMappedType(target);
|
||||
if (proxyType is not null)
|
||||
{
|
||||
return (proxyType, proxyMap.CreateProxy(proxyType, toWrap));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitFilteredElementCollector : IRevitElementFilter
|
||||
{
|
||||
IEnumerable<T> OfClass<T>(IProxyMap proxyMap);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitForgeTypeId : IRevitObject
|
||||
{
|
||||
string TypeId { get; }
|
||||
bool Empty();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitFormatOptions : IRevitObject
|
||||
{
|
||||
IRevitForgeTypeId GetUnitTypeId();
|
||||
}
|
||||
|
||||
public interface IRevitFormatOptionsUtils
|
||||
{
|
||||
bool CanHaveSymbol(IRevitForgeTypeId forgeTypeId);
|
||||
IList<IRevitForgeTypeId> GetValidSymbols(IRevitForgeTypeId forgeTypeId);
|
||||
string GetLabelForSymbol(IRevitForgeTypeId symbolId);
|
||||
}
|
||||
|
||||
public interface IRevitSolidUtils
|
||||
{
|
||||
IRevitSolid CreateTransformed(IRevitSolid solid, IRevitTransform inverseTransform);
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitHostObject : IRevitElement
|
||||
{
|
||||
@@ -8,4 +8,4 @@ public interface IRevitHostObject : IRevitElement
|
||||
bool includeEmbeddedWalls,
|
||||
bool includeSharedEmbeddedInserts
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitLocation : IRevitObject;
|
||||
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitLocationCurve : IRevitLocation
|
||||
{
|
||||
IRevitCurve Curve { get; }
|
||||
}
|
||||
|
||||
public interface IRevitPolyLine : IRevitGeometryObject
|
||||
{
|
||||
IList<IRevitXYZ> GetCoordinates();
|
||||
}
|
||||
|
||||
public interface IRevitGeometryObject : IRevitObject
|
||||
{
|
||||
IRevitElementId GraphicsStyleId { get; }
|
||||
}
|
||||
|
||||
public interface IRevitPoint : IRevitObject
|
||||
{
|
||||
IRevitXYZ Coord { get; }
|
||||
}
|
||||
|
||||
public interface IRevitPlane : IRevitSurface
|
||||
{
|
||||
IRevitXYZ Origin { get; }
|
||||
IRevitXYZ Normal { get; }
|
||||
IRevitXYZ XVec { get; }
|
||||
IRevitXYZ YVec { get; }
|
||||
}
|
||||
|
||||
public interface IRevitSurface : IRevitObject, IDisposable;
|
||||
|
||||
public interface IRevitLine : IRevitCurve;
|
||||
|
||||
public interface IRevitArc : IRevitCurve
|
||||
{
|
||||
IRevitXYZ Center { get; }
|
||||
IRevitXYZ XDirection { get; }
|
||||
IRevitXYZ YDirection { get; }
|
||||
|
||||
double Radius { get; }
|
||||
IRevitXYZ Normal { get; }
|
||||
bool IsClosed { get; }
|
||||
}
|
||||
|
||||
public interface IRevitMesh : IRevitGeometryObject
|
||||
{
|
||||
IList<IRevitXYZ> Vertices { get; }
|
||||
IRevitElementId MaterialElementId { get; }
|
||||
int NumTriangles { get; }
|
||||
IRevitMeshTriangle GetTriangle(int index);
|
||||
IRevitMesh GetTransformed(IRevitTransform transform);
|
||||
}
|
||||
|
||||
public interface IRevitMaterial : IRevitElement
|
||||
{
|
||||
int Transparency { get; }
|
||||
IRevitColor Color { get; }
|
||||
}
|
||||
|
||||
public interface IRevitColor
|
||||
{
|
||||
byte Red { get; }
|
||||
byte Green { get; }
|
||||
byte Blue { get; }
|
||||
}
|
||||
|
||||
public interface IRevitMeshTriangle
|
||||
{
|
||||
uint GetIndex(int idx);
|
||||
}
|
||||
|
||||
public interface IRevitHermiteSpline : IRevitCurve;
|
||||
|
||||
public interface IRevitNurbSpline : IRevitCurve
|
||||
{
|
||||
IList<IRevitXYZ> CtrlPoints { get; }
|
||||
IRevitDoubleArray Weights { get; }
|
||||
IRevitDoubleArray Knots { get; }
|
||||
int Degree { get; }
|
||||
bool IsRational { get; }
|
||||
bool IsClosed { get; }
|
||||
}
|
||||
|
||||
public interface IRevitDoubleArray : IReadOnlyList<double>;
|
||||
|
||||
public interface IRevitGeometryInstance : IRevitGeometryObject
|
||||
{
|
||||
IRevitGeometryElement GetSymbolGeometry();
|
||||
IRevitGeometryElement GetInstanceGeometry();
|
||||
}
|
||||
|
||||
public interface IRevitGraphicsStyle : IRevitElement
|
||||
{
|
||||
IRevitCategory GraphicsStyleCategory { get; }
|
||||
}
|
||||
|
||||
public interface IRevitBoundarySegment : IRevitObject
|
||||
{
|
||||
IRevitCurve GetCurve();
|
||||
}
|
||||
|
||||
public interface IRevitCeiling : IRevitCeilingAndFloor
|
||||
{
|
||||
IRevitElementId SketchId { get; }
|
||||
}
|
||||
|
||||
public interface IRevitCeilingAndFloor : IRevitHostObject;
|
||||
|
||||
public interface IRevitSketch : IRevitSketchBase
|
||||
{
|
||||
IRevitCurveArrArray Profile { get; }
|
||||
|
||||
IList<IRevitElementId> GetAllElements();
|
||||
}
|
||||
|
||||
public interface IRevitDirectShape : IRevitElement;
|
||||
|
||||
public interface IRevitExtrusionRoof : IRevitRoofBase
|
||||
{
|
||||
IRevitModelCurveArray GetProfile();
|
||||
}
|
||||
|
||||
public interface IRevitSketchBase : IRevitElement;
|
||||
|
||||
public interface IRevitRoofBase : IRevitHostObject;
|
||||
|
||||
public interface IRevitSketchPlane : IRevitElement
|
||||
{
|
||||
IRevitPlane GetPlane();
|
||||
}
|
||||
|
||||
public interface IRevitRoom : IRevitSpatialElement;
|
||||
|
||||
public interface IRevitSpatialElement : IRevitElement
|
||||
{
|
||||
IEnumerable<IEnumerable<IRevitBoundarySegment>> GetBoundarySegments();
|
||||
string Number { get; }
|
||||
IRevitLevel Level { get; }
|
||||
}
|
||||
|
||||
public interface IRevitTopographySurface : IRevitElement;
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitLocationPoint : IRevitLocation
|
||||
{
|
||||
IRevitXYZ Point { get; }
|
||||
}
|
||||
double Rotation { get; }
|
||||
}
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitLogicalAndFilterFilter : IRevitElementFilter { }
|
||||
public interface IRevitLogicalAndFilterFilter : IRevitElementFilter;
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitModelCurve : IRevitCurveElement
|
||||
{
|
||||
IRevitGraphicsStyle Subcategory { get; }
|
||||
IRevitElement LineStyle { get; }
|
||||
}
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitModelCurveArrArray : IReadOnlyList<IRevitModelCurveArray> { }
|
||||
public interface IRevitModelCurveArrArray : IReadOnlyList<IRevitModelCurveArray>;
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitModelCurveArray : IReadOnlyList<IRevitModelCurve>;
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitNurbSplineUtils
|
||||
{
|
||||
IRevitNurbSpline Create(IRevitHermiteSpline hermiteSpline);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitObject;
|
||||
|
||||
public interface IRevitPanel : IRevitFamilyInstance;
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitTransform : IRevitObject, IDisposable
|
||||
{
|
||||
IRevitXYZ OfPoint(IRevitXYZ inbound);
|
||||
IRevitXYZ OfVector(IRevitXYZ inbound);
|
||||
IRevitTransform Multiply(IRevitTransform right);
|
||||
IRevitXYZ Origin { get; }
|
||||
IRevitXYZ BasisX { get; }
|
||||
IRevitXYZ BasisY { get; }
|
||||
IRevitTransform Inverse { get; }
|
||||
}
|
||||
|
||||
public interface IRevitTransformUtils
|
||||
{
|
||||
IRevitTransform Identity { get; }
|
||||
IRevitTransform CreateTranslation(IRevitXYZ vector);
|
||||
IRevitTransform CreateRotation(IRevitXYZ axis, double angle);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitUnitUtils
|
||||
{
|
||||
double ConvertFromInternalUnits(double value, IRevitForgeTypeId forgeTypeId);
|
||||
IRevitForgeTypeId Length { get; }
|
||||
IRevitForgeTypeId Millimeters { get; }
|
||||
IRevitForgeTypeId Centimeters { get; }
|
||||
IRevitForgeTypeId Meters { get; }
|
||||
IRevitForgeTypeId MetersCentimeters { get; }
|
||||
IRevitForgeTypeId Inches { get; }
|
||||
IRevitForgeTypeId FractionalInches { get; }
|
||||
IRevitForgeTypeId Feet { get; }
|
||||
IRevitForgeTypeId FeetFractionalInches { get; }
|
||||
}
|
||||
|
||||
public interface IRevitPlaneUtils
|
||||
{
|
||||
IRevitPlane CreateByOriginAndBasis(IRevitXYZ center, IRevitXYZ xDirection, IRevitXYZ yDirection);
|
||||
IRevitPlane CreateByNormalAndOrigin(IRevitXYZ normal, IRevitXYZ center);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitUnits : IRevitObject
|
||||
{
|
||||
IRevitFormatOptions GetFormatOptions(IRevitForgeTypeId length);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitWall : IRevitHostObject
|
||||
{
|
||||
IRevitCurtainGrid CurtainGrid { get; }
|
||||
bool IsStackedWall { get; }
|
||||
IList<IRevitElementId> GetStackedWallMemberIds();
|
||||
IRevitWallType WallType { get; }
|
||||
bool Flipped { get; }
|
||||
IRevitElementId SketchId { get; }
|
||||
}
|
||||
|
||||
public interface IRevitWallType : IRevitElementType;
|
||||
@@ -0,0 +1,39 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitXYZ : IRevitObject
|
||||
{
|
||||
double Z { get; }
|
||||
|
||||
double Y { get; }
|
||||
|
||||
double X { get; }
|
||||
double DistanceTo(IRevitXYZ source);
|
||||
|
||||
IRevitXYZ Multiply(double value);
|
||||
IRevitXYZ Divide(double value);
|
||||
IRevitXYZ Add(IRevitXYZ source);
|
||||
IRevitXYZ Subtract(IRevitXYZ source);
|
||||
IRevitXYZ Normalize();
|
||||
double AngleOnPlaneTo(IRevitXYZ right, IRevitXYZ normal);
|
||||
IRevitXYZ Negate();
|
||||
}
|
||||
|
||||
public interface IRevitBoundingBoxXYZ
|
||||
{
|
||||
IRevitXYZ Min { get; }
|
||||
IRevitXYZ Max { get; }
|
||||
IRevitTransform Transform { get; }
|
||||
}
|
||||
|
||||
public interface IRevitXYZUtils
|
||||
{
|
||||
IRevitXYZ Zero { get; }
|
||||
IRevitXYZ BasisX { get; }
|
||||
IRevitXYZ BasisY { get; }
|
||||
IRevitXYZ BasisZ { get; }
|
||||
}
|
||||
|
||||
public interface IRevitElementIdUtils
|
||||
{
|
||||
IRevitElementId InvalidElementId { get; }
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' < '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
<HasSharedItems>true</HasSharedItems>
|
||||
<SharedGUID>9655be78-8070-4b9f-b0dc-68bb6150b52e</SharedGUID>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<Import_RootNamespace>Speckle.Revit.Interfaces</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)**\*.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E1C43415-3200-45F4-8BF9-A4DD7D7F2ED6}</ProjectGuid>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
|
||||
<PropertyGroup />
|
||||
<Import Project="Speckle.Revit.Interfaces.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,94 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Revit", "Revit", "{8F540B7F-7548-46E9-BDEC-4DAB99367908}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
Revit\Directory.Build.props = Revit\Directory.Build.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{7A91F6BF-EA8A-428E-BB97-B6C448C247EF}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
Directory.Build.props = Directory.Build.props
|
||||
global.json = global.json
|
||||
README.md = README.md
|
||||
Directory.Packages.props = Directory.Packages.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Revit2023.Api", "Revit\Revit2023\Speckle.Revit2023.Api\Speckle.Revit2023.Api.csproj", "{BE42055B-1D53-49AC-8B76-B55871E24E8B}"
|
||||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Revit.Interfaces", "Revit\Speckle.Revit.Interfaces\Speckle.Revit.Interfaces.shproj", "{E1C43415-3200-45F4-8BF9-A4DD7D7F2ED6}"
|
||||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Revit.Api", "Revit\Speckle.Revit.Api\Speckle.Revit.Api.shproj", "{E1C43415-3200-45F4-8BF9-A4DD7D7F2ED7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Revit2023.Interfaces", "Revit\Revit2023\Speckle.Revit2023.Interfaces\Speckle.Revit2023.Interfaces.csproj", "{F6943FEF-C6AD-4374-9729-CCB79F9BD6C6}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2023", "2023", "{CB5177F3-6FA5-4351-8BF1-3F6F2758096D}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
Revit\Revit2023\Directory.Packages.props = Revit\Revit2023\Directory.Packages.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2024", "2024", "{8B47C7AE-9C8C-47D5-A3C5-ACEFCF54E3B9}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
Revit\Revit2024\Directory.Packages.props = Revit\Revit2024\Directory.Packages.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Revit2024.Interfaces", "Revit\Revit2024\Speckle.Revit2024.Interfaces\Speckle.Revit2024.Interfaces.csproj", "{E5BCFB04-C8E2-4F34-8E12-E4E6CB908153}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Revit2024.Api", "Revit\Revit2024\Speckle.Revit2024.Api\Speckle.Revit2024.Api.csproj", "{917D7C89-FA2D-4A26-906B-E18317C49734}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build", "Build\Build.csproj", "{00F3BEC6-614D-4AEE-923A-0E2DF40FDE6B}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{42C36267-88A8-4F94-9E62-5D43A02D033C}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.github\workflows\ci.yml = .github\workflows\ci.yml
|
||||
.github\workflows\main.yml = .github\workflows\main.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Tests", "Speckle.Tests\Speckle.Tests.csproj", "{D909A986-7D4F-45A6-B0A2-D69D4CEF86C5}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{1A746BD2-E68A-4877-9922-3549F6C00EDF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{BE42055B-1D53-49AC-8B76-B55871E24E8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BE42055B-1D53-49AC-8B76-B55871E24E8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BE42055B-1D53-49AC-8B76-B55871E24E8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BE42055B-1D53-49AC-8B76-B55871E24E8B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F6943FEF-C6AD-4374-9729-CCB79F9BD6C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F6943FEF-C6AD-4374-9729-CCB79F9BD6C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F6943FEF-C6AD-4374-9729-CCB79F9BD6C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F6943FEF-C6AD-4374-9729-CCB79F9BD6C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E5BCFB04-C8E2-4F34-8E12-E4E6CB908153}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E5BCFB04-C8E2-4F34-8E12-E4E6CB908153}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E5BCFB04-C8E2-4F34-8E12-E4E6CB908153}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E5BCFB04-C8E2-4F34-8E12-E4E6CB908153}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{917D7C89-FA2D-4A26-906B-E18317C49734}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{917D7C89-FA2D-4A26-906B-E18317C49734}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{917D7C89-FA2D-4A26-906B-E18317C49734}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{917D7C89-FA2D-4A26-906B-E18317C49734}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{00F3BEC6-614D-4AEE-923A-0E2DF40FDE6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{00F3BEC6-614D-4AEE-923A-0E2DF40FDE6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{00F3BEC6-614D-4AEE-923A-0E2DF40FDE6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{00F3BEC6-614D-4AEE-923A-0E2DF40FDE6B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D909A986-7D4F-45A6-B0A2-D69D4CEF86C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D909A986-7D4F-45A6-B0A2-D69D4CEF86C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D909A986-7D4F-45A6-B0A2-D69D4CEF86C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D909A986-7D4F-45A6-B0A2-D69D4CEF86C5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{CB5177F3-6FA5-4351-8BF1-3F6F2758096D} = {8F540B7F-7548-46E9-BDEC-4DAB99367908}
|
||||
{BE42055B-1D53-49AC-8B76-B55871E24E8B} = {CB5177F3-6FA5-4351-8BF1-3F6F2758096D}
|
||||
{F6943FEF-C6AD-4374-9729-CCB79F9BD6C6} = {CB5177F3-6FA5-4351-8BF1-3F6F2758096D}
|
||||
{E1C43415-3200-45F4-8BF9-A4DD7D7F2ED7} = {8F540B7F-7548-46E9-BDEC-4DAB99367908}
|
||||
{E1C43415-3200-45F4-8BF9-A4DD7D7F2ED6} = {8F540B7F-7548-46E9-BDEC-4DAB99367908}
|
||||
{8B47C7AE-9C8C-47D5-A3C5-ACEFCF54E3B9} = {8F540B7F-7548-46E9-BDEC-4DAB99367908}
|
||||
{E5BCFB04-C8E2-4F34-8E12-E4E6CB908153} = {8B47C7AE-9C8C-47D5-A3C5-ACEFCF54E3B9}
|
||||
{917D7C89-FA2D-4A26-906B-E18317C49734} = {8B47C7AE-9C8C-47D5-A3C5-ACEFCF54E3B9}
|
||||
{00F3BEC6-614D-4AEE-923A-0E2DF40FDE6B} = {42C36267-88A8-4F94-9E62-5D43A02D033C}
|
||||
{D909A986-7D4F-45A6-B0A2-D69D4CEF86C5} = {1A746BD2-E68A-4877-9922-3549F6C00EDF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitCategory
|
||||
{
|
||||
string Name { get; }
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitCurtainGrid
|
||||
{
|
||||
ICollection<IRevitElementId> GetMullionIds();
|
||||
ICollection<IRevitElementId> GetPanelIds();
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitCurve
|
||||
{
|
||||
IRevitXYZ GetEndPoint(int index);
|
||||
double Length { get; }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitCurveElement
|
||||
{
|
||||
IRevitCurve GeometryCurve { get; }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitElement
|
||||
{
|
||||
IList<IRevitElementId> GetDependentElements(IRevitElementFilter filter);
|
||||
|
||||
IRevitElementId Id { get; }
|
||||
IRevitElementId LevelId { get; }
|
||||
IRevitCategory Category { get; }
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitElementFilter { }
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitElementId { }
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitElementIsElementTypeFilter : IRevitElementFilter { }
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitFilteredElementCollector : IRevitElementFilter
|
||||
{
|
||||
IEnumerable<T> OfClass<T>();
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitForgeTypeId { }
|
||||
@@ -1,9 +0,0 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
[SuppressMessage("Design", "CA1040:Avoid empty interfaces")]
|
||||
public interface IRevitFormatOptions
|
||||
{
|
||||
IRevitForgeTypeId GetUnitTypeId();
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
[SuppressMessage("Design", "CA1040:Avoid empty interfaces")]
|
||||
public interface IRevitLocation { }
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitLocationCurve : IRevitLocation
|
||||
{
|
||||
IRevitCurve Curve { get; }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitUnitUtils
|
||||
{
|
||||
double ConvertFromInternalUnits(double value, IRevitForgeTypeId forgeTypeId);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitWall : IRevitHostObject
|
||||
{
|
||||
IRevitCurtainGrid CurtainGrid { get; }
|
||||
bool IsStackedWall { get; }
|
||||
IList<IRevitElementId> GetStackedWallMemberIds();
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Speckle.Revit2023.Interfaces;
|
||||
|
||||
public interface IRevitXYZ
|
||||
{
|
||||
double DistanceTo(IRevitXYZ source);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using Speckle.Revit.Interfaces;
|
||||
|
||||
namespace Speckle.Tests;
|
||||
|
||||
public class EnumUtilityTests
|
||||
{
|
||||
public enum Test1
|
||||
{
|
||||
X = 1,
|
||||
Y = 2,
|
||||
}
|
||||
|
||||
public enum Test2
|
||||
{
|
||||
X = 3,
|
||||
Y = 4
|
||||
}
|
||||
|
||||
public enum Test3
|
||||
{
|
||||
X = 3,
|
||||
XX = 4
|
||||
}
|
||||
|
||||
public enum Test4
|
||||
{
|
||||
X = 3,
|
||||
XX = 3,
|
||||
Y = 4
|
||||
}
|
||||
|
||||
public enum NonDefined1
|
||||
{
|
||||
Xstandard,
|
||||
Ystandard
|
||||
}
|
||||
|
||||
public enum NonDefined2
|
||||
{
|
||||
Xstandard,
|
||||
Ystandard
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Works_1_2()
|
||||
{
|
||||
var x = EnumUtility<Test1, Test2>.Convert(Test1.X);
|
||||
x.Should().Be(Test2.X);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Works_1_3()
|
||||
{
|
||||
var x = EnumUtility<Test1, Test3>.Convert(Test1.X);
|
||||
x.Should().Be(Test3.X);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Works_2_4()
|
||||
{
|
||||
var x = EnumUtility<Test2, Test4>.Convert(Test2.Y);
|
||||
x.Should().Be(Test4.Y);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Works_4_2()
|
||||
{
|
||||
var x = EnumUtility<Test4, Test2>.Convert(Test4.XX);
|
||||
x.Should().Be(Test2.X);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Works_D1_D2()
|
||||
{
|
||||
var x = EnumUtility<NonDefined1, NonDefined2>.Convert(NonDefined1.Xstandard);
|
||||
x.Should().Be(NonDefined2.Xstandard);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FluentAssertions" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
|
||||
<PackageReference Include="Moq" />
|
||||
<PackageReference Include="NUnit"/>
|
||||
<PackageReference Include="NUnit.Analyzers" />
|
||||
<PackageReference Include="coverlet.collector" />
|
||||
<PackageReference Include="NUnit3TestAdapter" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Revit\Revit2023\Speckle.Revit2023.Interfaces\Speckle.Revit2023.Interfaces.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,120 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dependencies": {
|
||||
"net8.0": {
|
||||
"coverlet.collector": {
|
||||
"type": "Direct",
|
||||
"requested": "[6.0.2, )",
|
||||
"resolved": "6.0.2",
|
||||
"contentHash": "bJShQ6uWRTQ100ZeyiMqcFlhP7WJ+bCuabUs885dJiBEzMsJMSFr7BOyeCw4rgvQokteGi5rKQTlkhfQPUXg2A=="
|
||||
},
|
||||
"FluentAssertions": {
|
||||
"type": "Direct",
|
||||
"requested": "[6.12.0, )",
|
||||
"resolved": "6.12.0",
|
||||
"contentHash": "ZXhHT2YwP9lajrwSKbLlFqsmCCvFJMoRSK9t7sImfnCyd0OB3MhgxdoMcVqxbq1iyxD6mD2fiackWmBb7ayiXQ==",
|
||||
"dependencies": {
|
||||
"System.Configuration.ConfigurationManager": "4.4.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.NET.Test.Sdk": {
|
||||
"type": "Direct",
|
||||
"requested": "[17.10.0, )",
|
||||
"resolved": "17.10.0",
|
||||
"contentHash": "0/2HeACkaHEYU3wc83YlcD2Fi4LMtECJjqrtvw0lPi9DCEa35zSPt1j4fuvM8NagjDqJuh1Ja35WcRtn1Um6/A==",
|
||||
"dependencies": {
|
||||
"Microsoft.CodeCoverage": "17.10.0",
|
||||
"Microsoft.TestPlatform.TestHost": "17.10.0"
|
||||
}
|
||||
},
|
||||
"Moq": {
|
||||
"type": "Direct",
|
||||
"requested": "[4.20.70, )",
|
||||
"resolved": "4.20.70",
|
||||
"contentHash": "4rNnAwdpXJBuxqrOCzCyICXHSImOTRktCgCWXWykuF1qwoIsVvEnR7PjbMk/eLOxWvhmj5Kwt+kDV3RGUYcNwg==",
|
||||
"dependencies": {
|
||||
"Castle.Core": "5.1.1"
|
||||
}
|
||||
},
|
||||
"NUnit": {
|
||||
"type": "Direct",
|
||||
"requested": "[4.1.0, )",
|
||||
"resolved": "4.1.0",
|
||||
"contentHash": "MT/DpAhjtiytzhTgTqIhBuWx4y26PKfDepYUHUM+5uv4TsryHC2jwFo5e6NhWkApCm/G6kZ80dRjdJFuAxq3rg=="
|
||||
},
|
||||
"NUnit.Analyzers": {
|
||||
"type": "Direct",
|
||||
"requested": "[4.2.0, )",
|
||||
"resolved": "4.2.0",
|
||||
"contentHash": "4fJojPkzdoa4nB2+p6U+fITvPnVvwWSnsmiJ/Dl30xqiL3oxNbYvfeSLVd91hOmEjoUqSwN3Z7j1aFedjqWbUA=="
|
||||
},
|
||||
"NUnit3TestAdapter": {
|
||||
"type": "Direct",
|
||||
"requested": "[4.5.0, )",
|
||||
"resolved": "4.5.0",
|
||||
"contentHash": "s8JpqTe9bI2f49Pfr3dFRfoVSuFQyraTj68c3XXjIS/MRGvvkLnrg6RLqnTjdShX+AdFUCCU/4Xex58AdUfs6A=="
|
||||
},
|
||||
"Castle.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.1.1",
|
||||
"contentHash": "rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==",
|
||||
"dependencies": {
|
||||
"System.Diagnostics.EventLog": "6.0.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeCoverage": {
|
||||
"type": "Transitive",
|
||||
"resolved": "17.10.0",
|
||||
"contentHash": "yC7oSlnR54XO5kOuHlVOKtxomNNN1BWXX8lK1G2jaPXT9sUok7kCOoA4Pgs0qyFaCtMrNsprztYMeoEGqCm4uA=="
|
||||
},
|
||||
"Microsoft.TestPlatform.ObjectModel": {
|
||||
"type": "Transitive",
|
||||
"resolved": "17.10.0",
|
||||
"contentHash": "KkwhjQevuDj0aBRoPLY6OLAhGqbPUEBuKLbaCs0kUVw29qiOYncdORd4mLVJbn9vGZ7/iFGQ/+AoJl0Tu5Umdg==",
|
||||
"dependencies": {
|
||||
"System.Reflection.Metadata": "1.6.0"
|
||||
}
|
||||
},
|
||||
"Microsoft.TestPlatform.TestHost": {
|
||||
"type": "Transitive",
|
||||
"resolved": "17.10.0",
|
||||
"contentHash": "LWpMdfqhHvcUkeMCvNYJO8QlPLlYz9XPPb+ZbaXIKhdmjAV0wqTSrTiW5FLaf7RRZT50AQADDOYMOe0HxDxNgA==",
|
||||
"dependencies": {
|
||||
"Microsoft.TestPlatform.ObjectModel": "17.10.0",
|
||||
"Newtonsoft.Json": "13.0.1"
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json": {
|
||||
"type": "Transitive",
|
||||
"resolved": "13.0.1",
|
||||
"contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A=="
|
||||
},
|
||||
"System.Configuration.ConfigurationManager": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.4.0",
|
||||
"contentHash": "gWwQv/Ug1qWJmHCmN17nAbxJYmQBM/E94QxKLksvUiiKB1Ld3Sc/eK1lgmbSjDFxkQhVuayI/cGFZhpBSodLrg==",
|
||||
"dependencies": {
|
||||
"System.Security.Cryptography.ProtectedData": "4.4.0"
|
||||
}
|
||||
},
|
||||
"System.Diagnostics.EventLog": {
|
||||
"type": "Transitive",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw=="
|
||||
},
|
||||
"System.Reflection.Metadata": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.6.0",
|
||||
"contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ=="
|
||||
},
|
||||
"System.Security.Cryptography.ProtectedData": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.4.0",
|
||||
"contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog=="
|
||||
},
|
||||
"speckle.revit2023.interfaces": {
|
||||
"type": "Project"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
$ErrorActionPreference = "Stop";
|
||||
|
||||
dotnet run --project build/build.csproj -- $args
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
dotnet run --project Build/Build.csproj -- "$@"
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "8.0.100",
|
||||
"rollForward": "latestMinor"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user