├── .gitattributes ├── .gitignore ├── .nuspec ├── API ├── SketchUpAPI.dll ├── SketchUpAPI.lib ├── SketchUpAPI │ ├── application │ │ ├── application.h │ │ └── ruby_api.h │ ├── color.h │ ├── common.h │ ├── defs.h │ ├── extension_license.h │ ├── geometry.h │ ├── geometry │ │ ├── bounding_box.h │ │ ├── plane3d.h │ │ ├── point2d.h │ │ ├── point3d.h │ │ ├── ray3d.h │ │ ├── transformation.h │ │ ├── transformation2d.h │ │ ├── vector2d.h │ │ └── vector3d.h │ ├── import_export │ │ ├── modelexporterplugin.h │ │ ├── modelimporterplugin.h │ │ └── pluginprogresscallback.h │ ├── initialize.h │ ├── length_formatter.h │ ├── model │ │ ├── arccurve.h │ │ ├── arrow_type.h │ │ ├── attribute_dictionary.h │ │ ├── axes.h │ │ ├── camera.h │ │ ├── classification_attribute.h │ │ ├── classification_info.h │ │ ├── classifications.h │ │ ├── component_definition.h │ │ ├── component_instance.h │ │ ├── curve.h │ │ ├── defs.h │ │ ├── dimension.h │ │ ├── dimension_linear.h │ │ ├── dimension_radial.h │ │ ├── dimension_style.h │ │ ├── drawing_element.h │ │ ├── dynamic_component_attribute.h │ │ ├── dynamic_component_info.h │ │ ├── edge.h │ │ ├── edge_use.h │ │ ├── entities.h │ │ ├── entity.h │ │ ├── entity_list.h │ │ ├── entity_list_iterator.h │ │ ├── face.h │ │ ├── font.h │ │ ├── geometry.h │ │ ├── geometry_input.h │ │ ├── group.h │ │ ├── guide_line.h │ │ ├── guide_point.h │ │ ├── image.h │ │ ├── image_rep.h │ │ ├── instancepath.h │ │ ├── layer.h │ │ ├── layer_folder.h │ │ ├── line_style.h │ │ ├── line_styles.h │ │ ├── location.h │ │ ├── loop.h │ │ ├── material.h │ │ ├── mesh_helper.h │ │ ├── model.h │ │ ├── opening.h │ │ ├── options_manager.h │ │ ├── options_provider.h │ │ ├── polyline3d.h │ │ ├── rendering_options.h │ │ ├── scene.h │ │ ├── schema.h │ │ ├── schema_type.h │ │ ├── section_plane.h │ │ ├── selection.h │ │ ├── shadow_info.h │ │ ├── skp.h │ │ ├── style.h │ │ ├── styles.h │ │ ├── text.h │ │ ├── texture.h │ │ ├── texture_writer.h │ │ ├── typed_value.h │ │ ├── uv_helper.h │ │ └── vertex.h │ ├── sketchup.h │ ├── sketchup_info.h │ ├── slapi.h │ ├── transformation.h │ ├── unicodestring.h │ └── utils │ │ └── math_helpers.h ├── SketchUpCommonPreferences.dll └── sketchup.lib ├── Icons ├── ReadSKP.png ├── ReadSKPSmall.png ├── SKP.png ├── SKPSmall.png ├── WriteSKP.png └── WriteSKPSmall.png ├── LICENSE ├── README.md ├── SketchUpForDynamo ├── Material.cs ├── Properties │ └── AssemblyInfo.cs ├── SketchUp.cs ├── SketchUpForDynamo.csproj ├── SketchUpForDynamoImages.resources └── SketchUpForDynamoImages.resx ├── SketchUpForGrasshopper ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ └── Skp.png ├── SketchUp.cs └── SketchUpForGrasshopper.csproj ├── SketchUpNET.Unittest ├── BasicTests.cs ├── Properties │ └── AssemblyInfo.cs └── SketchUpNET.Unittest.csproj ├── SketchUpNET.sln ├── SketchUpNET ├── Color.cpp ├── Color.h ├── Component.cpp ├── Component.h ├── Curve.cpp ├── Curve.h ├── Edge.cpp ├── Edge.h ├── Group.cpp ├── Group.h ├── Instance.cpp ├── Instance.h ├── Layer.cpp ├── Layer.h ├── Loop.cpp ├── Loop.h ├── Material.cpp ├── Material.h ├── Mesh.cpp ├── Mesh.h ├── MeshFace.cpp ├── MeshFace.h ├── Opening.cpp ├── SketchUpNET.cpp ├── SketchUpNET.rc ├── SketchUpNET.vcxproj ├── SketchUpNET.vcxproj.filters ├── Surface.cpp ├── Surface.h ├── Texture.cpp ├── Texture.h ├── Transform.cpp ├── Transform.h ├── Utilities.cpp ├── Utilities.h ├── Vector.cpp ├── Vector.h ├── Vertex.cpp ├── Vertex.h └── resource.h ├── SketchUpNETConsole ├── App.config ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── SketchUpNETConsole.csproj ├── SketchUpTest └── SketchUpTest.vcxproj └── Testfiles ├── NewFile.skp ├── TestDefinition.gh ├── TestModel.skb ├── TestModel.skp ├── TestModel~.skp ├── TestReadDefinition.dyn ├── TestWriteDefinition.dyn └── Überß.skp /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | .vs 10 | 11 | # Build results 12 | [Dd]ebug/ 13 | [Dd]ebugPublic/ 14 | [Rr]elease/ 15 | [Rr]eleases/ 16 | x64/ 17 | x86/ 18 | build/ 19 | bld/ 20 | [Bb]in/ 21 | [Oo]bj/ 22 | 23 | # Roslyn cache directories 24 | *.ide/ 25 | 26 | # MSTest test Results 27 | [Tt]est[Rr]esult*/ 28 | [Bb]uild[Ll]og.* 29 | 30 | #NUNIT 31 | *.VisualState.xml 32 | TestResult.xml 33 | 34 | # Build Results of an ATL Project 35 | [Dd]ebugPS/ 36 | [Rr]eleasePS/ 37 | dlldata.c 38 | 39 | *_i.c 40 | *_p.c 41 | *_i.h 42 | *.ilk 43 | *.meta 44 | *.obj 45 | *.pch 46 | *.pdb 47 | *.pgc 48 | *.pgd 49 | *.rsp 50 | *.sbr 51 | *.tlb 52 | *.tli 53 | *.tlh 54 | *.tmp 55 | *.tmp_proj 56 | *.log 57 | *.vspscc 58 | *.vssscc 59 | .builds 60 | *.pidb 61 | *.svclog 62 | *.scc 63 | 64 | # Chutzpah Test files 65 | _Chutzpah* 66 | 67 | # Visual C++ cache files 68 | ipch/ 69 | *.aps 70 | *.ncb 71 | *.opensdf 72 | *.sdf 73 | *.cachefile 74 | 75 | # Visual Studio profiler 76 | *.psess 77 | *.vsp 78 | *.vspx 79 | 80 | # TFS 2012 Local Workspace 81 | $tf/ 82 | 83 | # Guidance Automation Toolkit 84 | *.gpState 85 | 86 | # ReSharper is a .NET coding add-in 87 | _ReSharper*/ 88 | *.[Rr]e[Ss]harper 89 | *.DotSettings.user 90 | 91 | # JustCode is a .NET coding addin-in 92 | .JustCode 93 | 94 | # TeamCity is a build add-in 95 | _TeamCity* 96 | 97 | # DotCover is a Code Coverage Tool 98 | *.dotCover 99 | 100 | # NCrunch 101 | _NCrunch_* 102 | .*crunch*.local.xml 103 | 104 | # MightyMoose 105 | *.mm.* 106 | AutoTest.Net/ 107 | 108 | # Web workbench (sass) 109 | .sass-cache/ 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.[Pp]ublish.xml 129 | *.azurePubxml 130 | # TODO: Comment the next line if you want to checkin your web deploy settings 131 | # but database connection strings (with potential passwords) will be unencrypted 132 | *.pubxml 133 | *.publishproj 134 | 135 | # NuGet Packages 136 | *.nupkg 137 | # The packages folder can be ignored because of Package Restore 138 | **/packages/* 139 | # except build/, which is used as an MSBuild target. 140 | !**/packages/build/ 141 | # If using the old MSBuild-Integrated Package Restore, uncomment this: 142 | #!**/packages/repositories.config 143 | 144 | # Windows Azure Build Output 145 | csx/ 146 | *.build.csdef 147 | 148 | # Windows Store app package directory 149 | AppPackages/ 150 | 151 | # Others 152 | sql/ 153 | *.Cache 154 | ClientBin/ 155 | [Ss]tyle[Cc]op.* 156 | ~$* 157 | *~ 158 | *.dbmdl 159 | *.dbproj.schemaview 160 | *.pfx 161 | *.publishsettings 162 | node_modules/ 163 | 164 | # RIA/Silverlight projects 165 | Generated_Code/ 166 | 167 | # Backup & report files from converting an old project file 168 | # to a newer Visual Studio version. Backup files are not needed, 169 | # because we have git ;-) 170 | _UpgradeReport_Files/ 171 | Backup*/ 172 | UpgradeLog*.XML 173 | UpgradeLog*.htm 174 | 175 | # SQL Server files 176 | *.mdf 177 | *.ldf 178 | 179 | # Business Intelligence projects 180 | *.rdl.data 181 | *.bim.layout 182 | *.bim_*.settings 183 | 184 | # Microsoft Fakes 185 | FakesAssemblies/ 186 | 187 | # ========================= 188 | # Operating System Files 189 | # ========================= 190 | 191 | # OSX 192 | # ========================= 193 | 194 | .DS_Store 195 | .AppleDouble 196 | .LSOverride 197 | 198 | # Thumbnails 199 | ._* 200 | 201 | # Files that might appear on external disk 202 | .Spotlight-V100 203 | .Trashes 204 | 205 | # Directories potentially created on remote AFP share 206 | .AppleDB 207 | .AppleDesktop 208 | Network Trash Folder 209 | Temporary Items 210 | .apdisk 211 | 212 | # Windows 213 | # ========================= 214 | 215 | # Windows image file caches 216 | Thumbs.db 217 | ehthumbs.db 218 | 219 | # Folder config file 220 | Desktop.ini 221 | 222 | # Recycle Bin used on file shares 223 | $RECYCLE.BIN/ 224 | 225 | # Windows Installer files 226 | *.cab 227 | *.msi 228 | *.msm 229 | *.msp 230 | 231 | # Windows shortcuts 232 | *.lnk 233 | -------------------------------------------------------------------------------- /.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SketchUpNET 5 | 1.7.2.0 6 | moethu 7 | moethu 8 | false 9 | SketchUp C#.NET API - A C++/CLI API Wrapper for the Trimble(R) SketchUp(R) C API 10 | https://github.com/moethu/SketchUpNET 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | sketchup 24 | MIT 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /API/SketchUpAPI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/API/SketchUpAPI.dll -------------------------------------------------------------------------------- /API/SketchUpAPI.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/API/SketchUpAPI.lib -------------------------------------------------------------------------------- /API/SketchUpAPI/application/application.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017-2020 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for usage within the SketchUp application. 6 | */ 7 | #ifndef SKETCHUP_APPLICATION_APPLICATION_H_ 8 | #define SKETCHUP_APPLICATION_APPLICATION_H_ 9 | 10 | #include 11 | #include 12 | #pragma pack(push, 8) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /** 19 | @brief Gets a reference to the active model. The reference is owned by the 20 | SketchUp application and should not be released. 21 | @since SketchUp 2019.2, API 7.1 22 | @param[out] model The model object. 23 | @see SUModelRef 24 | @return 25 | - \ref SU_ERROR_NONE on success 26 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p model is `NULL` 27 | - \ref SU_ERROR_NO_DATA if there is no active model 28 | */ 29 | SU_RESULT SUApplicationGetActiveModel(SUModelRef* model); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #pragma pack(pop) 35 | 36 | #endif // SKETCHUP_APPLICATION_APPLICATION_H_ 37 | -------------------------------------------------------------------------------- /API/SketchUpAPI/application/ruby_api.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for exchanging data between SketchUp's Ruby API and C API. 6 | * 7 | * @note This is for use only within the SketchUp application. 8 | */ 9 | #ifndef SKETCHUP_APPLICATION_RUBY_API_H_ 10 | #define SKETCHUP_APPLICATION_RUBY_API_H_ 11 | 12 | #include 13 | #include 14 | #pragma pack(push, 8) 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /** 21 | @brief This macro is defining a type matching Ruby's own `VALUE` type and 22 | can be used interchangeably. 23 | */ 24 | #ifdef __APPLE__ 25 | #define RUBY_VALUE unsigned long 26 | #elif _WIN32 27 | #define RUBY_VALUE unsigned long long 28 | #else 29 | #warning "Unsupported platform" 30 | #define RUBY_VALUE unsigned long 31 | #endif 32 | 33 | /** 34 | @brief Converts a C API entity to a Ruby API entity. 35 | 36 | @since SketchUp 2020.2, API 8.2 37 | 38 | @param[in] entity The C API entity reference. 39 | @param[out] ruby_entity The retrieved Ruby API entity reference. 40 | @see SUModelRef 41 | @return 42 | - \ref SU_ERROR_NONE on success 43 | - \ref SU_ERROR_INVALID_INPUT if \p entity is an invalid object 44 | - \ref SU_ERROR_INVALID_ARGUMENT if \p entity is not owned by a model 45 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p ruby_entity is `NULL` 46 | - \ref SU_ERROR_NO_DATA if this isn't called from within SketchUp 47 | */ 48 | SU_RESULT SUEntityToRuby(SUEntityRef entity, RUBY_VALUE* ruby_entity); 49 | 50 | /** 51 | @brief Converts a Ruby API entity to a C API entity. 52 | 53 | @since SketchUp 2020.2, API 8.2 54 | 55 | @param[in] ruby_entity The Ruby API entity reference. 56 | @param[out] entity The retrieved C API entity reference. 57 | @see SUModelRef 58 | @return 59 | - \ref SU_ERROR_NONE on success 60 | - \ref SU_ERROR_INVALID_ARGUMENT if \p ruby_entity refers to a deleted entity 61 | - \ref SU_ERROR_INVALID_ARGUMENT if \p ruby_entity is not an entity type 62 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p entity is `NULL` 63 | - \ref SU_ERROR_OVERWRITE_VALID if \p entity is already a valid reference 64 | - \ref SU_ERROR_NO_DATA if this isn't called from within SketchUp 65 | */ 66 | SU_RESULT SUEntityFromRuby(RUBY_VALUE ruby_entity, SUEntityRef* entity); 67 | 68 | /** 69 | @brief Converts a C API entity to a Ruby API imagerep. 70 | 71 | @note Ruby takes ownership of the object it should not be released by 72 | SUImageRepRelease. It will be released when Ruby garbage collects the 73 | Ruby references to it. 74 | 75 | @since SketchUp 2020.2, API 8.2 76 | 77 | @param[in] imagerep The C API imagerep reference. 78 | @param[out] ruby_imagerep The retrieved Ruby API imagerep reference. 79 | @see SUModelRef 80 | @return 81 | - \ref SU_ERROR_NONE on success 82 | - \ref SU_ERROR_INVALID_INPUT if \p imagerep is an invalid object 83 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p ruby_imagerep is `NULL` 84 | - \ref SU_ERROR_NO_DATA if this isn't called from within SketchUp 85 | */ 86 | SU_RESULT SUImageRepToRuby(SUImageRepRef imagerep, RUBY_VALUE* ruby_imagerep); 87 | 88 | /** 89 | @brief Converts a Ruby API imagerep to a C API imagerep. 90 | 91 | @note Ruby retains the ownership of the object it should not be released by 92 | SUImageRepRelease. 93 | 94 | @warning The returned C API reference points to an object that is owned by the 95 | Ruby runtime and it may be garbage collected. To avoid this, ensure 96 | that the Ruby API reference has a longer lifetime than the C API 97 | reference. 98 | 99 | @since SketchUp 2020.2, API 8.2 100 | 101 | @param[in] ruby_imagerep The Ruby API imagerep reference. 102 | @param[out] imagerep The retrieved C API imagerep reference. 103 | @see SUModelRef 104 | @return 105 | - \ref SU_ERROR_NONE on success 106 | - \ref SU_ERROR_INVALID_ARGUMENT if \p ruby_imagerep is not an imagerep type 107 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p imagerep is `NULL` 108 | - \ref SU_ERROR_OVERWRITE_VALID if \p imagerep is already a valid reference 109 | - \ref SU_ERROR_NO_DATA if this isn't called from within SketchUp 110 | */ 111 | SU_RESULT SUImageRepFromRuby(RUBY_VALUE ruby_imagerep, SUImageRepRef* imagerep); 112 | 113 | #ifdef __cplusplus 114 | } 115 | #endif 116 | #pragma pack(pop) 117 | 118 | #endif // SKETCHUP_APPLICATION_RUBY_API_H_ 119 | -------------------------------------------------------------------------------- /API/SketchUpAPI/color.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Trimble Inc., All rights reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SUColor. 6 | */ 7 | #ifndef SKETCHUP_COLOR_H_ 8 | #define SKETCHUP_COLOR_H_ 9 | 10 | #include 11 | 12 | #pragma pack(push, 8) 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif // __cplusplus 16 | 17 | /** 18 | @typedef SUByte 19 | @brief A type that stores a byte. 20 | */ 21 | typedef unsigned char SUByte; 22 | 23 | /** 24 | @struct SUColor 25 | @brief Stores a RGBA color with 8 bit channels. 26 | */ 27 | typedef struct { 28 | SUByte red; ///< Red color channel 29 | SUByte green; ///< Green color channel 30 | SUByte blue; ///< Blue color channel 31 | SUByte alpha; ///< Alpha color channel 32 | } SUColor; 33 | 34 | /** 35 | @brief The blend method is used to blend two colors. 36 | The blended color will be the result of taking 37 | (1 - weight) * sucolor1 + weight * sucolor2. 38 | @since SketchUp 2018, API 6.0 39 | @param[in] color1 A \ref SUColor to blend color2 with. 40 | @param[in] color2 A \ref SUColor to blend color1 with. 41 | @param[in] weight A value that determines the weight 42 | @param[out] blended_color The blended \ref SUColor. 43 | @related SUColor 44 | @return 45 | - \ref SU_ERROR_NONE on success 46 | - \ref SU_ERROR_OUT_OF_RANGE if weight is out of range 47 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if blended_color is NULL 48 | */ 49 | SU_RESULT SUColorBlend(const SUColor color1, const SUColor color2, 50 | const double weight, SUColor* blended_color); 51 | 52 | /** 53 | @brief Retrieves the number of color names recognized by SketchUp. 54 | @since SketchUp 2018, API 6.0 55 | @param[out] size The number of color names. 56 | @related SUColor 57 | @return 58 | - \ref SU_ERROR_NONE on success 59 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if size is NULL 60 | */ 61 | SU_RESULT SUColorGetNumNames(size_t *size); 62 | 63 | /** 64 | @brief Retrives all the color names recognized by SketchUp. 65 | @since SketchUp 2018, API 6.0 66 | @param[out] names An array of all the SketchUp Color names. 67 | @param[in] size The size of the array. 68 | @related SUColor 69 | @return 70 | - \ref SU_ERROR_NONE on success 71 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if names is NULL 72 | */ 73 | SU_RESULT SUColorGetNames(SUStringRef names[], const size_t size); 74 | 75 | /** 76 | @brief Sets the color represented by the name. 77 | @since SketchUp 2018, API 6.0 78 | @param[out] color The struct representing the color. 79 | @param[in] name The string representing the color. 80 | @related SUColor 81 | @return 82 | - \ref SU_ERROR_NONE on success 83 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if color is NULL 84 | - \ref SU_ERROR_INVALID_ARGUMENT if name is empty 85 | */ 86 | SU_RESULT SUColorSetByName(SUColor *color, const char *name); 87 | 88 | /** 89 | @brief Sets the color with the provided value. The passed in value can either be 90 | integer or hexadecimal. Alpha will always be 255 but RGB. For example: 91 | if the value is 0x66ccff, rgb will be (102, 204, 255) respectively. 92 | @since SketchUp 2018, API 6.0 93 | @param[out] color The struct representing the color. 94 | @param[in] value A value that represents the color. 95 | @related SUColor 96 | @return 97 | - \ref SU_ERROR_NONE on success 98 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if color is NULL 99 | */ 100 | SU_RESULT SUColorSetByValue(SUColor *color, const size_t value); 101 | 102 | #ifdef __cplusplus 103 | } // end extern "C" 104 | #endif // __cplusplus 105 | #pragma pack(pop) 106 | 107 | #endif // SKETCHUP_COLOR_H_ 108 | -------------------------------------------------------------------------------- /API/SketchUpAPI/defs.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief General types for the API. 6 | */ 7 | #ifndef SKETCHUP_DEFS_H_ 8 | #define SKETCHUP_DEFS_H_ 9 | 10 | #include 11 | 12 | #pragma pack(push, 8) 13 | 14 | DEFINE_SU_TYPE(SULengthFormatterRef) 15 | DEFINE_SU_TYPE(SUStringRef) 16 | 17 | #pragma pack(pop) 18 | 19 | #endif // SKETCHUP_DEFS_H_ 20 | -------------------------------------------------------------------------------- /API/SketchUpAPI/extension_license.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Trimble Inc., All rights reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SUExtensionLicense. 6 | */ 7 | #ifndef SKETCHUP_EXTENSION_LICENSE_H_ 8 | #define SKETCHUP_EXTENSION_LICENSE_H_ 9 | 10 | #include 11 | 12 | #pragma pack(push, 8) 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /** 18 | @brief Indicates the current state of an extension license. 19 | */ 20 | enum SUExtensionLicenseState { 21 | SUExtensionLicenseState_Licensed, ///< Extension is licensed to run 22 | SUExtensionLicenseState_Expired, ///< License had an expiration date and it expired 23 | SUExtensionLicenseState_Trial, ///< Extension is in trial 24 | SUExtensionLicenseState_TrialExpired, ///< Trial period has ended 25 | SUExtensionLicenseState_NotLicensed ///< Extension is not licensed 26 | }; 27 | 28 | /** 29 | @brief Stores extension license information. 30 | */ 31 | struct SUExtensionLicense { 32 | /// Main flag indicating whether the extension is allowed to run or not. 33 | bool is_licensed; 34 | /// Additional state information. 35 | enum SUExtensionLicenseState state; 36 | /// Number of days until license expiration. 0 if permanent or not licensed. 37 | size_t days_remaining; 38 | /// Error description in case of failure to acquire a license. This is meant 39 | /// to aid in debugging only. Extensions should not rely on any exact error 40 | /// description. 41 | char error_description[512]; 42 | }; 43 | 44 | /** 45 | @brief Acquires a license for a given extension. 46 | @param[in] extension_id The Extension Warehouse UUID for the extension. 47 | @param[out] out_license the licensing retrieved. 48 | @related SUExtensionLicense 49 | @return 50 | - \ref SU_ERROR_NONE on success 51 | - \ref SU_ERROR_GENERIC if retrieving the extension license failed 52 | - \ref SU_ERROR_NULL_POINTER_INPUT if extension_id is NULL 53 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if out_license is NULL 54 | */ 55 | SU_RESULT SUGetExtensionLicense(const char* extension_id, 56 | struct SUExtensionLicense* out_license); 57 | 58 | #ifdef __cplusplus 59 | } // extern "C" { 60 | #endif 61 | #pragma pack(pop) 62 | 63 | #endif // SKETCHUP_EXTENSION_LICENSE_H_ 64 | -------------------------------------------------------------------------------- /API/SketchUpAPI/geometry.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Trimble Inc., All rights reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Define types for geometric operations. 6 | */ 7 | #ifndef SKETCHUP_GEOMETRY_H_ 8 | #define SKETCHUP_GEOMETRY_H_ 9 | 10 | // includes 11 | #include 12 | 13 | 14 | #pragma pack(push, 8) 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif // __cplusplus 19 | 20 | /** 21 | @struct SUPoint2D 22 | @brief Represents a point in 2-dimensional space. 23 | */ 24 | struct SUPoint2D { 25 | double x; ///< X coordinate 26 | double y; ///< Y coordinate 27 | }; 28 | 29 | /** 30 | @struct SUVector2D 31 | @brief Represents a vector in 2-dimensional space. 32 | */ 33 | struct SUVector2D { 34 | double x; ///< X magnitude 35 | double y; ///< Y magnitude 36 | }; 37 | 38 | /** 39 | @struct SUPoint3D 40 | @brief Represents a point in 3-dimensional space. 41 | */ 42 | struct SUPoint3D { 43 | double x; ///< X coordinate 44 | double y; ///< Y coordinate 45 | double z; ///< Z coordinate 46 | }; 47 | 48 | /** 49 | @struct SUVector3D 50 | @brief Represents a vector in 3-dimensional space. 51 | */ 52 | struct SUVector3D { 53 | double x; ///< X magnitude 54 | double y; ///< Y magnitude 55 | double z; ///< Z magnitude 56 | }; 57 | 58 | /** 59 | @struct SUPlane3D 60 | @brief Represents a 3D plane by the parameters a, b, c, d. 61 | For any point on the plane, ax + by + cz + d = 0. 62 | The coeficients are normalized so that a*a + b*b + c*c = 1. 63 | */ 64 | struct SUPlane3D { 65 | double a; ///< The "a" factor in the plane equation. 66 | double b; ///< The "b" factor in the plane equation. 67 | double c; ///< The "c" factor in the plane equation. 68 | double d; ///< The "d" factor in the plane equation. 69 | }; 70 | 71 | /** 72 | @struct SUBoundingBox3D 73 | @brief Represents a 3D axis-aligned bounding box represented by the extreme 74 | diagonal corner points with minimum and maximum x,y,z coordinates. 75 | */ 76 | struct SUBoundingBox3D { 77 | struct SUPoint3D min_point; ///< A 3D point where x, y and z are minimum 78 | ///< values in the bounding box 79 | struct SUPoint3D max_point; ///< A 3D point where x, y and z are maximum 80 | ///< values in the bounding box 81 | }; 82 | 83 | /** 84 | @struct SUAxisAlignedRect2D 85 | @brief Represents a 2D rectangle that is aligned with the X and Y axis of the 86 | coordinate system. 87 | */ 88 | struct SUAxisAlignedRect2D { 89 | struct SUPoint2D upper_left; ///< Upper left corner of the bounding box. 90 | struct SUPoint2D lower_right; ///< Lower right corner of the bounding box. 91 | }; 92 | 93 | /** 94 | @struct SURay3D 95 | @brief Represents a 3D ray defined by a point and normal vector. 96 | @since SketchUp 2018, API 6.0 97 | */ 98 | struct SURay3D { 99 | struct SUPoint3D point; ///< Origin of the ray. 100 | struct SUVector3D normal; ///< Direction of the ray. 101 | }; 102 | 103 | /** 104 | @struct SUTransformation 105 | @brief Represents a 3D (4x4) geometric transformation matrix. 106 | 107 | Matrix values are in column-major order. 108 | The transformation is stored as: 109 | 110 | @code{.txt} 111 | - - 112 | | R T | 113 | M = | 0 w | 114 | - - 115 | @endcode 116 | 117 | where: 118 |
    119 |
  • M is a 4x4 matrix 120 |
  • R is a 3x3 sub-matrix. It is the rotation part 121 |
  • T is a 3x1 sub-matrix. It is the translation part 122 |
  • w is a scalar. It is 1/scale. 123 |
124 | */ 125 | struct SUTransformation { 126 | double values[16]; ///< Matrix values in column-major order. 127 | }; 128 | 129 | /** 130 | @struct SUTransformation2D 131 | @brief Represents a 2D (2x3) affine transformation matrix. The matrix 132 | is stored in column-major format: 133 |
134 |  m11 m21 tx
135 |  m12 m22 ty
136 | 
137 | */ 138 | struct SUTransformation2D { 139 | double m11; ///< the m11 component 140 | double m12; ///< the m12 component 141 | double m21; ///< the m21 component 142 | double m22; ///< the m22 component 143 | double tx; ///< the tx component 144 | double ty; ///< the ty component 145 | }; 146 | 147 | #ifdef __cplusplus 148 | } // end extern "C" 149 | #endif // __cplusplus 150 | 151 | #pragma pack(pop) 152 | 153 | #endif // SKETCHUP_GEOMETRY_H_ 154 | -------------------------------------------------------------------------------- /API/SketchUpAPI/geometry/bounding_box.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Trimble Inc., All rights reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SUBoundingBox3D. 6 | */ 7 | #ifndef SKETCHUP_GEOMETRY_BOUNDING_BOX_H_ 8 | #define SKETCHUP_GEOMETRY_BOUNDING_BOX_H_ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif // __cplusplus 15 | 16 | /** 17 | @brief Gets the mid point from the given bounding box. 18 | @since SketchUp 2018 M0, API 6.0 19 | @param[in] bounding_box The bounding box to calculate the mid point from. 20 | @param[out] mid_point The mid point to be returned. 21 | @related SUBoundingBox3D 22 | @return 23 | - \ref SU_ERROR_NONE on success 24 | - \ref SU_ERROR_NULL_POINTER_INPUT if bounding_box is NULL 25 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if mid_point NULL 26 | */ 27 | SU_RESULT SUBoundingBox3DGetMidPoint(const struct SUBoundingBox3D* bounding_box, 28 | struct SUPoint3D* mid_point); 29 | 30 | #ifdef __cplusplus 31 | } // end extern "C" 32 | #endif // __cplusplus 33 | 34 | #endif // SKETCHUP_GEOMETRY_BOUNDING_BOX_H_ 35 | -------------------------------------------------------------------------------- /API/SketchUpAPI/geometry/point2d.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SUPoint2D. 6 | */ 7 | #ifndef SKETCHUP_GEOMETRY_POINT2D_H_ 8 | #define SKETCHUP_GEOMETRY_POINT2D_H_ 9 | 10 | 11 | #include 12 | #include 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /** 19 | @brief Creates a vector between two point objects. 20 | @since SketchUp 2017, API 5.0 21 | @deprecated The functionality is replaced by SUVector2DCreate. 22 | @param[in] point1 The first point object. 23 | @param[in] point2 The second point object. 24 | @param[out] vector The vector from point1 to point2. 25 | @related SUPoint2D 26 | @return 27 | - \ref SU_ERROR_NONE on success 28 | - \ref SU_ERROR_NULL_POINTER_INPUT if point1 or point2 is NULL 29 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if vector is NULL 30 | */ 31 | SU_DEPRECATED_FUNCTION("6.0") 32 | SU_RESULT SUPoint2DToSUPoint2D(const struct SUPoint2D* point1, 33 | const struct SUPoint2D* point2, 34 | struct SUVector2D* vector); 35 | 36 | /** 37 | @brief Determines if two points are equal. 38 | @since SketchUp 2017, API 5.0 39 | @param[in] point1 The first point object. 40 | @param[in] point2 The second point object. 41 | @param[out] equal Whether the two points are the same. 42 | @related SUPoint2D 43 | @return 44 | - \ref SU_ERROR_NONE on success 45 | - \ref SU_ERROR_NULL_POINTER_INPUT if point1 or point2 is NULL 46 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if equal is NULL 47 | */ 48 | SU_RESULT SUPoint2DGetEqual(const struct SUPoint2D* point1, 49 | const struct SUPoint2D* point2, 50 | bool* equal); 51 | 52 | /** 53 | @brief Creates a new point that is offset from another point. 54 | @since SketchUp 2017, API 5.0 55 | @param[in] point1 The point object. 56 | @param[in] vector The offset vector object. 57 | @param[out] point2 The new point. 58 | @related SUPoint2D 59 | @return 60 | - \ref SU_ERROR_NONE on success 61 | - \ref SU_ERROR_NULL_POINTER_INPUT if point1 or vector is NULL 62 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if point2 is NULL 63 | */ 64 | SU_RESULT SUPoint2DOffset(const struct SUPoint2D* point1, 65 | const struct SUVector2D* vector, 66 | struct SUPoint2D* point2); 67 | 68 | /** 69 | @brief Gets the distance between two point objects. 70 | @since SketchUp 2017, API 5.0 71 | @param[in] point1 The first point object. 72 | @param[in] point2 The second point object. 73 | @param[out] distance The distance between the two points. 74 | @related SUPoint2D 75 | @return 76 | - \ref SU_ERROR_NONE on success 77 | - \ref SU_ERROR_NULL_POINTER_INPUT if point1 or point2 is NULL 78 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if distance is NULL 79 | */ 80 | SU_RESULT SUPoint2DDistanceToSUPoint2D(const struct SUPoint2D* point1, 81 | const struct SUPoint2D* point2, 82 | double* distance); 83 | 84 | /** 85 | @brief Transforms a point by applying a 2D transformation. 86 | @since SketchUp 2019, API 7.0 87 | @param[in] transform The transformation to be applied. 88 | @param[in,out] point The point to be transformed. 89 | @related SUPoint2D 90 | @return 91 | - \ref SU_ERROR_NONE on success 92 | - \ref SU_ERROR_NULL_POINTER_INPUT if transform is NULL 93 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if point is NULL 94 | */ 95 | SU_RESULT SUPoint2DTransform(const struct SUTransformation2D* transform, 96 | struct SUPoint2D* point); 97 | 98 | #ifdef __cplusplus 99 | } // extern "C" 100 | #endif 101 | 102 | #endif // SKETCHUP_GEOMETRY_POINT2D_H_ 103 | -------------------------------------------------------------------------------- /API/SketchUpAPI/geometry/point3d.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SUPoint3D. 6 | */ 7 | #ifndef SKETCHUP_GEOMETRY_POINT3D_H_ 8 | #define SKETCHUP_GEOMETRY_POINT3D_H_ 9 | 10 | 11 | #include 12 | #include 13 | 14 | // Forward declarations 15 | struct SUTransformation; 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /** 22 | @brief Determines if two points are equal. 23 | @since SketchUp 2018 M0, API 6.0 24 | @param[in] point1 The first point object. 25 | @param[in] point2 The second point object. 26 | @param[out] equal Whether the two points are the same. 27 | @related SUPoint3D 28 | @return 29 | - \ref SU_ERROR_NONE on success 30 | - \ref SU_ERROR_NULL_POINTER_INPUT if point1 or point2 is NULL 31 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if equal is NULL 32 | */ 33 | SU_RESULT SUPoint3DGetEqual(const struct SUPoint3D* point1, 34 | const struct SUPoint3D* point2, 35 | bool* equal); 36 | 37 | /** 38 | @brief Determines if point1 is less than point2. 39 | @since SketchUp 2018 M0, API 6.0 40 | @param[in] point1 The first point object. 41 | @param[in] point2 The second point object. 42 | @param[out] less_than Whether point1 is less than point2. 43 | @related SUPoint3D 44 | @return 45 | - \ref SU_ERROR_NONE on success 46 | - \ref SU_ERROR_NULL_POINTER_INPUT if point1 or point2 is NULL 47 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if less_than is NULL 48 | */ 49 | SU_RESULT SUPoint3DLessThan(const struct SUPoint3D* point1, 50 | const struct SUPoint3D* point2, 51 | bool* less_than); 52 | 53 | /** 54 | @brief Creates a new point that is offset from another point. 55 | @since SketchUp 2018 M0, API 6.0 56 | @param[in] point1 The point object. 57 | @param[in] vector The offset vector object. 58 | @param[out] point2 The new point. 59 | @related SUPoint3D 60 | @return 61 | - \ref SU_ERROR_NONE on success 62 | - \ref SU_ERROR_NULL_POINTER_INPUT if point1 or vector is NULL 63 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if point2 is NULL 64 | */ 65 | SU_RESULT SUPoint3DOffset(const struct SUPoint3D* point1, 66 | const struct SUVector3D* vector, 67 | struct SUPoint3D* point2); 68 | 69 | /** 70 | @brief Gets the distance between two point objects. 71 | @since SketchUp 2018 M0, API 6.0 72 | @param[in] point1 The first point object. 73 | @param[in] point2 The second point object. 74 | @param[out] distance The distance between the two points. 75 | @related SUPoint3D 76 | @return 77 | - \ref SU_ERROR_NONE on success 78 | - \ref SU_ERROR_NULL_POINTER_INPUT if point1 or point2 is NULL 79 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if distance is NULL 80 | */ 81 | SU_RESULT SUPoint3DDistanceToSUPoint3D(const struct SUPoint3D* point1, 82 | const struct SUPoint3D* point2, 83 | double* distance); 84 | 85 | /** 86 | @brief Transforms the provided 3D point by applying the provided 3D 87 | transformation. 88 | @since SketchUp 2016, API 4.0 89 | @param[in] transform The transformation to be applied. 90 | @param[in,out] point The point to be transformed. 91 | @related SUPoint3D 92 | @return 93 | - \ref SU_ERROR_NONE on success 94 | - \ref SU_ERROR_NULL_POINTER_INPUT if transform is NULL 95 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if point is NULL 96 | */ 97 | SU_RESULT SUPoint3DTransform(const struct SUTransformation* transform, 98 | struct SUPoint3D* point); 99 | 100 | #ifdef __cplusplus 101 | } // extern "C" 102 | #endif 103 | 104 | #endif // SKETCHUP_GEOMETRY_POINT3D_H_ 105 | -------------------------------------------------------------------------------- /API/SketchUpAPI/geometry/ray3d.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Trimble Inc., All rights reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SURay3D. 6 | */ 7 | #ifndef SKETCHUP_GEOMETRY_RAY3D_H_ 8 | #define SKETCHUP_GEOMETRY_RAY3D_H_ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif // __cplusplus 15 | 16 | /** 17 | @brief Gets whether or not the point is on the ray. 18 | @since SketchUp 2018, API 6.0 19 | @param[in] ray The ray. 20 | @param[in] point The 3D point. 21 | @param[out] is_on Whether or not the point is on the ray. 22 | @related SURay3D 23 | @return 24 | - \ref SU_ERROR_NONE on success 25 | - \ref SU_ERROR_NULL_POINTER_INPUT if ray or point are NULL 26 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if is_on is NULL 27 | */ 28 | SU_RESULT SURay3DIsOn(const struct SURay3D* ray, 29 | const struct SUPoint3D* point, 30 | bool* is_on); 31 | 32 | /** 33 | @brief Gets the distance from the point to the ray. 34 | @since SketchUp 2018, API 6.0 35 | @param[in] ray The ray. 36 | @param[in] point The 3D point. 37 | @param[out] distance The distance between the ray and point. 38 | @related SURay3D 39 | @return 40 | - \ref SU_ERROR_NONE on success 41 | - \ref SU_ERROR_NULL_POINTER_INPUT if ray or point are NULL 42 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if distance is NULL 43 | */ 44 | SU_RESULT SURay3DDistanceTo(const struct SURay3D* ray, 45 | const struct SUPoint3D* point, 46 | double* distance); 47 | 48 | /** 49 | @brief Projects a point onto the ray. 50 | @since SketchUp 2018, API 6.0 51 | @param[in] ray The ray. 52 | @param[in] point The 3D point to project onto the ray. 53 | @param[out] projected_point The point resulting from the projection. 54 | @related SURay3D 55 | @return 56 | - \ref SU_ERROR_NONE on success 57 | - \ref SU_ERROR_NULL_POINTER_INPUT if ray or point are NULL 58 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if projected_point is NULL 59 | */ 60 | SU_RESULT SURay3DProjectTo(const struct SURay3D* ray, 61 | const struct SUPoint3D* point, 62 | struct SUPoint3D* projected_point); 63 | 64 | #ifdef __cplusplus 65 | } // end extern "C" 66 | #endif // __cplusplus 67 | 68 | #endif // SKETCHUP_GEOMETRY_RAY3D_H_ 69 | -------------------------------------------------------------------------------- /API/SketchUpAPI/import_export/pluginprogresscallback.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2020 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for import/export progress feedback and cancellation. 6 | */ 7 | #ifndef SKETCHUPPLUGINPROGRESSCALLBACK_H_ 8 | #define SKETCHUPPLUGINPROGRESSCALLBACK_H_ 9 | 10 | #include 11 | 12 | /** 13 | @struct SketchUpPluginProgressCallback 14 | @brief Interface to provide import/export progress feedback and cancellation. 15 | 16 | All well behaved SketchUp importer/exporter plugins should support progress 17 | feedback and cancellation through this interface. SketchUp will pop up a 18 | progress/cancel dialog prior to calling the appropriate Convert method on the 19 | importer/exporter plugin and supply a concrete implementation of this interface. 20 | The plugin should supply feedback to the user by estimating how far along the 21 | conversion is (via SetPercentDone or SetStepSize and Step), provide some textual 22 | progress (via SetProgressMessage) and test for cancellation by calling 23 | HasBeenCancelled. 24 | 25 | For example, the main loop of an importer plugin may look like this: 26 | 27 | \code{.cpp} 28 | progress_callback->SetProgressMessage("Importing 50 things!"); 29 | progress_callback->SetStepSize(1.0); 30 | for (int steps = 0; steps < 50; ++steps) { 31 | progress_callback->Step(); 32 | // Do something which builds an skp model 33 | if (progress_callback->HasBeenCancelled()) { 34 | // Clean up and return 35 | return false; 36 | } 37 | } 38 | progress_callback->SetProgressMessage("We're half way there!"); 39 | // Do some more larger steps 40 | progress_callback->SetPercentDone(75.0); 41 | progress_callback->SetProgressMessage("Finishing up!"); 42 | // And some more 43 | progress_callback->SetPercentDone(100.0); 44 | // Success! 45 | return true; 46 | \endcode 47 | 48 | */ 49 | class SketchUpPluginProgressCallback { 50 | public: 51 | /** 52 | @brief Call this to test if the user has pressed the cancel button. Your 53 | code should clean up and return promptly after detecting this. 54 | @return Returns true if the user has pressed cancel. 55 | */ 56 | virtual bool HasBeenCancelled() = 0; 57 | 58 | /** 59 | @brief Call this to set the percent complete on the dialog. 60 | @param[in] percent The percent done from 0 to 100. 61 | */ 62 | virtual void SetPercentDone(double percent) = 0; 63 | 64 | /** 65 | @brief You may also set a step size and increment it using the Step method. 66 | @param[in] percent The percent to increment with each call to Step. 67 | */ 68 | virtual void SetStepSize(double percent) = 0; 69 | 70 | /** 71 | @brief Increments the progress dialog by the step size set using 72 | SetStepSize. 73 | */ 74 | virtual void Step() = 0; 75 | 76 | /** 77 | @brief Supplies a UTF-8 message which will be presented on the progress 78 | dialog. 79 | @param utf8_message The message. 80 | */ 81 | virtual void SetProgressMessage(const std::string& utf8_message) = 0; 82 | }; 83 | 84 | #endif // SKETCHUPPLUGINPROGRESSCALLBACK_H_ 85 | -------------------------------------------------------------------------------- /API/SketchUpAPI/initialize.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2020 Trimble Inc. All Rights Reserved 2 | 3 | /** 4 | * @file 5 | * @brief Functionality for the API interface itself. 6 | */ 7 | #ifndef SKETCHUP_INITIALIZE_H_ 8 | #define SKETCHUP_INITIALIZE_H_ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /** 17 | @brief Initializes the slapi interface. Must be called before calling any other 18 | API function. 19 | @attention This function should not be used from the Live API. 20 | */ 21 | SU_EXPORT void SUInitialize(); 22 | 23 | /** 24 | @brief Signals termination of use of the slapi interface. Must be called when 25 | done using API functions. 26 | @attention This function should not be used from the Live API. 27 | */ 28 | SU_EXPORT void SUTerminate(); 29 | 30 | /** 31 | @brief Returns the major and minor API version numbers. 32 | @param[out] major The major version number retrieved. 33 | @param[out] minor The minor version number retrieved. 34 | @note This function hasn't reliably reported the correct versions prior to 35 | version 8.2 of the SDK. 36 | */ 37 | SU_EXPORT void SUGetAPIVersion(size_t* major, size_t* minor); 38 | 39 | #ifdef __cplusplus 40 | } // extern "C" { 41 | #endif 42 | 43 | #endif // SKETCHUP_INITIALIZE_H_ 44 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/arrow_type.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2020 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for \ref SUArrowType. 6 | */ 7 | #ifndef SKETCHUP_MODEL_ARROW_TYPE_H_ 8 | #define SKETCHUP_MODEL_ARROW_TYPE_H_ 9 | 10 | /** 11 | @enum SUArrowType 12 | @brief Indicates the supported arrow types, currently used by SUDimensionRef 13 | and SUTextRef. 14 | */ 15 | enum SUArrowType { 16 | SUArrowNone = 0, 17 | SUArrowSlash, 18 | SUArrowDot, 19 | SUArrowClosed, 20 | SUArrowOpen 21 | }; 22 | 23 | 24 | #endif // SKETCHUP_MODEL_ARROW_TYPE_H_ 25 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/classification_attribute.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2020 Trimble Inc. All Rights Reserved 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SUClassificationAttributeRef. 6 | */ 7 | #ifndef SKETCHUP_MODEL_CLASSIFICATION_ATTRIBUTE_H_ 8 | #define SKETCHUP_MODEL_CLASSIFICATION_ATTRIBUTE_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /** 19 | @struct SUClassificationAttributeRef 20 | @brief References attribute data about a classified component. 21 | */ 22 | 23 | /** 24 | @brief Retrieves the value of the attribute. 25 | @since SketchUp 2017, API 5.0 26 | @param[in] attribute The classification attribute object. 27 | @param[out] value The value of the attribute. 28 | @related SUClassificationAttributeRef 29 | @return 30 | - \ref SU_ERROR_NONE on success 31 | - \ref SU_ERROR_INVALID_INPUT if attribute is not a valid object 32 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if value is NULL 33 | - \ref SU_ERROR_INVALID_OUTPUT if value does not point to a valid \ref 34 | SUTypedValueRef object 35 | */ 36 | SU_RESULT SUClassificationAttributeGetValue( 37 | SUClassificationAttributeRef attribute, 38 | SUTypedValueRef* value); 39 | 40 | /** 41 | @brief Retrieves the path to the attribute. 42 | @since SketchUp 2017, API 5.0 43 | @param[in] attribute The classification attribute object. 44 | @param[out] path The attribute name as it should be displayed to the 45 | user. 46 | @related SUClassificationAttributeRef 47 | @return 48 | - \ref SU_ERROR_NONE on success 49 | - \ref SU_ERROR_INVALID_INPUT if attribute is not a valid object 50 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if path is NULL 51 | - \ref SU_ERROR_INVALID_OUTPUT if path does not point to a valid \ref 52 | SUStringRef object 53 | */ 54 | SU_RESULT SUClassificationAttributeGetPath( 55 | SUClassificationAttributeRef attribute, 56 | SUStringRef* path); 57 | 58 | /** 59 | @brief Retrieves the number of children setting of the attribute. 60 | @since SketchUp 2017, API 5.0 61 | @param[in] attribute The classification attribute object. 62 | @param[out] count The number of children this attribute contains. 63 | @related SUClassificationAttributeRef 64 | @return 65 | - \ref SU_ERROR_NONE on success 66 | - \ref SU_ERROR_INVALID_INPUT if attribute is not a valid object 67 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL 68 | */ 69 | SU_RESULT SUClassificationAttributeGetNumChildren( 70 | SUClassificationAttributeRef attribute, 71 | size_t* count); 72 | 73 | /** 74 | @brief Retrieves the child attribute at the given index. 75 | @since SketchUp 2017, API 5.0 76 | @param[in] attribute The classification attribute object. 77 | @param[in] index The index of the child attribute to get. 78 | @param[out] child The child attribute retrieved. 79 | @related SUClassificationAttributeRef 80 | @return 81 | - \ref SU_ERROR_NONE on success 82 | - \ref SU_ERROR_INVALID_INPUT if attribute is not a valid object 83 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if child is NULL 84 | */ 85 | SU_RESULT SUClassificationAttributeGetChild( 86 | SUClassificationAttributeRef attribute, 87 | size_t index, 88 | SUClassificationAttributeRef* child); 89 | 90 | #ifdef __cplusplus 91 | } // extern "C" { 92 | #endif 93 | 94 | #endif // SKETCHUP_MODEL_CLASSIFICATION_ATTRIBUTE_H_ 95 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/classification_info.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2020 Trimble Inc. All Rights Reserved 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SUClassificationInfoRef. 6 | */ 7 | #ifndef SKETCHUP_MODEL_CLASSIFICATION_INFO_H_ 8 | #define SKETCHUP_MODEL_CLASSIFICATION_INFO_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /** 19 | @struct SUClassificationInfoRef 20 | @brief References an object with classification information. Each 21 | SUClassificationInfoRef contains the names of the schemas and the schema 22 | types, and the types attributes. See SUClassificationAttributeRef for 23 | details on the type attributes. 24 | */ 25 | 26 | /** 27 | @brief Releases the classification info. Classification info objects are created 28 | from component instance using 29 | SUComponentInstanceCreateClassificationInfo(), and must be released using 30 | this function. This function also invalidates the given 31 | SUClassificationInfoRef. 32 | @since SketchUp 2017, API 5.0 33 | @param[in,out] classification_info The classification info object. 34 | @related SUClassificationInfoRef 35 | @return 36 | - \ref SU_ERROR_NONE on success 37 | - \ref SU_ERROR_NULL_POINTER_INPUT if classification_info is NULL 38 | - \ref SU_ERROR_INVALID_INPUT if classification_info is not a valid object 39 | */ 40 | SU_RESULT SUClassificationInfoRelease( 41 | SUClassificationInfoRef* classification_info); 42 | 43 | /** 44 | @brief Retrieves the number of schemas that have been applied to the 45 | component instance. 46 | @since SketchUp 2017, API 5.0 47 | @param[in] classification_info The classification info object. 48 | @param[out] count The number of classifications. 49 | @related SUClassificationInfoRef 50 | @return 51 | - \ref SU_ERROR_NONE on success 52 | - \ref SU_ERROR_INVALID_INPUT if classification_info is not a valid object 53 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL 54 | */ 55 | SU_RESULT SUClassificationInfoGetNumSchemas( 56 | SUClassificationInfoRef classification_info, 57 | size_t* count); 58 | 59 | /** 60 | @brief Retrieves the schema name for the classification at the given index. 61 | @param[in] classification_info The classification info object. 62 | @param[in] index The classification index. 63 | @param[out] schema_name The name of the schema. 64 | @related SUClassificationInfoRef 65 | @return 66 | - \ref SU_ERROR_NONE on success 67 | - \ref SU_ERROR_INVALID_INPUT if classification_info is an invalid object 68 | - \ref SU_ERROR_OUT_OF_RANGE if index is larger than the number of schemas 69 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if schema_name is NULL 70 | - \ref SU_ERROR_INVALID_OUTPUT if *schema_name is not a valid object 71 | */ 72 | SU_RESULT SUClassificationInfoGetSchemaName( 73 | SUClassificationInfoRef classification_info, 74 | size_t index, 75 | SUStringRef* schema_name); 76 | 77 | /** 78 | @brief Retrieves the schema type for the classification at the given index. 79 | @param[in] classification_info The classification info object. 80 | @param[in] index The classification index. 81 | @param[out] schema_type The applied type from the schema. 82 | @related SUClassificationInfoRef 83 | @return 84 | - \ref SU_ERROR_NONE on success 85 | - \ref SU_ERROR_INVALID_INPUT if classification_info is an invalid object 86 | - \ref SU_ERROR_OUT_OF_RANGE if index is larger than the number of schemas 87 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if schema_type is NULL 88 | - \ref SU_ERROR_INVALID_OUTPUT if *schema_type is not a valid object 89 | */ 90 | SU_RESULT SUClassificationInfoGetSchemaType( 91 | SUClassificationInfoRef classification_info, 92 | size_t index, 93 | SUStringRef* schema_type); 94 | 95 | /** 96 | @brief Retrieves the classification attribute for the classification at the 97 | given index. 98 | @param[in] classification_info The classification info object. 99 | @param[in] index The classification index. 100 | @param[out] attribute The attribute retrieved. 101 | @related SUClassificationInfoRef 102 | @return 103 | - \ref SU_ERROR_NONE on success 104 | - \ref SU_ERROR_INVALID_INPUT if classification_info is an invalid object 105 | - \ref SU_ERROR_OUT_OF_RANGE if index is larger than the number of schemas 106 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if attribute is NULL 107 | */ 108 | SU_RESULT SUClassificationInfoGetSchemaAttribute( 109 | SUClassificationInfoRef classification_info, 110 | size_t index, 111 | SUClassificationAttributeRef* attribute); 112 | 113 | /** 114 | @brief Retrieves the classification attribute with the given path. 115 | @param[in] classification_info The classification info object. 116 | @param[in] path The path of the classification attribute to get. 117 | @param[out] attribute The attribute retrieved. 118 | @related SUClassificationInfoRef 119 | @return 120 | - \ref SU_ERROR_NONE on success 121 | - \ref SU_ERROR_INVALID_INPUT if classification_info is an invalid object 122 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if attribute is NULL 123 | */ 124 | SU_RESULT SUClassificationInfoGetSchemaAttributeByPath( 125 | SUClassificationInfoRef classification_info, 126 | SUStringRef path, 127 | SUClassificationAttributeRef* attribute); 128 | 129 | #ifdef __cplusplus 130 | } // extern "C" { 131 | #endif 132 | 133 | #endif // SKETCHUP_MODEL_CLASSIFICATION_INFO_H_ 134 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/classifications.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014-2020 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SUClassificationsRef. 6 | */ 7 | #ifndef SKETCHUP_MODEL_CLASSIFICATIONS_H_ 8 | #define SKETCHUP_MODEL_CLASSIFICATIONS_H_ 9 | 10 | #include 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /** 18 | @struct SUClassificationsRef 19 | @brief Used to manage a Classifications object 20 | */ 21 | 22 | /** 23 | @brief Loads a schema into a classification object. 24 | @param[in] classifications The classification object. 25 | @param[in] schema_file_name The full path of the schema to load. 26 | @related SUClassificationsRef 27 | @return 28 | - \ref SU_ERROR_NONE on success 29 | - \ref SU_ERROR_INVALID_INPUT if classifications is not a valid object 30 | - \ref SU_ERROR_INVALID_INPUT if schema_file_name is not a valid path to a schema 31 | or is NULL 32 | */ 33 | SU_RESULT SUClassificationsLoadSchema(SUClassificationsRef classifications, 34 | const char* schema_file_name); 35 | 36 | /** 37 | @brief Gets a schema from a classification object. 38 | @param[in] classifications The classification object. 39 | @param[in] schema_name The name of the schema to get. 40 | @param[out] schema_ref The schema retrieved. 41 | @related SUClassificationsRef 42 | @return 43 | - \ref SU_ERROR_NONE on success 44 | - \ref SU_ERROR_INVALID_INPUT if classifications is not a valid object 45 | - \ref SU_ERROR_NULL_POINTER_INPUT if schema_name is NULL 46 | - \ref SU_ERROR_INVALID_INPUT if schema_name is not a loaded schema 47 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if schema_ref is NULL 48 | */ 49 | SU_RESULT SUClassificationsGetSchema(SUClassificationsRef classifications, 50 | const char* schema_name, 51 | SUSchemaRef* schema_ref); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif // SKETCHUP_MODEL_CLASSIFICATIONS_H_ 58 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/curve.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SUCurveRef. 6 | */ 7 | #ifndef SKETCHUP_MODEL_CURVE_H_ 8 | #define SKETCHUP_MODEL_CURVE_H_ 9 | 10 | #include 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /** 18 | @struct SUCurveRef 19 | @extends SUEntityRef 20 | @brief References a curve. 21 | */ 22 | 23 | /** 24 | @enum SUCurveType 25 | @brief Defines curve types that can be represented by \ref SUCurveRef. 26 | */ 27 | enum SUCurveType { 28 | SUCurveType_Simple = 0, 29 | SUCurveType_Arc 30 | }; 31 | 32 | /** 33 | @brief Converts from an \ref SUCurveRef to an \ref SUEntityRef. 34 | This is essentially an upcast operation. 35 | @param[in] curve The given curve reference. 36 | @related SUCurveRef 37 | @return 38 | - The converted \ref SUEntityRef if curve is a valid object 39 | - If not, the returned reference will be invalid 40 | */ 41 | SU_EXPORT SUEntityRef SUCurveToEntity(SUCurveRef curve); 42 | 43 | /** 44 | @brief Converts from an \ref SUEntityRef to an \ref SUCurveRef. 45 | This is essentially a downcast operation so the given \ref SUEntityRef 46 | must be convertible to an \ref SUCurveRef. 47 | @param[in] entity The given entity reference. 48 | @related SUCurveRef 49 | @return 50 | - The converted \ref SUCurveRef if the downcast operation succeeds 51 | - If not, the returned reference will be invalid 52 | */ 53 | SU_EXPORT SUCurveRef SUCurveFromEntity(SUEntityRef entity); 54 | 55 | /** 56 | @brief Creates a curve object with the given array of edges that is not 57 | connected to any face object. The array of N edges is sorted such that 58 | for each edge in the range [0, N] the start position of each edge is the 59 | same as the end position of the previous edge in the array. Each 60 | element of the array of edges is subsequently associated with the 61 | created curve object and must not be deallocated via SUEdgeRelease(). 62 | @param curve The curve object created. 63 | @param edges The array of edge objects. 64 | @param len The number of edge objects in the array. 65 | @related SUCurveRef 66 | @return 67 | - \ref SU_ERROR_NONE on success 68 | - \ref SU_ERROR_NULL_POINTER_INPUT if edges is NULL 69 | - \ref SU_ERROR_OUT_OF_RANGE if len is 0 70 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if curve is NULL 71 | - \ref SU_ERROR_OVERWRITE_VALID if curve already references a valid object 72 | - \ref SU_ERROR_GENERIC if edge array contains an invalid edge, if the edges 73 | in the array are not connected, if any of the edges are associated with a face 74 | object, or the edges describe a loop 75 | */ 76 | SU_RESULT SUCurveCreateWithEdges(SUCurveRef* curve, const SUEdgeRef edges[], 77 | size_t len); 78 | 79 | /** 80 | @brief Releases a curve object and its associated edge objects. 81 | @param curve The curve object. 82 | @related SUCurveRef 83 | @return 84 | - \ref SU_ERROR_NONE on success 85 | - \ref SU_ERROR_NULL_POINTER_INPUT if curve is NULL 86 | - \ref SU_ERROR_INVALID_INPUT if curve does not reference a valid object 87 | */ 88 | SU_RESULT SUCurveRelease(SUCurveRef* curve); 89 | 90 | /** 91 | @brief Retrieves the curve type of a curve object. 92 | @param[in] curve The curve object. 93 | @param[out] type The curve type retrieved. 94 | @related SUCurveRef 95 | @return 96 | - \ref SU_ERROR_NONE on success 97 | - \ref SU_ERROR_INVALID_INPUT if curve is not a valid curve object 98 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if type is NULL 99 | */ 100 | SU_RESULT SUCurveGetType(SUCurveRef curve, enum SUCurveType* type); 101 | 102 | /** 103 | @brief Retrieves the number of edges that belong to a curve object. 104 | @param[in] curve The curve object. 105 | @param[out] count The number of edges. 106 | @related SUCurveRef 107 | @return 108 | - \ref SU_ERROR_NONE on success 109 | - \ref SU_ERROR_INVALID_INPUT if curve is not a valid curve object 110 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL 111 | */ 112 | SU_RESULT SUCurveGetNumEdges(SUCurveRef curve, size_t* count); 113 | 114 | /** 115 | @brief Retrieves the edges of a curve object. Provides access to all edges in 116 | the curve. The first edge is the first element of the edges array and 117 | the last edge is the last element if all edges were retrieved. 118 | @param[in] curve The curve object. 119 | @param[in] len The number of edges to retrieve. 120 | @param[out] edges The edges retrieved. 121 | @param[out] count The number of edges retrieved. 122 | @related SUCurveRef 123 | @return 124 | - \ref SU_ERROR_NONE on success 125 | - \ref SU_ERROR_INVALID_INPUT if curve is not a valid curve object 126 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if edges or count is NULL 127 | */ 128 | SU_RESULT SUCurveGetEdges(SUCurveRef curve, size_t len, SUEdgeRef edges[], 129 | size_t* count); 130 | 131 | #ifdef __cplusplus 132 | } // extern "C" 133 | #endif 134 | 135 | #endif // SKETCHUP_MODEL_CURVE_H_ 136 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/dynamic_component_attribute.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Trimble Inc. All Rights Reserved 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SUDynamicComponentAttributeRef. 7 | */ 8 | #ifndef SKETCHUP_MODEL_DYNAMIC_COMPONENT_ATTRIBUTE_H_ 9 | #define SKETCHUP_MODEL_DYNAMIC_COMPONENT_ATTRIBUTE_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /** 20 | @struct SUDynamicComponentAttributeRef 21 | @brief References attribute data about a dynamic component. 22 | */ 23 | 24 | /** 25 | @brief Gets the name of the attribute. 26 | @since SketchUp 2016, API 4.0 27 | @param[in] attribute The dynamic component attribute object. 28 | @param[out] name The internal name of the attribute. 29 | @related SUDynamicComponentAttributeRef 30 | @return 31 | - \ref SU_ERROR_NONE on success 32 | - \ref SU_ERROR_INVALID_INPUT if attribute is not a valid object 33 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if name is NULL 34 | - \ref SU_ERROR_INVALID_OUTPUT if name does not point to a valid \ref 35 | SUStringRef object 36 | */ 37 | SU_RESULT SUDynamicComponentAttributeGetName( 38 | SUDynamicComponentAttributeRef attribute, 39 | SUStringRef* name); 40 | 41 | /** 42 | @brief Gets the display name of the attribute. 43 | @since SketchUp 2016, API 4.0 44 | @param[in] attribute The dynamic component attribute object. 45 | @param[out] display_name The attribute name as it should be displayed to the 46 | user. 47 | @related SUDynamicComponentAttributeRef 48 | @return 49 | - \ref SU_ERROR_NONE on success 50 | - \ref SU_ERROR_INVALID_INPUT if attribute is not a valid object 51 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if display_name is NULL 52 | - \ref SU_ERROR_INVALID_OUTPUT if display_name does not point to a valid \ref 53 | SUStringRef object 54 | */ 55 | SU_RESULT SUDynamicComponentAttributeGetDisplayName( 56 | SUDynamicComponentAttributeRef attribute, 57 | SUStringRef* display_name); 58 | 59 | /** 60 | @brief Gets the visibility setting of the attribute. 61 | @since SketchUp 2016, API 4.0 62 | @param[in] attribute The dynamic component attribute object. 63 | @param[out] visible Set to true if the attribute is visible to users and 64 | false if it is not. 65 | @related SUDynamicComponentAttributeRef 66 | @return 67 | - \ref SU_ERROR_NONE on success 68 | - \ref SU_ERROR_INVALID_INPUT if attribute is not a valid object 69 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if visible is NULL 70 | */ 71 | SU_RESULT SUDynamicComponentAttributeGetVisibility( 72 | SUDynamicComponentAttributeRef attribute, 73 | bool* visible); 74 | 75 | /** 76 | @brief Gets the display value of the attribute. 77 | @since SketchUp 2016, API 4.0 78 | @param[in] attribute The dynamic component attribute object. 79 | @param[out] display_value The value data for the attribute converted to a string 80 | formatted as it should be displayed to the user. 81 | @related SUDynamicComponentAttributeRef 82 | @return 83 | - \ref SU_ERROR_NONE on success 84 | - \ref SU_ERROR_INVALID_INPUT if attribute is not a valid object 85 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if display_value is NULL 86 | - \ref SU_ERROR_INVALID_OUTPUT if display_value does not point to a valid \ref 87 | SUStringRef object 88 | */ 89 | SU_RESULT SUDynamicComponentAttributeGetDisplayValue( 90 | SUDynamicComponentAttributeRef attribute, 91 | SUStringRef* display_value); 92 | 93 | #ifdef __cplusplus 94 | } // extern "C" { 95 | #endif 96 | 97 | #endif // SKETCHUP_MODEL_DYNAMIC_COMPONENT_ATTRIBUTE_H_ 98 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/dynamic_component_info.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Trimble Inc. All Rights Reserved 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SUDynamicComponentInfoRef. 7 | */ 8 | #ifndef SKETCHUP_MODEL_DYNAMIC_COMPONENT_INFO_H_ 9 | #define SKETCHUP_MODEL_DYNAMIC_COMPONENT_INFO_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /** 20 | @struct SUDynamicComponentInfoRef 21 | @brief References an object with information about a dynamic component. 22 | */ 23 | 24 | /** 25 | @brief Releases the DC info. DC info objects are created from component instance 26 | using SUComponentInstanceCreateDCInfo(), and must be released using 27 | this function. This function also invalidates the given DC info. 28 | @since SketchUp 2016, API 4.0 29 | @param[in,out] dc_info The dynamic component info object. 30 | @related SUDynamicComponentInfoRef 31 | @return 32 | - \ref SU_ERROR_NONE on success 33 | - \ref SU_ERROR_NULL_POINTER_INPUT if dc_info is NULL 34 | - \ref SU_ERROR_INVALID_INPUT if dc_info is not a valid object 35 | */ 36 | SU_RESULT SUDynamicComponentInfoRelease(SUDynamicComponentInfoRef* dc_info); 37 | 38 | /** 39 | @brief Retrieves the number of dynamic component attributes. 40 | @param[in] dc_info The dynamic component info object. 41 | @param[out] count The number of attributes. 42 | @related SUDynamicComponentInfoRef 43 | @return 44 | - \ref SU_ERROR_NONE on success 45 | - \ref SU_ERROR_INVALID_INPUT if dc_info is an invalid object 46 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL 47 | */ 48 | SU_RESULT SUDynamicComponentInfoGetNumDCAttributes( 49 | SUDynamicComponentInfoRef dc_info, size_t* count); 50 | 51 | /** 52 | @brief Retrieves the dynamic component attributes. 53 | @param[in] dc_info The dynamic component info object. 54 | @param[in] len The number of attributes to retrieve. 55 | @param[out] attributes The attributes retrieved. 56 | @param[out] count The number of attributes retrieved. 57 | @related SUDynamicComponentInfoRef 58 | @return 59 | - \ref SU_ERROR_NONE on success 60 | - \ref SU_ERROR_INVALID_INPUT if dc_info is an invalid object 61 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if attributes or count is NULL 62 | */ 63 | SU_RESULT SUDynamicComponentInfoGetDCAttributes( 64 | SUDynamicComponentInfoRef dc_info, size_t len, 65 | SUDynamicComponentAttributeRef attributes[], size_t* count); 66 | 67 | #ifdef __cplusplus 68 | } // extern "C" { 69 | #endif 70 | 71 | #endif // SKETCHUP_MODEL_DYNAMIC_COMPONENT_INFO_H_ 72 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/entity_list.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Trimble Inc. All Rights Reserved. 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SUEntityListRef. 7 | */ 8 | #ifndef SKETCHUP_MODEL_ENTITY_LIST_H_ 9 | #define SKETCHUP_MODEL_ENTITY_LIST_H_ 10 | 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /** 18 | @struct SUEntityListRef 19 | @brief References an entity list. 20 | @since SketchUp 2018, API 6.0 21 | */ 22 | 23 | /** 24 | @brief Creates an entity list object. 25 | @since SketchUp 2018, API 6.0 26 | @param[in,out] list The entity list object to be created. 27 | @related SUEntityListRef 28 | @return 29 | - \ref SU_ERROR_NONE on success 30 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if list is NULL 31 | - \ref SU_ERROR_OVERWRITE_VALID if list already references a valid object 32 | */ 33 | SU_RESULT SUEntityListCreate(SUEntityListRef* list); 34 | 35 | /** 36 | @brief Releases a list object. 37 | @since SketchUp 2018, API 6.0 38 | @param[in,out] list The list object to be released. 39 | @related SUEntityListRef 40 | @return 41 | - \ref SU_ERROR_NONE on success 42 | - \ref SU_ERROR_NULL_POINTER_INPUT if list is NULL 43 | - \ref SU_ERROR_INVALID_INPUT if list does not reference a valid object 44 | */ 45 | SU_RESULT SUEntityListRelease(SUEntityListRef* list); 46 | 47 | /** 48 | @brief Sets the iterator reference to the beginning of the list. The given 49 | iterator object must have been constructed using 50 | SUEntityListIteratorCreate(). The iterator must be released using 51 | SUEntityListIteratorRelease() when it is no longer needed. 52 | @since SketchUp 2018, API 6.0 53 | @param[in] list The list. 54 | @param[out] iterator An iterator Ref reference the beginning of the list. 55 | @related SUEntityListRef 56 | @return 57 | - \ref SU_ERROR_NONE on success 58 | - \ref SU_ERROR_INVALID_INPUT if list is not a valid object 59 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if iterator is NULL 60 | - \ref SU_ERROR_INVALID_OUTPUT if *iterator is not a valid object 61 | */ 62 | SU_RESULT SUEntityListBegin(SUEntityListRef list, 63 | SUEntityListIteratorRef* iterator); 64 | 65 | /** 66 | @brief Gets the number of entities in the list. 67 | @since SketchUp 2018, API 6.0 68 | @param[in] list The list object. 69 | @param[out] count The list size. 70 | @related SUEntityListRef 71 | @return 72 | - \ref SU_ERROR_NONE on success 73 | - \ref SU_ERROR_INVALID_INPUT if list is not a valid object 74 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL 75 | */ 76 | SU_RESULT SUEntityListSize(SUEntityListRef list, size_t* count); 77 | 78 | #ifdef __cplusplus 79 | } // extern "C" 80 | #endif 81 | 82 | #endif // SKETCHUP_MODEL_ENTITY_LIST_H_ 83 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/entity_list_iterator.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Trimble Inc. All Rights Reserved. 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SUEntityListIteratorRef. 7 | */ 8 | #ifndef SKETCHUP_MODEL_ENTITY_LIST_ITERATOR_H_ 9 | #define SKETCHUP_MODEL_ENTITY_LIST_ITERATOR_H_ 10 | 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /** 18 | @struct SUEntityListIteratorRef 19 | @brief References an entity list iterator object. 20 | @since SketchUp 2018, API 6.0 21 | */ 22 | 23 | /** 24 | @brief Creates an entity list iterator object. 25 | @since SketchUp 2018, API 6.0 26 | @param[in,out] iterator The entity list iterator object to be created. 27 | @related SUEntityListIteratorRef 28 | @return 29 | - \ref SU_ERROR_NONE on success 30 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if iterator is NULL 31 | - \ref SU_ERROR_OVERWRITE_VALID if iterator already references a valid object 32 | */ 33 | SU_RESULT SUEntityListIteratorCreate(SUEntityListIteratorRef* iterator); 34 | 35 | /** 36 | @brief Releases a iterator object. 37 | @since SketchUp 2018, API 6.0 38 | @param[in,out] iterator The iterator object to be released. 39 | @related SUEntityListIteratorRef 40 | @return 41 | - \ref SU_ERROR_NONE on success 42 | - \ref SU_ERROR_NULL_POINTER_INPUT if iterator is NULL 43 | - \ref SU_ERROR_INVALID_INPUT if iterator does not reference a valid object 44 | */ 45 | SU_RESULT SUEntityListIteratorRelease(SUEntityListIteratorRef* iterator); 46 | 47 | /** 48 | @brief Retrieves the specified entity pointer from the given iterator. 49 | @since SketchUp 2018, API 6.0 50 | @param[in] iterator The iterator from which to retrieve the entity. 51 | @param[out] entity The entity reference retrieved. 52 | @related SUEntityListIteratorRef 53 | @return 54 | - \ref SU_ERROR_NONE on success 55 | - \ref SU_ERROR_INVALID_INPUT if iterator is not a valid object 56 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if entity is NULL 57 | - \ref SU_ERROR_NO_DATA if the iterator references an invalid entity 58 | */ 59 | SU_RESULT SUEntityListIteratorGetEntity(SUEntityListIteratorRef iterator, 60 | SUEntityRef* entity); 61 | 62 | /** 63 | @brief Increments the provided iterator. 64 | @since SketchUp 2018, API 6.0 65 | @param[in,out] iterator The iterator to be incremented. 66 | @related SUEntityListIteratorRef 67 | @return 68 | - \ref SU_ERROR_NONE on success 69 | - \ref SU_ERROR_INVALID_INPUT if iterator is not a valid object 70 | - \ref SU_ERROR_OUT_OF_RANGE if reached the end of the collection 71 | */ 72 | SU_RESULT SUEntityListIteratorNext(SUEntityListIteratorRef iterator); 73 | 74 | /** 75 | @brief Checks if the iterator is still within range of the list. 76 | @since SketchUp 2018, API 6.0 77 | @param[in] iterator The iterator to be queried. 78 | @param[out] in_range A boolean indicating if the iterator is in range. 79 | @related SUEntityListIteratorRef 80 | @return 81 | - \ref SU_ERROR_NONE on success 82 | - \ref SU_ERROR_INVALID_INPUT if iterator is not a valid object 83 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if in_range is NULL 84 | - \ref SU_ERROR_OUT_OF_RANGE if the iterator is at the end of the collection 85 | */ 86 | SU_RESULT SUEntityListIteratorIsInRange(SUEntityListIteratorRef iterator, 87 | bool* in_range); 88 | 89 | #ifdef __cplusplus 90 | } // extern "C" 91 | #endif 92 | 93 | #endif // SKETCHUP_MODEL_ENTITY_LIST_ITERATOR_H_ 94 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/font.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Trimble Inc. All Rights Reserved. 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SUFontRef. 7 | */ 8 | #ifndef SKETCHUP_MODEL_FONT_H_ 9 | #define SKETCHUP_MODEL_FONT_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /** 20 | @struct SUFontRef 21 | @extends SUEntityRef 22 | @brief A font entity reference. 23 | @since SketchUp 2017, API 5.0 24 | */ 25 | 26 | /** 27 | @brief Retrieves the face name of a font object. 28 | @since SketchUp 2017, API 5.0 29 | @param[in] font The font object. 30 | @param[out] name The name retrieved. 31 | @related SUFontRef 32 | @return 33 | - \ref SU_ERROR_NONE on success 34 | - \ref SU_ERROR_INVALID_INPUT if font is not a valid object 35 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if name is NULL 36 | - \ref SU_ERROR_INVALID_OUTPUT if name does not point to a valid \ref 37 | SUStringRef object 38 | */ 39 | SU_RESULT SUFontGetFaceName(SUFontRef font, SUStringRef* name); 40 | 41 | /** 42 | @brief Retrieves a font's point size. 43 | @since SketchUp 2017, API 5.0 44 | @param[in] font The font object. 45 | @param[out] size The returned font size. 46 | @related SUFontRef 47 | @return 48 | - \ref SU_ERROR_NONE on success 49 | - \ref SU_ERROR_INVALID_INPUT if font is not a valid object 50 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if size is NULL 51 | */ 52 | SU_RESULT SUFontGetPointSize(SUFontRef font, size_t* size); 53 | 54 | /** 55 | @brief Retrieves a boolean indicating whether the font is bold. 56 | @since SketchUp 2017, API 5.0 57 | @param[in] font The font object. 58 | @param[out] is_bold The boolean retrieved. 59 | @related SUFontRef 60 | @return 61 | - \ref SU_ERROR_NONE on success 62 | - \ref SU_ERROR_INVALID_INPUT if font is not a valid object 63 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if is_bold is NULL 64 | */ 65 | SU_RESULT SUFontGetBold(SUFontRef font, bool* is_bold); 66 | 67 | /** 68 | @brief Retrieves a boolean indicating whether the font is italic. 69 | @since SketchUp 2017, API 5.0 70 | @param[in] font The font object. 71 | @param[out] is_italic The boolean retrieved. 72 | @related SUFontRef 73 | @return 74 | - \ref SU_ERROR_NONE on success 75 | - \ref SU_ERROR_INVALID_INPUT if font is not a valid object 76 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if is_italic is NULL 77 | */ 78 | SU_RESULT SUFontGetItalic(SUFontRef font, bool* is_italic); 79 | 80 | /** 81 | @brief Retrieves a boolean indicating whether the size of the font is defined 82 | as a height in world space. A false value indicates that the font size 83 | is defined in points (i.e. in screen space). 84 | @since SketchUp 2017, API 5.0 85 | @param[in] font The font object. 86 | @param[out] use_world_size The boolean retrieved. 87 | @related SUFontRef 88 | @return 89 | - \ref SU_ERROR_NONE on success 90 | - \ref SU_ERROR_INVALID_INPUT if font is not a valid object 91 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if is_italic is NULL 92 | */ 93 | SU_RESULT SUFontGetUseWorldSize(SUFontRef font, bool* use_world_size); 94 | 95 | /** 96 | @brief Retrieves the height of the font in inches when the font size is defined 97 | as a height in world space. That is, when \ref SUFontGetUseWorldSize() 98 | returns true. 99 | @since SketchUp 2017, API 5.0 100 | @param[in] font The font object. 101 | @param[out] world_size The returned world size factor. 102 | @related SUFontRef 103 | @return 104 | - \ref SU_ERROR_NONE on success 105 | - \ref SU_ERROR_INVALID_INPUT if font is not a valid object 106 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if world_size is NULL 107 | */ 108 | SU_RESULT SUFontGetWorldSize(SUFontRef font, double* world_size); 109 | 110 | /** 111 | @brief Converts from an \ref SUFontRef to an \ref SUEntityRef. 112 | This is essentially an upcast operation. 113 | @since SketchUp 2019, API 7.0 114 | @param[in] font The given font reference. 115 | @related SUFontRef 116 | @return 117 | - The converted SUEntityRef if font is a valid font. 118 | - If not, the returned reference will be invalid. 119 | */ 120 | SU_EXPORT SUEntityRef SUFontToEntity(SUFontRef font); 121 | 122 | /** 123 | @brief Converts from an \ref SUEntityRef to an \ref SUFontRef. 124 | This is essentially a downcast operation so the given entity must be 125 | convertible to an \ref SUFontRef. 126 | @since SketchUp 2019, API 7.0 127 | @param[in] entity The given entity reference. 128 | @related SUFontRef 129 | @return 130 | - The converted SUFontRef if the downcast operation succeeds 131 | - If not, the returned reference will be invalid 132 | */ 133 | SU_EXPORT SUFontRef SUFontFromEntity(SUEntityRef entity); 134 | 135 | #ifdef __cplusplus 136 | } // extern "C" 137 | #endif 138 | 139 | #endif // SKETCHUP_MODEL_FONT_H_ 140 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/geometry.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Trimble Inc., All rights reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Deprecated, don't use. 6 | * @deprecated This file was left here for compatibility. 7 | * Avoid using it in future projects if possible. 8 | */ 9 | #ifndef SKETCHUP_MODEL_GEOMETRY_H_ 10 | #define SKETCHUP_MODEL_GEOMETRY_H_ 11 | 12 | // This file was left here for compatibility. Avoid using it in future projects 13 | // if possible. 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #endif // SKETCHUP_MODEL_GEOMETRY_H_ 21 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/line_style.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Trimble Inc. All Rights Reserverd. 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SULineStyleRef. 7 | */ 8 | #ifndef SKETCHUP_SOURCE_SKORE_SKETCHUP_PUBLIC_MODEL_LINESTYLE_H_ 9 | #define SKETCHUP_SOURCE_SKORE_SKETCHUP_PUBLIC_MODEL_LINESTYLE_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #pragma pack(push, 8) 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /** 21 | @struct SULineStyleRef 22 | @extends SUEntityRef 23 | @brief References a line style. 24 | */ 25 | 26 | /** 27 | @brief Converts from a \ref SULineStyleRef to an \ref SUEntityRef. 28 | This is essentially an upcast operation. 29 | @since SketchUp 2020.1, API 8.1 30 | @param[in] line_style The given line style reference. 31 | @related SULineStyleRef 32 | @return 33 | - The converted \ref SUEntityRef if line_style is a valid line style 34 | - If not, the returned reference will be invalid 35 | */ 36 | SU_EXPORT SUEntityRef SULineStyleToEntity(SULineStyleRef line_style); 37 | 38 | /** 39 | @brief Converts from an \ref SUEntityRef to a \ref SULineStyleRef. 40 | This is essentially a downcast operation so the given entity must be 41 | convertible to a \ref SULineStyleRef. 42 | @since SketchUp 2020.1, API 8.1 43 | @param[in] entity_ref The given entity reference. 44 | @related SULineStyleRef 45 | @return 46 | - The converted \ref SULineStyleRef if the downcast operation succeeds 47 | - If not, the returned reference will be invalid 48 | */ 49 | SU_EXPORT SULineStyleRef SULineStyleFromEntity(SUEntityRef entity_ref); 50 | 51 | /** 52 | @brief Retrieves the name of a line style object. 53 | @since SketchUp 2019, API 7.0 54 | @param[in] line_style The line style object. 55 | @param[out] name The name retrieved. 56 | @related SULineStyleRef 57 | @return 58 | - \ref SU_ERROR_NONE on success 59 | - \ref SU_ERROR_INVALID_INPUT if line_style is not a valid object 60 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if name is NULL 61 | - \ref SU_ERROR_INVALID_OUTPUT if name does not point to a valid \ref 62 | SUStringRef object 63 | */ 64 | SU_RESULT SULineStyleGetName(SULineStyleRef line_style, SUStringRef* name); 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | #pragma pack(pop) 69 | 70 | #endif // SKETCHUP_SOURCE_SKORE_SKETCHUP_PUBLIC_MODEL_LINESTYLE_H_ 71 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/line_styles.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Trimble Inc. All Rights Reserverd. 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SULineStylesRef. 7 | */ 8 | #ifndef SKETCHUP_SOURCE_SKORE_SKETCHUP_PUBLIC_MODEL_LINESTYLES_H_ 9 | #define SKETCHUP_SOURCE_SKORE_SKETCHUP_PUBLIC_MODEL_LINESTYLES_H_ 10 | 11 | #include 12 | #include 13 | 14 | #pragma pack(push, 8) 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /** 20 | @struct SULineStylesRef 21 | @brief Provides access to the different line style objects in the model. 22 | */ 23 | 24 | /** 25 | @brief Gets the number of line styles. 26 | @since SketchUp 2019, API 7.0 27 | @param[in] line_styles The line_styles manager object. 28 | @param[out] count The number of line styles available. 29 | @related SULineStylesRef 30 | @return 31 | - \ref SU_ERROR_NONE on success 32 | - \ref SU_ERROR_INVALID_INPUT if line_style_manager is not valid 33 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL 34 | */ 35 | SU_RESULT SULineStylesGetNumLineStyles( 36 | SULineStylesRef line_styles, size_t* count); 37 | 38 | /** 39 | @brief Retrieves line styles associated with the line styles manager. 40 | @since SketchUp 2019, API 7.0 41 | @param[in] line_styles The line_styles manager object. 42 | @param[in] len The number of line style names 43 | to retrieve. 44 | @param[out] line_styles_provider_names The line_style names retrieved. 45 | @param[out] count The number of line style names 46 | retrieved. 47 | @related SULineStylesRef 48 | @return 49 | - \ref SU_ERROR_NONE on success 50 | - \ref SU_ERROR_INVALID_INPUT if line_style_manager is not a valid object 51 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if line_styles_providers or count is NULL 52 | - \ref SU_ERROR_INVALID_OUTPUT if any of the strings in line_styles_provider_names 53 | are invalid 54 | */ 55 | SU_RESULT SULineStylesGetLineStyleNames( 56 | SULineStylesRef line_styles, size_t len, 57 | SUStringRef line_styles_provider_names[], size_t* count); 58 | 59 | /** 60 | @brief Retrieves the line styles provider given a name. 61 | @since SketchUp 2019, API 7.0 62 | @param[in] line_styles The line_styles manager object. 63 | @param[in] name The name of the line style object to 64 | get. Assumed to be UTF-8 encoded. 65 | @param[out] line_style The line style object retrieved. 66 | @related SULineStylesRef 67 | @return 68 | - \ref SU_ERROR_NONE on success 69 | - \ref SU_ERROR_INVALID_INPUT if line_styles is not a valid object 70 | - \ref SU_ERROR_NULL_POINTER_INPUT if name is NULL 71 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if line_style is NULL 72 | - \ref SU_ERROR_NO_DATA if name does not match the name of any existing style. 73 | */ 74 | SU_RESULT SULineStylesGetLineStyleByName( 75 | SULineStylesRef line_styles, const char* name, 76 | SULineStyleRef* line_style); 77 | 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #pragma pack(pop) 83 | 84 | #endif // SKETCHUP_SOURCE_SKORE_SKETCHUP_PUBLIC_MODEL_LINESTYLES_H_ 85 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/location.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Trimble Inc. All Rights Reserved. 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SULocationRef. 7 | */ 8 | #ifndef SKETCHUP_MODEL_LOCATION_H_ 9 | #define SKETCHUP_MODEL_LOCATION_H_ 10 | 11 | #include 12 | 13 | /** 14 | @struct SULocationRef 15 | @brief References a type that contains location information of a model 16 | (e.g. latitude, longitude). 17 | */ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /** 24 | @brief Retrieves the latitude and longitude of a location object. 25 | @param[in] location The location object. 26 | @param[out] latitude The latitude value retrieved. 27 | @param[out] longitude The longitude value retrieved. 28 | @related SULocationRef 29 | @return 30 | - \ref SU_ERROR_NONE on success 31 | - \ref SU_ERROR_INVALID_INPUT if location is not a valid object 32 | - \ref SU_ERROR_NULL_POINTER_INPUT if latitude or longitude is NULL 33 | */ 34 | SU_RESULT SULocationGetLatLong(SULocationRef location, double* latitude, 35 | double* longitude); 36 | 37 | /** 38 | @brief Assigns the latitude and longitude values of a location object. 39 | @param[in] location The location object. 40 | @param[in] latitude The latitude value to assign. 41 | @param[in] longitude The longitude value to assign. 42 | @related SULocationRef 43 | @return 44 | - \ref SU_ERROR_NONE on success 45 | - \ref SU_ERROR_INVALID_INPUT if location is not a valid object or if the 46 | latitude is out of range [-90, 90] or if longitude is out of range 47 | [-180, 180] 48 | */ 49 | SU_RESULT SULocationSetLatLong(SULocationRef location, double latitude, 50 | double longitude); 51 | 52 | /** 53 | @brief Assigns the north angle values of a location object. 54 | @param[in] location The location object. 55 | @param[in] north_angle The north angle value to assign. 56 | @related SULocationRef 57 | @return 58 | - \ref SU_ERROR_NONE on success 59 | - \ref SU_ERROR_INVALID_INPUT if location is not a valid object or if north 60 | angle is out of range [0, 360] 61 | */ 62 | SU_RESULT SULocationSetNorthAngle(SULocationRef location, double north_angle); 63 | 64 | #ifdef __cplusplus 65 | } // extern "C" 66 | #endif 67 | 68 | #endif // SKETCHUP_MODEL_LOCATION_H_ 69 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/opening.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for SUOpeningRef. 6 | */ 7 | #ifndef SKETCHUP_MODEL_OPENING_H_ 8 | #define SKETCHUP_MODEL_OPENING_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /** 20 | @struct SUOpeningRef 21 | @brief References an opening object, which is a hole in a face created by an 22 | attached component instance or group. 23 | @since SketchUp 2014, API 2.0 24 | 25 | */ 26 | 27 | /** 28 | @brief Retrieves the number of points of an opening. 29 | @since SketchUp 2014, API 2.0 30 | @param[in] opening The opening object. 31 | @param[out] count The number of points. 32 | @related SUOpeningRef 33 | @return 34 | - \ref SU_ERROR_NONE on success 35 | - \ref SU_ERROR_INVALID_INPUT if opening is not a valid object 36 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL 37 | */ 38 | SU_RESULT SUOpeningGetNumPoints(SUOpeningRef opening, size_t* count); 39 | 40 | /** 41 | @brief Retrieves the points of an opening object. 42 | @since SketchUp 2014, API 2.0 43 | @param[in] opening The opening object. 44 | @param[in] len The number of points to retrieve. 45 | @param[out] points The points retrieved. 46 | @param[out] count The number of points retrieved. 47 | @related SUOpeningRef 48 | @return 49 | - \ref SU_ERROR_NONE on success 50 | - \ref SU_ERROR_INVALID_INPUT if opening is not a valid object 51 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if points or count is NULL 52 | */ 53 | SU_RESULT SUOpeningGetPoints(SUOpeningRef opening, size_t len, 54 | struct SUPoint3D points[], size_t* count); 55 | 56 | /** 57 | @brief Release an opening object. 58 | @since SketchUp 2014, API 2.0 59 | @param[in] opening The opening object. 60 | @related SUOpeningRef 61 | @return 62 | - \ref SU_ERROR_NONE on success 63 | - \ref SU_ERROR_INVALID_INPUT if opening is not a valid object 64 | - \ref SU_ERROR_NULL_POINTER_INPUT if points or count is NULL 65 | */ 66 | SU_RESULT SUOpeningRelease(SUOpeningRef *opening); 67 | 68 | #ifdef __cplusplus 69 | } // extern "C" { 70 | #endif 71 | 72 | #endif // SKETCHUP_MODEL_OPENING_H_ 73 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/options_manager.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Trimble Inc. All Rights Reserved 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SUOptionsManagerRef. 7 | */ 8 | #ifndef SKETCHUP_MODEL_OPTIONS_MANAGER_H_ 9 | #define SKETCHUP_MODEL_OPTIONS_MANAGER_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /** 20 | @struct SUOptionsManagerRef 21 | @brief Provides access to the different options provider objects in the model. 22 | Available options providers are: PageOptions, SlideshowOptions, 23 | UnitsOptions, NamedOptions, and PrintOptions. 24 | */ 25 | 26 | /** 27 | @brief Gets the number of available options providers. 28 | @param[in] options_manager The options manager object. 29 | @param[out] count The number of options available. 30 | @related SUOptionsManagerRef 31 | @return 32 | - \ref SU_ERROR_NONE on success 33 | - \ref SU_ERROR_INVALID_INPUT if options_manager is not valid 34 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL 35 | */ 36 | SU_RESULT SUOptionsManagerGetNumOptionsProviders( 37 | SUOptionsManagerRef options_manager, size_t* count); 38 | 39 | /** 40 | @brief Retrieves options providers associated with the options manager. 41 | @param[in] options_manager The options manager object. 42 | @param[in] len The number of options provider names 43 | to retrieve. 44 | @param[out] options_provider_names The options provider names retrieved. 45 | @param[out] count The number of options provider names 46 | retrieved. 47 | @related SUOptionsManagerRef 48 | @return 49 | - \ref SU_ERROR_NONE on success 50 | - \ref SU_ERROR_INVALID_INPUT if options_manager is not a valid object 51 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if options_providers or count is NULL 52 | - \ref SU_ERROR_INVALID_OUTPUT if any of the strings in options_provider_names 53 | are invalid 54 | */ 55 | SU_RESULT SUOptionsManagerGetOptionsProviderNames( 56 | SUOptionsManagerRef options_manager, size_t len, 57 | SUStringRef options_provider_names[], size_t* count); 58 | 59 | /** 60 | @brief Retrieves the options provider given a name. 61 | @param[in] options_manager The options manager object. 62 | @param[in] name The name of the options provider object to get. 63 | Assumed to be UTF-8 encoded. 64 | @param[out] options_provider The options_provider object retrieved. 65 | @related SUOptionsManagerRef 66 | @return 67 | - \ref SU_ERROR_NONE on success 68 | - \ref SU_ERROR_INVALID_INPUT if options_manager is not a valid object 69 | - \ref SU_ERROR_NULL_POINTER_INPUT if name is NULL 70 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if options_providers is NULL 71 | - \ref SU_ERROR_NO_DATA if the requested options provider object does not exist 72 | */ 73 | SU_RESULT SUOptionsManagerGetOptionsProviderByName( 74 | SUOptionsManagerRef options_manager, const char* name, 75 | SUOptionsProviderRef* options_provider); 76 | 77 | #ifdef __cplusplus 78 | } // extern "C" { 79 | #endif 80 | 81 | #endif // SKETCHUP_MODEL_OPTIONS_MANAGER_H_ 82 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/schema.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Trimble Inc. All Rights Reserved. 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SUSchemaRef. 7 | */ 8 | #ifndef SKETCHUP_MODEL_SCHEMA_H_ 9 | #define SKETCHUP_MODEL_SCHEMA_H_ 10 | 11 | #include 12 | #include 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /** 19 | @struct SUSchemaRef 20 | @brief Used to manage a Schema object 21 | */ 22 | 23 | /** 24 | @brief Gets a schema type from a schema. 25 | @param[in] schema_ref The schema object. 26 | @param[in] schema_type_name The name of the schema type to get. 27 | @param[out] schema_type_ref The schema type retrieved. 28 | @related SUSchemaRef 29 | @return 30 | - \ref SU_ERROR_NONE on success 31 | - \ref SU_ERROR_INVALID_INPUT if schema_ref is not a valid object 32 | - \ref SU_ERROR_NULL_POINTER_INPUT if schema_type_name is NULL 33 | - \ref SU_ERROR_INVALID_INPUT if schema_type_name is not a type from this 34 | schema 35 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if schema_type_ref is not a valid object 36 | */ 37 | SU_RESULT SUSchemaGetSchemaType(SUSchemaRef schema_ref, 38 | const char* schema_type_name, 39 | SUSchemaTypeRef* schema_type_ref); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif // SKETCHUP_MODEL_SCHEMA_H_ 46 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/schema_type.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Trimble Inc. All Rights Reserved. 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SUSchemaTypeRef. 7 | */ 8 | #ifndef SKETCHUP_MODEL_SCHEMA_TYPE_H_ 9 | #define SKETCHUP_MODEL_SCHEMA_TYPE_H_ 10 | 11 | #include 12 | #include 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /** 19 | @struct SUSchemaTypeRef 20 | @brief Used to manage a SchemaType object 21 | */ 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif // SKETCHUP_MODEL_SCHEMA_TYPE_H_ 28 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/skp.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Trimble Inc. All Rights Reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for reading metadata from SketchUp files without loading 6 | * the whole file. 7 | */ 8 | #ifndef SKETCHUP_MODEL_SKP_H_ 9 | #define SKETCHUP_MODEL_SKP_H_ 10 | 11 | #include 12 | #include 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /** 19 | @since SketchUp 2021.0, API 9.0 20 | 21 | @brief Reads the GUID, globally unique identifier, for a model without opening 22 | the whole file. 23 | 24 | @see SUModelGetGuid 25 | @see SUComponentDefinitionGetGuid 26 | 27 | @param[in] file_path The model filepath to read from. 28 | @param[out] guid The guid string. 29 | @return 30 | - \ref SU_ERROR_NONE on success 31 | - \ref SU_ERROR_NULL_POINTER_INPUT if \p file_path is `NULL` 32 | - \ref SU_ERROR_INVALID_INPUT if \p file_path does not exist 33 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p guid is `NULL` 34 | - \ref SU_ERROR_INVALID_OUTPUT if \p guid does not point to a valid 35 | SUStringRef object. 36 | - \ref SU_ERROR_MODEL_INVALID if the model is not valid 37 | - \ref SU_ERROR_GENERIC if an unknown error occured reading the file 38 | */ 39 | SU_RESULT SUSkpReadGuid(const char* file_path, SUStringRef* guid); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif // SKETCHUP_MODEL_SKP_H_ 46 | -------------------------------------------------------------------------------- /API/SketchUpAPI/model/uv_helper.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Trimble Inc. All Rights Reserved. 2 | 3 | 4 | /** 5 | * @file 6 | * @brief Interfaces for SUUVHelperRef. 7 | */ 8 | #ifndef SKETCHUP_MODEL_UV_HELPER_H_ 9 | #define SKETCHUP_MODEL_UV_HELPER_H_ 10 | 11 | #include 12 | #include 13 | 14 | #pragma pack(push, 8) 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /** 20 | @struct SUUVHelperRef 21 | @brief Used to compute UV texture coordinates for a particular face. 22 | */ 23 | 24 | /** 25 | @struct SUUVQ 26 | @brief Stores UV texture coordinates. 27 | */ 28 | struct SUUVQ { 29 | double u; ///< U coordinate 30 | double v; ///< V coordinate 31 | double q; ///< Q coordinate 32 | }; 33 | 34 | /** 35 | @brief Releases a UVHelper object that was obtained from a face. 36 | @param[in] uvhelper The UV helper object. 37 | @related SUUVHelperRef 38 | @return 39 | - \ref SU_ERROR_NONE on success 40 | - \ref SU_ERROR_NULL_POINTER_INPUT if uvhelper is NULL 41 | - \ref SU_ERROR_INVALID_INPUT if uvhelper is an invalid object 42 | */ 43 | SU_RESULT SUUVHelperRelease(SUUVHelperRef* uvhelper); 44 | 45 | /** 46 | @brief Retrieves the UVQ point at the given point for the front of the face. 47 | @param[in] uvhelper The UV helper object. 48 | @param[in] point The point where the coordinates are to be computed. 49 | @param[out] uvq The coordinates retrieved. 50 | @related SUUVHelperRef 51 | @return 52 | - \ref SU_ERROR_NONE on success 53 | - \ref SU_ERROR_INVALID_INPUT if uvhelper is an invalid object 54 | - \ref SU_ERROR_NULL_POINTER_INPUT if point is NULL 55 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if uvq is NULL 56 | */ 57 | SU_RESULT SUUVHelperGetFrontUVQ(SUUVHelperRef uvhelper, 58 | const struct SUPoint3D* point, 59 | struct SUUVQ* uvq); 60 | 61 | /** 62 | @brief Retrieves the UVQ point at the given point for the back of the face. 63 | @param[in] uvhelper The UVHelper object. 64 | @param[in] point The point where the coordinates are to be computed. 65 | @param[out] uvq The coordinates retrieved. 66 | @related SUUVHelperRef 67 | @return 68 | - \ref SU_ERROR_NONE on success 69 | - \ref SU_ERROR_INVALID_INPUT if uvhelper is an invalid object 70 | - \ref SU_ERROR_NULL_POINTER_INPUT if point is NULL 71 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if uvq is NULL 72 | */ 73 | SU_RESULT SUUVHelperGetBackUVQ(SUUVHelperRef uvhelper, 74 | const struct SUPoint3D* point, 75 | struct SUUVQ* uvq); 76 | 77 | #ifdef __cplusplus 78 | } // extern "C" { 79 | #endif 80 | #pragma pack(pop) 81 | 82 | #endif // SKETCHUP_MODEL_UV_HELPER_H_ 83 | -------------------------------------------------------------------------------- /API/SketchUpAPI/sketchup.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2020 Trimble Inc., All rights reserved. 2 | // This file is intended for public distribution. 3 | 4 | /** 5 | * @file 6 | * @brief Utility header that loads all other headers in the SDK package. 7 | */ 8 | #ifndef SKETCHUP_SKETCHUP_H_ 9 | #define SKETCHUP_SKETCHUP_H_ 10 | 11 | /** 12 | * @dir SketchUpAPI 13 | * @brief Interfaces for the SketchUp SDK. 14 | */ 15 | 16 | /** 17 | * @dir SketchUpAPI/application 18 | * @brief Interfaces for usage within the SketchUp application. 19 | */ 20 | 21 | /** 22 | * @dir SketchUpAPI/geometry 23 | * @brief Interfaces for geometric operations. 24 | */ 25 | 26 | /** 27 | * @dir SketchUpAPI/import_export 28 | * @brief Interfaces for importers and exporters. 29 | */ 30 | 31 | /** 32 | * @dir SketchUpAPI/model 33 | * @brief Interfaces for the SketchUp model. 34 | */ 35 | 36 | /** 37 | * @dir SketchUpAPI/utils 38 | * @brief General utility interfaces. 39 | */ 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | #include 84 | #include 85 | #include 86 | #include 87 | #include 88 | #include 89 | #include 90 | #include 91 | #include 92 | #include 93 | #include 94 | #include 95 | #include 96 | #include 97 | #include 98 | #include 99 | #include 100 | #include 101 | #include 102 | #include 103 | #include 104 | #include 105 | #include 106 | #include 107 | #include 108 | #include 109 | #include 110 | #include 111 | #include 112 | #include 113 | #include 114 | #include 115 | #include 116 | #include 117 | #include 118 | #include 119 | #include 120 | #include 121 | #endif // SKETCHUP_SKETCHUP_H_ 122 | -------------------------------------------------------------------------------- /API/SketchUpAPI/sketchup_info.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Trimble Inc., All rights reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for obtaining information about the executing SketchUp 6 | * application. 7 | * @note This is only relevant for the Live API. 8 | */ 9 | #ifndef SKETCHUP_SKETCHUP_INFO_H_ 10 | #define SKETCHUP_SKETCHUP_INFO_H_ 11 | 12 | #include 13 | 14 | #pragma pack(push, 8) 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /** 20 | @enum SUEdition 21 | @brief This is the edition of SketchUp currently running. 22 | @since SketchUp 2016, API 4.0 23 | */ 24 | enum SUEdition { 25 | SUEdition_Unknown, 26 | SUEdition_Make, ///< SketchUp Make 27 | SUEdition_Pro ///< SketchUp Pro 28 | }; 29 | 30 | /** 31 | @brief Returns the version string for the current SketchUp version. This is 32 | exported only by the SketchUp executable. It is not part of the 33 | standalone SDK. 34 | @since SketchUp 2016, API 4.0 35 | @param[in] length Length of the string buffer passed in including null 36 | terminator. 37 | @param[out] version The UTF-8 encoded version string. This must be large enough 38 | to hold the version string including null terminator. 39 | @return 40 | - \ref SU_ERROR_NONE on success 41 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if version is NULL 42 | - \ref SU_ERROR_INSUFFICIENT_SIZE if length is too small 43 | */ 44 | SU_RESULT SUGetVersionStringUtf8(size_t length, char* version); 45 | 46 | /** 47 | @brief Returns the SketchUp edition (Pro or Make). This is only exported by 48 | the SketchUp executable. It is not part of the standalone SDK. Note: 49 | Starting with version 2018, SketchUp Make is no longer available. So this 50 | function will always return \ref SUEdition_Pro. 51 | @since SketchUp 2016, API 4.0 52 | @param[out] edition The edition of Sketchup 53 | @see SUEdition 54 | @return 55 | - \ref SU_ERROR_NONE on success 56 | - \ref SU_ERROR_NULL_POINTER_OUTPUT if edition is NULL 57 | */ 58 | SU_RESULT SUGetEdition(enum SUEdition* edition); 59 | 60 | #ifdef __cplusplus 61 | } // extern "C" { 62 | #endif 63 | #pragma pack(pop) 64 | 65 | #endif // SKETCHUP_SKETCHUP_INFO_H_ 66 | -------------------------------------------------------------------------------- /API/SketchUpAPI/slapi.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Trimble Inc., All rights reserved. 2 | // This file is intended for public distribution. 3 | 4 | /** 5 | * @file 6 | * @brief Deprecated, don't use. 7 | * @deprecated This file was left here for compatibility. 8 | * Avoid using it in future projects if possible. 9 | */ 10 | 11 | // NOTE: This file is provided as a shim header to include common.h, which now 12 | // contains the contents of the original slapi.h. This rename is due to the 13 | // addition of the Layout API for consistency. This header is deprecated and 14 | // will be removed in the future. 15 | 16 | #include 17 | -------------------------------------------------------------------------------- /API/SketchUpAPI/transformation.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Trimble Inc., All rights reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Deprecated, don't use. 6 | * @deprecated This file was left here for compatibility. 7 | * Avoid using it in future projects if possible. 8 | */ 9 | #ifndef SKETCHUP_TRANSFORMATION_H_ 10 | #define SKETCHUP_TRANSFORMATION_H_ 11 | 12 | // This file was left here for compatibility. Avoid using it in future projects 13 | // if possible. 14 | #include 15 | 16 | #endif // SKETCHUP_TRANSFORMATION_H_ 17 | -------------------------------------------------------------------------------- /API/SketchUpAPI/utils/math_helpers.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Trimble Inc. All rights reserved. 2 | 3 | /** 4 | * @file 5 | * @brief Interfaces for comparing values with tolerances. 6 | */ 7 | #ifndef SKETCHUP_UTILS_MATH_HELPERS_H_ 8 | #define SKETCHUP_UTILS_MATH_HELPERS_H_ 9 | 10 | #include 11 | 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /** 18 | @brief Converts a value from degrees to radians. 19 | @since SketchUp 2018, API 6.0 20 | @param[in] value A value in degrees. 21 | @return The value converted to radians. 22 | */ 23 | SU_EXPORT double SUDegreesToRadians(double value); 24 | 25 | /** 26 | @brief Converts a value from radians to degrees. 27 | @since SketchUp 2018, API 6.0 28 | @param[in] value A value in radians. 29 | @return The value converted to degrees. 30 | */ 31 | SU_EXPORT double SURadiansToDegrees(double value); 32 | 33 | /** 34 | @brief Compares two values for equality with a tolerance. 35 | @since SketchUp 2018, API 6.0 36 | @param[in] val1 The first value. 37 | @param[in] val2 The second value. 38 | @return True if the values are equal. 39 | */ 40 | SU_EXPORT bool SUEquals(double val1, double val2); 41 | 42 | /** 43 | @brief Compares two values with a tolerance to see if val1 is less than val2. 44 | @since SketchUp 2018, API 6.0 45 | @param[in] val1 The first value. 46 | @param[in] val2 The second value. 47 | @return True if val1 is less than val2. 48 | */ 49 | SU_EXPORT bool SULessThan(double val1, double val2); 50 | 51 | /** 52 | @brief Compares two values with a tolerance to see if val1 is less than or equal 53 | to val2. 54 | @since SketchUp 2018, API 6.0 55 | @param[in] val1 The first value. 56 | @param[in] val2 The second value. 57 | @return True if val1 is less than or equal to val2. 58 | */ 59 | SU_EXPORT bool SULessThanOrEqual(double val1, double val2); 60 | 61 | /** 62 | @brief Compares two values with a tolerance to see if val1 is greater than val2. 63 | @since SketchUp 2018, API 6.0 64 | @param[in] val1 The first value. 65 | @param[in] val2 The second value. 66 | @return True if val1 is greater than val2. 67 | */ 68 | SU_EXPORT bool SUGreaterThan(double val1, double val2); 69 | 70 | /** 71 | @brief Compares two values with a tolerance to see if val1 is greater than or 72 | equal to val2. 73 | @since SketchUp 2018, API 6.0 74 | @param[in] val1 The first value. 75 | @param[in] val2 The second value. 76 | @return True if val1 is greater than or equal to val2. 77 | */ 78 | SU_EXPORT bool SUGreaterThanOrEqual(double val1, double val2); 79 | 80 | // SketchUp 2017 added these functions, but lacked the SU* prefix. As of 81 | // SketchUp 2018 they were renamed. This compatibility macro is left around 82 | // until SketchUp 2019. Enable to temporarily re-enable the old function names. 83 | #ifdef SU_COMPAT_MATH_UTILS 84 | 85 | SU_DEPRECATED_FUNCTION("6.0") 86 | static double DegreesToRadians(double value) { 87 | return SUDegreesToRadians(value); 88 | } 89 | 90 | SU_DEPRECATED_FUNCTION("6.0") 91 | static bool Equals(double val1, double val2) { 92 | return SUEquals(val1, val2); 93 | } 94 | 95 | SU_DEPRECATED_FUNCTION("6.0") 96 | static bool GreaterThan(double val1, double val2) { 97 | return SUGreaterThan(val1, val2); 98 | } 99 | 100 | SU_DEPRECATED_FUNCTION("6.0") 101 | static bool GreaterThanOrEqual(double val1, double val2) { 102 | return SUGreaterThanOrEqual(val1, val2); 103 | } 104 | 105 | SU_DEPRECATED_FUNCTION("6.0") 106 | static bool LessThan(double val1, double val2) { 107 | return SULessThan(val1, val2); 108 | } 109 | 110 | SU_DEPRECATED_FUNCTION("6.0") 111 | static bool LessThanOrEqual(double val1, double val2) { 112 | return SULessThanOrEqual(val1, val2); 113 | } 114 | 115 | SU_DEPRECATED_FUNCTION("6.0") 116 | static double RadiansToDegrees(double value) { 117 | return SURadiansToDegrees(value); 118 | } 119 | #endif 120 | 121 | #ifdef __cplusplus 122 | } // end extern "C" 123 | #endif // __cplusplus 124 | 125 | #endif // SKETCHUP_UTILS_MATH_HELPERS_H_ 126 | -------------------------------------------------------------------------------- /API/SketchUpCommonPreferences.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/API/SketchUpCommonPreferences.dll -------------------------------------------------------------------------------- /API/sketchup.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/API/sketchup.lib -------------------------------------------------------------------------------- /Icons/ReadSKP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Icons/ReadSKP.png -------------------------------------------------------------------------------- /Icons/ReadSKPSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Icons/ReadSKPSmall.png -------------------------------------------------------------------------------- /Icons/SKP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Icons/SKP.png -------------------------------------------------------------------------------- /Icons/SKPSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Icons/SKPSmall.png -------------------------------------------------------------------------------- /Icons/WriteSKP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Icons/WriteSKP.png -------------------------------------------------------------------------------- /Icons/WriteSKPSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Icons/WriteSKPSmall.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Maximilian Thumfart 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SketchUpNET 2 | 3 | C++/CLI API Wrapper for the Trimble(R) SketchUp(R) C API. 4 | http://www.sketchup.com/intl/en/developer/api-terms-of-service.pdf 5 | 6 | This library adds .NET support to the existing SketchUp C-API. It makes most SketchUp C-API features available in .NET and therefore accessible in C# or VB applications. You can download a pre-built release of the library or build it yourself from scratch. 7 | 8 | ### Code-Examples 9 | 10 | This Repo contains three sample projects using SketchUpNET in C#.NET: 11 | 12 | - SketchUpForDynamo: An Autodesk's(R) Dynamo Node Package allowing you to read/write SketchUp files from Dynamo. 13 | - SketchUpForGrasshopper: A Set of Components for McNeel's(R) Grasshopper(R) allowing you to read/write SketchUp files from GH. 14 | - SketchUpNETConsole: A sample C# console application using SketchUpNET. 15 | 16 | If you want to build your own application using the SketchUp API take the following steps: 17 | 18 | #### Loading a Model 19 | 20 | ```csharp 21 | SketchUpNET.SketchUp skp = new SketchUp(); 22 | skp.LoadModel("myfile.skp", true); 23 | foreach (var srf in skp.Surfaces) { 24 | // do something with your surfaces 25 | } 26 | ``` 27 | 28 | #### Saving a Model 29 | 30 | ```csharp 31 | skp.WriteNewModel("filename.skp"); 32 | ``` 33 | 34 | #### Converting a Model 35 | 36 | ```csharp 37 | SketchUpNET.SketchUp skp = new SketchUp(); 38 | skp.SaveAs("old-file.skp", SKPVersion.V2020, "new-file.skp"); 39 | ``` 40 | 41 | #### Writing a Surface to a File 42 | 43 | ```csharp 44 | SketchUpNET.SketchUp skp = new SketchUpNET.SketchUp(); 45 | skp.Layers = new List() { new Layer("Layer0") }; 46 | skp.Surfaces = new List(); 47 | skp.Curves = new List(); 48 | skp.Edges = new List(); 49 | List Verticies = new List(); 50 | 51 | SketchUpNET.Loop OuterEdges = new SketchUpNET.Loop(); 52 | OuterEdges.Edges = new List(); 53 | { 54 | OuterEdges.Edges.Add(new SketchUpNET.Edge(new Vertex(0, 0, 0), new Vertex(500, 0, 0), "Layer0")); 55 | OuterEdges.Edges.Add(new SketchUpNET.Edge(new Vertex(500, 0, 0), new Vertex(500, 500, 0), "Layer0")); 56 | OuterEdges.Edges.Add(new SketchUpNET.Edge(new Vertex(500, 500, 0), new Vertex(0, 500, 0), "Layer0")); 57 | OuterEdges.Edges.Add(new SketchUpNET.Edge(new Vertex(0, 500, 0), new Vertex(0, 0, 0), "Layer0")); 58 | } 59 | 60 | List InnerLoops = new List(); 61 | { 62 | SketchUpNET.Loop InnerEdges = new SketchUpNET.Loop(); 63 | InnerEdges.Edges = new List(); 64 | InnerEdges.Edges.Add(new SketchUpNET.Edge(new Vertex(100, 100, 0), new Vertex(400, 100, 0), "Layer0")); 65 | InnerEdges.Edges.Add(new SketchUpNET.Edge(new Vertex(400, 100, 0), new Vertex(400, 400, 0), "Layer0")); 66 | InnerEdges.Edges.Add(new SketchUpNET.Edge(new Vertex(400, 400, 0), new Vertex(100, 400, 0), "Layer0")); 67 | InnerEdges.Edges.Add(new SketchUpNET.Edge(new Vertex(100, 400, 0), new Vertex(100, 100, 0), "Layer0")); 68 | InnerLoops.Add(InnerEdges); 69 | } 70 | 71 | SketchUpNET.Surface s = new SketchUpNET.Surface(OuterEdges, InnerLoops); 72 | skp.Surfaces.Add(s); 73 | 74 | skp.WriteNewModel(@"TempModel.skp"); 75 | ``` 76 | 77 | ### Requirements 78 | 79 | If not installed you might requires Visual C++ Redistributable Packages for Visual Studio 80 | https://www.microsoft.com/en-sg/download/details.aspx?id=40784 81 | 82 | The library requires the SketchUp C API which is part of the package. 83 | 84 | 85 | ### nuget Binaries 86 | 87 | SketchUpNET is available as a precompiled binary on nuget: 88 | https://www.nuget.org/packages/SketchUpNET/ 89 | -------------------------------------------------------------------------------- /SketchUpForDynamo/Material.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SketchUpForDynamo 8 | { 9 | public class Material 10 | { 11 | private SketchUpNET.Material Internal; 12 | 13 | internal Material(SketchUpNET.Material mat) 14 | { 15 | Internal = mat; 16 | } 17 | 18 | /// 19 | /// Get Material Name 20 | /// 21 | /// 22 | public string GetName() 23 | { 24 | return Internal.Name; 25 | } 26 | 27 | /// 28 | /// Get Texture Filename 29 | /// 30 | /// 31 | public string GetTextureFileName() 32 | { 33 | return Internal.MaterialTexture.Name; 34 | } 35 | 36 | /// 37 | /// Get Textrue Height 38 | /// 39 | /// 40 | public int GetTextureHeight() 41 | { 42 | return Internal.MaterialTexture.Height; 43 | } 44 | 45 | /// 46 | /// Get Texture Width 47 | /// 48 | /// 49 | public int GetTextureWidth() 50 | { 51 | return Internal.MaterialTexture.Width; 52 | } 53 | 54 | /// 55 | /// Get Texture Scale in Height 56 | /// 57 | /// 58 | public double GetTextureScaleH() 59 | { 60 | return Internal.MaterialTexture.ScaleH; 61 | } 62 | 63 | /// 64 | /// Get Textute Scale in Width 65 | /// 66 | /// 67 | public double GetTextureScaleW() 68 | { 69 | return Internal.MaterialTexture.ScaleW; 70 | } 71 | 72 | /// 73 | /// Does the material texture use alpha? 74 | /// 75 | /// 76 | public bool GetTextureUsesAlpha() 77 | { 78 | return Internal.MaterialTexture.useAlpha; 79 | } 80 | 81 | /// 82 | /// Get Colour 83 | /// 84 | /// 85 | public DSCore.Color GetColour() 86 | { 87 | return Internal.Colour.ToDSColour(); 88 | } 89 | 90 | /// 91 | /// Get Texture Colour 92 | /// 93 | /// 94 | public DSCore.Color GetTextureColour() 95 | { 96 | return Internal.MaterialTexture.Colour.ToDSColour(); 97 | } 98 | 99 | /// 100 | /// Get Opacity 101 | /// 102 | /// 103 | public double GetOpacity() 104 | { 105 | return Internal.Opacity; 106 | } 107 | 108 | /// 109 | /// Does the material use opacity? 110 | /// 111 | /// 112 | public bool GetUseOpacity() 113 | { 114 | return Internal.UseOpacity; 115 | } 116 | 117 | /// 118 | /// Does the material use colour? 119 | /// 120 | /// 121 | public bool GetUsesColor() 122 | { 123 | return Internal.UsesColor; 124 | } 125 | 126 | /// 127 | /// Does the material use texture? 128 | /// 129 | /// 130 | public bool GetUsesTexture() 131 | { 132 | return Internal.UsesTexture; 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /SketchUpForDynamo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SketchUp for Dynamo")] 9 | [assembly: AssemblyDescription("SketchUp for Dynamo")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SketchUp for Dynamo")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("866d0b3e-a772-4436-adeb-f3f7bdfe9455")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.7.2.0")] 36 | [assembly: AssemblyFileVersion("1.7.2.0")] 37 | -------------------------------------------------------------------------------- /SketchUpForDynamo/SketchUpForDynamoImages.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/SketchUpForDynamo/SketchUpForDynamoImages.resources -------------------------------------------------------------------------------- /SketchUpForGrasshopper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SketchUpSharp.Grasshopper")] 9 | [assembly: AssemblyDescription("SketchUp Components for Grasshopper")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SketchUpSharp.Grasshopper")] 13 | [assembly: AssemblyCopyright("Copyright © 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("99c5b02d-bcb1-41d6-af0d-263f86136889")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.1.0")] 36 | [assembly: AssemblyFileVersion("1.0.1.0")] 37 | -------------------------------------------------------------------------------- /SketchUpForGrasshopper/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SketchUpForGrasshopper.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SketchUpForGrasshopper.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap Skp { 67 | get { 68 | object obj = ResourceManager.GetObject("Skp", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /SketchUpForGrasshopper/Resources/Skp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/SketchUpForGrasshopper/Resources/Skp.png -------------------------------------------------------------------------------- /SketchUpForGrasshopper/SketchUpForGrasshopper.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {942583E2-369B-4A00-8E34-F22073A911B2} 8 | Library 9 | Properties 10 | SketchUpForGrasshopper 11 | SketchUpForGrasshopper 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | C:\Program Files\Rhino 6\Plug-ins\Grasshopper\GH_IO.dll 35 | False 36 | 37 | 38 | C:\Program Files\Rhino 6\Plug-ins\Grasshopper\Grasshopper.dll 39 | False 40 | 41 | 42 | C:\Program Files\Rhino 6\System\RhinoCommon.dll 43 | False 44 | 45 | 46 | C:\Program Files\Rhino 6\System\Rhino_DotNet.dll 47 | False 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | True 63 | True 64 | Resources.resx 65 | 66 | 67 | 68 | 69 | ResXFileCodeGenerator 70 | Resources.Designer.cs 71 | 72 | 73 | 74 | 75 | sketchup.lib 76 | Always 77 | 78 | 79 | SketchUpAPI.lib 80 | Always 81 | 82 | 83 | 84 | 85 | 86 | {1c4d4501-eb39-45c8-bed0-609a978e823f} 87 | SketchUpNET 88 | 89 | 90 | 91 | 92 | SketchUpAPI.dll 93 | Always 94 | 95 | 96 | SketchUpCommonPreferences.dll 97 | Always 98 | 99 | 100 | 101 | 102 | move $(TargetDir)$(TargetFileName) $(TargetDir)$(TargetName).gha 103 | copy $(TargetDir)*.* %25AppData%25\Grasshopper\Libraries 104 | 105 | 112 | -------------------------------------------------------------------------------- /SketchUpNET.Unittest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SketchUpNET.Unittest")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SketchUpNET.Unittest")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5aac9c72-cfbd-4b20-83fc-dbafa4fc7a53")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SketchUpNET/Color.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | using namespace System; 32 | using namespace System::Collections; 33 | using namespace System::Collections::Generic; 34 | 35 | namespace SketchUpNET 36 | { 37 | public ref class Color 38 | { 39 | public: 40 | 41 | byte R; 42 | byte G; 43 | byte B; 44 | byte A; 45 | 46 | Color(byte a, byte r, byte g, byte b) 47 | { 48 | this->R = r; 49 | this->G = g; 50 | this->B = b; 51 | this->A = a; 52 | }; 53 | 54 | Color() {}; 55 | internal: 56 | static Color^ FromSU(SUColor color) 57 | { 58 | Color^ v = gcnew Color(color.alpha, color.red, color.green, color.blue); 59 | 60 | return v; 61 | }; 62 | 63 | SUColor ToSU() 64 | { 65 | SUColor c = { this->R,this->G,this->B,this->A }; 66 | return c; 67 | } 68 | 69 | }; 70 | 71 | 72 | } -------------------------------------------------------------------------------- /SketchUpNET/Color.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Color.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Component.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include "surface.h" 37 | #include "edge.h" 38 | #include "group.h" 39 | #include "curve.h" 40 | #include "utilities.h" 41 | #include "Transform.h" 42 | #include "Instance.h" 43 | 44 | using namespace System; 45 | using namespace System::Collections; 46 | using namespace System::Collections::Generic; 47 | 48 | namespace SketchUpNET 49 | { 50 | public ref class Component 51 | { 52 | public: 53 | System::String^ Name; 54 | System::String^ Description; 55 | List^ Surfaces; 56 | List^ Instances; 57 | System::String^ Guid; 58 | List^ Curves; 59 | List^ Edges; 60 | List^ Groups; 61 | 62 | Component(System::String^ name, System::String^ guid, List^ surfaces, List^ curves, List^ edges, List^ instances, System::String^ desc, List^ groups) 63 | { 64 | this->Name = name; 65 | this->Surfaces = surfaces; 66 | this->Guid = guid; 67 | this->Curves = curves; 68 | this->Edges = edges; 69 | this->Description = desc; 70 | this->Instances = instances; 71 | this->Groups = groups; 72 | }; 73 | 74 | Component(){}; 75 | internal: 76 | static Component^ FromSU(SUComponentDefinitionRef comp, bool includeMeshes, System::Collections::Generic::Dictionary^ materials) 77 | { 78 | SUStringRef name = SU_INVALID; 79 | SUStringCreate(&name); 80 | SUComponentDefinitionGetName(comp, &name); 81 | 82 | SUStringRef desc = SU_INVALID; 83 | SUStringCreate(&desc); 84 | SUComponentDefinitionGetDescription(comp, &desc); 85 | 86 | SUEntitiesRef entities = SU_INVALID; 87 | SUComponentDefinitionGetEntities(comp, &entities); 88 | 89 | size_t faceCount = 0; 90 | SUEntitiesGetNumFaces(entities, &faceCount); 91 | 92 | 93 | SUStringRef guid = SU_INVALID; 94 | SUStringCreate(&guid); 95 | SUComponentDefinitionGetGuid(comp, &guid); 96 | 97 | List^ surfaces = Surface::GetEntitySurfaces(entities, includeMeshes, materials); 98 | List^ curves = Curve::GetEntityCurves(entities); 99 | List^ edges = Edge::GetEntityEdges(entities); 100 | List^ instances = Instance::GetEntityInstances(entities, materials); 101 | List^ grps = Group::GetEntityGroups(entities, includeMeshes, materials); 102 | 103 | 104 | 105 | Component^ v = gcnew Component(Utilities::GetString(name), Utilities::GetString(guid), surfaces, curves, edges,instances, Utilities::GetString(desc), grps); 106 | 107 | return v; 108 | }; 109 | 110 | }; 111 | 112 | 113 | } -------------------------------------------------------------------------------- /SketchUpNET/Component.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Component.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Curve.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include "edge.h" 37 | 38 | using namespace System; 39 | using namespace System::Collections; 40 | using namespace System::Collections::Generic; 41 | 42 | namespace SketchUpNET 43 | { 44 | public ref class Curve 45 | { 46 | public: 47 | 48 | /// 49 | /// Collection of edges forming the curve 50 | /// 51 | List^ Edges = gcnew List(); 52 | 53 | /// 54 | /// Indicates if this curve should be interpreted as an arc 55 | /// 56 | bool isArc; 57 | 58 | /// 59 | /// Creates a new curve based on a set of edges 60 | /// 61 | /// Underlying edges 62 | /// Should be interpreted as an arc 63 | Curve(List^ edges, bool isarc) 64 | { 65 | this->Edges = edges; 66 | this->isArc = isarc; 67 | }; 68 | 69 | Curve(){}; 70 | 71 | internal: 72 | 73 | static Curve^ FromSU(SUCurveRef curve) 74 | { 75 | List^ edgelist = gcnew List(); 76 | 77 | size_t edgecount = 0; 78 | SUCurveGetNumEdges(curve, &edgecount); 79 | if (edgecount > 0) 80 | { 81 | std::vector edges(edgecount); 82 | SUCurveGetEdges(curve, edgecount, &edges[0], &edgecount); 83 | 84 | for (size_t j = 0; j < edgecount; j++) 85 | { 86 | edgelist->Add(Edge::FromSU(edges[j])); 87 | } 88 | } 89 | 90 | SUCurveType type = SUCurveType::SUCurveType_Simple; 91 | SUCurveGetType(curve, &type); 92 | bool isArc = false; 93 | if (type == SUCurveType::SUCurveType_Arc) isArc = true; 94 | 95 | 96 | Curve^ v = gcnew Curve(edgelist, isArc); 97 | 98 | return v; 99 | }; 100 | 101 | SUCurveRef ToSU() 102 | { 103 | SUCurveRef curve = SU_INVALID; 104 | size_t size = this->Edges->Count; 105 | 106 | SUEdgeRef * edges = (SUEdgeRef *)malloc(*&size * sizeof(SUEdgeRef)); 107 | 108 | for (int i = 0; i < size; i++) 109 | { 110 | edges[i] = this->Edges[i]->ToSU(); 111 | } 112 | SUCurveCreateWithEdges(&curve, edges, size); 113 | return curve; 114 | } 115 | 116 | static SUCurveRef* ListToSU(List^ curves) 117 | { 118 | size_t size = curves->Count; 119 | SUCurveRef * result = (SUCurveRef *)malloc(*&size * sizeof(SUCurveRef)); 120 | for (int i = 0; i < size; i++) 121 | { 122 | result[i] = curves[i]->ToSU(); 123 | } 124 | return result; 125 | } 126 | 127 | static List^ GetEntityCurves(SUEntitiesRef entities) 128 | { 129 | List^ curves = gcnew List(); 130 | 131 | // GetCurves 132 | size_t curveCount = 0; 133 | SUEntitiesGetNumCurves(entities, &curveCount); 134 | if (curveCount > 0) 135 | { 136 | std::vector curvevector(curveCount); 137 | SUEntitiesGetCurves(entities, curveCount, &curvevector[0], &curveCount); 138 | 139 | 140 | for (size_t i = 0; i < curveCount; i++) { 141 | Curve^ curve = Curve::FromSU(curvevector[i]); 142 | curves->Add(curve); 143 | } 144 | } 145 | 146 | return curves; 147 | } 148 | 149 | 150 | }; 151 | 152 | 153 | 154 | 155 | } -------------------------------------------------------------------------------- /SketchUpNET/Curve.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Curve.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Edge.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "vertex.h" 38 | #include "utilities.h" 39 | 40 | using namespace System; 41 | using namespace System::Collections; 42 | using namespace System::Collections::Generic; 43 | 44 | namespace SketchUpNET 45 | { 46 | public ref class Edge 47 | { 48 | public: 49 | 50 | Vertex^ Start; 51 | Vertex^ End; 52 | System::String^ Layer; 53 | 54 | /// 55 | /// Creates a new edge by startpoint, endpoint and layer name 56 | /// 57 | /// Startpoint 58 | /// Endpoint 59 | /// Layername 60 | Edge(Vertex ^ start, Vertex ^ end, System::String^ layer) 61 | { 62 | this->Start = start; 63 | this->End = end; 64 | this->Layer = layer; 65 | }; 66 | 67 | Edge() {}; 68 | 69 | /// 70 | /// Creates a new edge by start end endpoint 71 | /// 72 | /// Startpoint 73 | /// Endpoint 74 | Edge(Vertex^ start, Vertex^ end){ 75 | this->Start = start; 76 | this->End = end; 77 | }; 78 | 79 | internal: 80 | static Edge^ FromSU(SUEdgeRef edge) 81 | { 82 | SUVertexRef startVertex = SU_INVALID; 83 | SUVertexRef endVertex = SU_INVALID; 84 | SUEdgeGetStartVertex(edge, &startVertex); 85 | SUEdgeGetEndVertex(edge, &endVertex); 86 | SUPoint3D start; 87 | SUPoint3D end; 88 | SUVertexGetPosition(startVertex, &start); 89 | SUVertexGetPosition(endVertex, &end); 90 | 91 | // Layer 92 | SULayerRef layer = SU_INVALID; 93 | SUDrawingElementGetLayer(SUEdgeToDrawingElement(edge), &layer); 94 | 95 | System::String^ layername = gcnew System::String(""); 96 | if (!SUIsInvalid(layer)) 97 | { 98 | layername = SketchUpNET::Utilities::GetLayerName(layer); 99 | } 100 | 101 | Edge^ v = gcnew Edge(Vertex::FromSU(start), Vertex::FromSU(end), layername); 102 | 103 | return v; 104 | }; 105 | 106 | SUEdgeRef ToSU() 107 | { 108 | SUEdgeRef edge = SU_INVALID; 109 | SUPoint3D start = this->Start->ToSU(); 110 | SUPoint3D end = this->End->ToSU(); 111 | SUEdgeCreate(&edge,&start,&end); 112 | return edge; 113 | } 114 | 115 | static SUEdgeRef* ListToSU(List^ list) 116 | { 117 | size_t size = list->Count; 118 | SUEdgeRef * result = (SUEdgeRef *)malloc(*&size * sizeof(SUEdgeRef)); 119 | for (int i = 0; i < size; i++) 120 | { 121 | result[i] = list[i]->ToSU(); 122 | } 123 | return result; 124 | } 125 | 126 | static List^ GetEntityEdges(SUEntitiesRef entities) 127 | { 128 | List^ edges = gcnew List(); 129 | 130 | // Get Edges 131 | size_t edgeCount = 0; 132 | SUEntitiesGetNumEdges(entities, false, &edgeCount); 133 | 134 | if (edgeCount > 0) 135 | { 136 | std::vector edgevector(edgeCount); 137 | SUEntitiesGetEdges(entities, false, edgeCount, &edgevector[0], &edgeCount); 138 | 139 | 140 | for (size_t i = 0; i < edgeCount; i++) { 141 | Edge^ edge = Edge::FromSU(edgevector[i]); 142 | edges->Add(edge); 143 | } 144 | } 145 | 146 | return edges; 147 | } 148 | 149 | 150 | }; 151 | 152 | 153 | 154 | 155 | } -------------------------------------------------------------------------------- /SketchUpNET/Edge.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Edge.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Group.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Group.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Instance.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #pragma once 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "transform.h" 38 | #include "utilities.h" 39 | #include "Material.h" 40 | 41 | using namespace System; 42 | using namespace System::Collections; 43 | using namespace System::Collections::Generic; 44 | 45 | namespace SketchUpNET 46 | { 47 | public ref class Instance 48 | { 49 | public: 50 | System::String^ Name; 51 | Transform^ Transformation; 52 | String^ ParentID; 53 | System::String^ Guid; 54 | System::Object^ Parent; 55 | System::String^ Layer; 56 | SketchUpNET::Material^ Material; 57 | 58 | Instance(System::String^ name, System::String^ guid, String^ parent, Transform^ transformation, System::String^ layername, SketchUpNET::Material^ mat) 59 | { 60 | this->Name = name; 61 | this->Transformation = transformation; 62 | this->ParentID = parent; 63 | this->Guid = guid; 64 | this->Layer = layername; 65 | this->Material = mat; 66 | }; 67 | 68 | 69 | Instance(){}; 70 | internal: 71 | static Instance^ FromSU(SUComponentInstanceRef comp, System::Collections::Generic::Dictionary^ materials) 72 | { 73 | SUStringRef name = SU_INVALID; 74 | SUStringCreate(&name); 75 | SUComponentInstanceGetName(comp, &name); 76 | 77 | SUComponentDefinitionRef definition = SU_INVALID; 78 | SUComponentInstanceGetDefinition(comp, &definition); 79 | 80 | SUStringRef instanceguid = SU_INVALID; 81 | SUStringCreate(&instanceguid); 82 | SUComponentInstanceGetGuid(comp, &instanceguid); 83 | 84 | 85 | SUMaterialRef mat = SU_INVALID; 86 | SUDrawingElementGetMaterial(SUComponentInstanceToDrawingElement(comp), &mat); 87 | SUStringRef matNameRef = SU_INVALID; 88 | SUStringCreate(&matNameRef); 89 | SUMaterialGetName(mat, &matNameRef); 90 | System::String^ matName = SketchUpNET::Utilities::GetString(matNameRef); 91 | SketchUpNET::Material^ groupMat = (materials->ContainsKey(matName)) ? materials[matName] : SketchUpNET::Material::FromSU(mat); 92 | 93 | 94 | // Layer 95 | SULayerRef layer = SU_INVALID; 96 | SUDrawingElementGetLayer(SUComponentInstanceToDrawingElement(comp), &layer); 97 | 98 | System::String^ layername = gcnew System::String(""); 99 | if (!SUIsInvalid(layer)) 100 | { 101 | layername = Utilities::GetLayerName(layer); 102 | } 103 | 104 | SUStringRef guid = SU_INVALID; 105 | SUStringCreate(&guid); 106 | SUComponentDefinitionGetGuid(definition, &guid); 107 | System::String^ guidstring = SketchUpNET::Utilities::GetString(guid); 108 | 109 | String^ parent = guidstring; 110 | 111 | 112 | SUTransformation transform = SU_INVALID; 113 | SUComponentInstanceGetTransform(comp, &transform); 114 | 115 | 116 | Instance^ v = gcnew Instance(SketchUpNET::Utilities::GetString(name), SketchUpNET::Utilities::GetString(instanceguid), parent, Transform::FromSU(transform), layername, groupMat); 117 | 118 | return v; 119 | }; 120 | static List^ GetEntityInstances(SUEntitiesRef entities, System::Collections::Generic::Dictionary^ materials) 121 | { 122 | List^ instancelist = gcnew List(); 123 | 124 | //Get All Component Instances 125 | 126 | size_t instanceCount = 0; 127 | SUEntitiesGetNumInstances(entities, &instanceCount); 128 | 129 | if (instanceCount > 0) { 130 | std::vector instances(instanceCount); 131 | SUEntitiesGetInstances(entities, instanceCount, &instances[0], &instanceCount); 132 | 133 | for (size_t i = 0; i < instanceCount; i++) { 134 | Instance^ inst = Instance::FromSU(instances[i], materials); 135 | instancelist->Add(inst); 136 | } 137 | 138 | } 139 | 140 | return instancelist; 141 | } 142 | }; 143 | 144 | 145 | } -------------------------------------------------------------------------------- /SketchUpNET/Instance.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a managed C++ Wrapper for the SketchUp C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Instance.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Layer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include "Utilities.h" 37 | 38 | 39 | using namespace System; 40 | using namespace System::Collections; 41 | using namespace System::Collections::Generic; 42 | 43 | namespace SketchUpNET 44 | { 45 | public ref class Layer 46 | { 47 | public: 48 | System::String^ Name; 49 | 50 | Layer(System::String^ name) 51 | { 52 | this->Name = name; 53 | }; 54 | 55 | Layer(){}; 56 | internal: 57 | static Layer^ FromSU(SULayerRef layer) 58 | { 59 | Layer^ v = gcnew Layer(SketchUpNET::Utilities::GetLayerName(layer)); 60 | 61 | return v; 62 | }; 63 | 64 | }; 65 | 66 | 67 | } -------------------------------------------------------------------------------- /SketchUpNET/Layer.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Layer.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Loop.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include "edge.h" 37 | 38 | using namespace System; 39 | using namespace System::Collections; 40 | using namespace System::Collections::Generic; 41 | 42 | namespace SketchUpNET 43 | { 44 | public ref class Loop 45 | { 46 | public: 47 | List^ Edges; 48 | 49 | Loop(List^ corners) 50 | { 51 | this->Edges = corners; 52 | }; 53 | 54 | Loop(){}; 55 | internal: 56 | static Loop^ FromSU(SULoopRef loop) 57 | { 58 | 59 | List^ edgelist = gcnew List(); 60 | 61 | size_t num_vertices; 62 | SULoopGetNumVertices(loop, &num_vertices); 63 | if (num_vertices > 0) { 64 | std::vector edges(num_vertices); 65 | SULoopGetEdges(loop, num_vertices, &edges[0], &num_vertices); 66 | for (size_t i = 0; i < num_vertices; i++) { 67 | SUEdgeRef edge = edges[i]; 68 | edgelist->Add(Edge::FromSU(edge)); 69 | } 70 | } 71 | 72 | Loop^ v = gcnew Loop(edgelist); 73 | 74 | return v; 75 | }; 76 | 77 | 78 | }; 79 | 80 | 81 | } -------------------------------------------------------------------------------- /SketchUpNET/Loop.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Loop.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Material.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #pragma once 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include "loop.h" 37 | #include "vertex.h" 38 | #include "vector.h" 39 | #include "utilities.h" 40 | #include "Color.h" 41 | #include "Texture.h" 42 | 43 | using namespace System; 44 | using namespace System::Collections; 45 | using namespace System::Collections::Generic; 46 | 47 | namespace SketchUpNET 48 | { 49 | public ref class Material 50 | { 51 | public: 52 | 53 | Color^ Colour; 54 | System::String^ Name; 55 | double Opacity; 56 | bool UseOpacity; 57 | bool UsesColor; 58 | bool UsesTexture; 59 | Texture^ MaterialTexture; 60 | 61 | Material( System::String^ name, Color^ color, bool useOpacity, double opacity, bool usesColor, bool usesTexture, Texture^ texture) 62 | { 63 | this->Colour = color; 64 | this->Name = name; 65 | this->Opacity = opacity; 66 | this->UseOpacity = useOpacity; 67 | this->UsesColor = usesColor; 68 | this->UsesTexture = usesTexture; 69 | this->MaterialTexture = texture; 70 | }; 71 | 72 | Material() { 73 | this->Name = ""; 74 | this->Colour = gcnew Color(0, 0, 0, 0); 75 | this->Opacity = 0; 76 | this->UseOpacity = false; 77 | this->UsesColor = true; 78 | this->UsesTexture = false; 79 | this->MaterialTexture = gcnew Texture(); 80 | }; 81 | 82 | virtual String^ ToString() override 83 | { 84 | return this->Name; 85 | } 86 | 87 | internal: 88 | 89 | 90 | static Material^ FromSU(SUMaterialRef material) 91 | { 92 | SUStringRef name = SU_INVALID; 93 | SUStringCreate(&name); 94 | SUMaterialGetName(material, &name); 95 | String^ n = SketchUpNET::Utilities::GetString(name); 96 | 97 | 98 | bool useopacity = false; 99 | SUMaterialGetUseOpacity(material, &useopacity); 100 | 101 | SUColor color = SU_INVALID; 102 | SUMaterialGetColor(material, &color); 103 | 104 | SUMaterialType type = SUMaterialType::SUMaterialType_Colored; 105 | SUMaterialGetType(material, &type); 106 | 107 | SUTextureRef texture = SU_INVALID; 108 | SUMaterialGetTexture(material, &texture); 109 | Texture^ txtr = Texture::FromSU(texture); 110 | 111 | bool usesColor = false; 112 | bool usesTexture = false; 113 | 114 | if (type == SUMaterialType::SUMaterialType_Colored) 115 | { 116 | usesColor = true; 117 | usesTexture = false; 118 | } 119 | 120 | if (type == SUMaterialType::SUMaterialType_ColorizedTexture) 121 | { 122 | usesColor = true; 123 | usesTexture = true; 124 | } 125 | 126 | if (type == SUMaterialType::SUMaterialType_Textured) 127 | { 128 | usesColor = false; 129 | usesTexture = true; 130 | } 131 | 132 | double opacity = 0; 133 | SUMaterialGetOpacity(material, &opacity); 134 | 135 | Color^ c = Color::FromSU(color); 136 | 137 | Material^ v = gcnew Material(n, c, useopacity, opacity, usesColor, usesTexture, txtr); 138 | 139 | return v; 140 | } 141 | 142 | 143 | }; 144 | 145 | 146 | } -------------------------------------------------------------------------------- /SketchUpNET/Material.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Material.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Mesh.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include "loop.h" 39 | #include "vertex.h" 40 | #include "vector.h" 41 | #include "utilities.h" 42 | #include "MeshFace.h" 43 | 44 | 45 | using namespace System; 46 | using namespace System::Collections; 47 | using namespace System::Collections::Generic; 48 | 49 | namespace SketchUpNET 50 | { 51 | public ref class Mesh 52 | { 53 | public: 54 | 55 | List^ Vertices; 56 | List^ Normals; 57 | List^ Faces; 58 | 59 | System::String^ Layer; 60 | 61 | Mesh(List^ vs, List^ ns, List^ faces, System::String^ layer) 62 | { 63 | this->Vertices = vs; 64 | this->Normals = ns; 65 | this->Faces = faces; 66 | this->Layer = layer; 67 | }; 68 | 69 | Mesh() {}; 70 | internal: 71 | 72 | 73 | 74 | static Mesh^ FromSU(SUFaceRef face) 75 | { 76 | List^ vertices = gcnew List(); 77 | List^ vectors = gcnew List(); 78 | List^ faces = gcnew List(); 79 | 80 | // Layer 81 | SULayerRef layer = SU_INVALID; 82 | SUDrawingElementGetLayer(SUFaceToDrawingElement(face), &layer); 83 | 84 | System::String^ layername = gcnew System::String(""); 85 | if (!SUIsInvalid(layer)) 86 | { 87 | layername = Utilities::GetLayerName(layer); 88 | } 89 | 90 | SUMeshHelperRef helper = SU_INVALID; 91 | SUMeshHelperCreate(&helper, face); 92 | 93 | size_t vCount = 0; 94 | SUMeshHelperGetNumVertices(helper, &vCount); 95 | if (vCount > 0) 96 | { 97 | std::vector vs(vCount); 98 | SUMeshHelperGetVertices(helper,vCount, &vs[0], &vCount); 99 | 100 | for (size_t j = 0; j < vCount; j++) 101 | { 102 | vertices->Add(Vertex::FromSU(vs[j])); 103 | } 104 | } 105 | 106 | 107 | 108 | size_t fCount = 0; 109 | size_t ret = 0; 110 | SUMeshHelperGetNumTriangles(helper, &fCount); 111 | if (fCount > 0) 112 | { 113 | 114 | std::vector fs(3 * fCount); 115 | SUMeshHelperGetVertexIndices(helper, 3*fCount, &fs[0], &ret); 116 | 117 | for (size_t j = 0; j < 3*fCount; j=j+3) 118 | { 119 | faces->Add(gcnew MeshFace(fs[j], fs[j+1], fs[j + 2])); 120 | } 121 | } 122 | 123 | 124 | size_t nCount = 0; 125 | SUMeshHelperGetNumTriangles(helper, &nCount); 126 | if (nCount > 0) 127 | { 128 | std::vector norms(nCount); 129 | SUMeshHelperGetNormals(helper, nCount, &norms[0], &nCount); 130 | 131 | for (size_t j = 0; j < nCount; j++) 132 | { 133 | vectors->Add(Vector::FromSU(norms[j])); 134 | } 135 | } 136 | 137 | SUMeshHelperRelease(&helper); 138 | 139 | Mesh^ m = gcnew Mesh(vertices,vectors, faces, layername); 140 | 141 | return m; 142 | } 143 | 144 | 145 | }; 146 | 147 | 148 | } -------------------------------------------------------------------------------- /SketchUpNET/Mesh.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Mesh.cpp" -------------------------------------------------------------------------------- /SketchUpNET/MeshFace.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | using namespace System; 33 | using namespace System::Collections; 34 | using namespace System::Collections::Generic; 35 | 36 | namespace SketchUpNET 37 | { 38 | public ref class MeshFace 39 | { 40 | public: 41 | 42 | int A; 43 | int B; 44 | int C; 45 | 46 | MeshFace(int a, int b, int c) 47 | { 48 | this->A = a; 49 | this->B = b; 50 | this->C = c; 51 | }; 52 | 53 | MeshFace() {}; 54 | 55 | }; 56 | 57 | 58 | } -------------------------------------------------------------------------------- /SketchUpNET/MeshFace.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "MeshFace.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Opening.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpSharp - a managed C++ Wrapper for the SketchUp C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | This program is free software : you can redistribute it and / or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program.If not, see . 18 | 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "Corner.h" 34 | #include "Layer.h" 35 | 36 | #pragma once 37 | 38 | using namespace System; 39 | using namespace System::Collections; 40 | using namespace System::Collections::Generic; 41 | 42 | namespace SketchUpSharp 43 | { 44 | public ref class Loop 45 | { 46 | public: 47 | 48 | System::Collections::Generic::List^ Corners; 49 | 50 | 51 | Loop(System::Collections::Generic::List^ corners) 52 | { 53 | this->Corners = corners; 54 | 55 | }; 56 | 57 | Loop(){}; 58 | internal: 59 | static Loop^ FromSU(SULoopRef loop) 60 | { 61 | System::Collections::Generic::List^ corners = gcnew System::Collections::Generic::List(); 62 | 63 | size_t edgeCount = 0; 64 | SULoop(opening, &edgeCount); 65 | if (edgeCount > 0) 66 | { 67 | std::vector edges(edgeCount); 68 | SUFaceGetEdges(face, edgeCount, &edges[0], &edgeCount); 69 | 70 | for (size_t j = 0; j < edgeCount; j++) 71 | { 72 | corners->Add(Corner::FromSU(edges[j])); 73 | } 74 | } 75 | 76 | 77 | size_t openingsCount = 0; 78 | SUFaceGetNumOpenings(face, &openingsCount); 79 | if (openingsCount > 0) 80 | { 81 | std::vector openings(openingsCount); 82 | SUFaceGetOpenings(face, openingsCount, &openings[0], &openingsCount); 83 | 84 | for (size_t j = 0; j < openingsCount; j++) 85 | { 86 | corners->Add(Corner::FromSU(openings[j])); 87 | } 88 | } 89 | 90 | Surface^ v = gcnew Surface(corners); 91 | 92 | return v; 93 | }; 94 | 95 | }; 96 | 97 | 98 | } -------------------------------------------------------------------------------- /SketchUpNET/SketchUpNET.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/SketchUpNET/SketchUpNET.rc -------------------------------------------------------------------------------- /SketchUpNET/SketchUpNET.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | 74 | 75 | Header Files 76 | 77 | 78 | Header Files 79 | 80 | 81 | Header Files 82 | 83 | 84 | Header Files 85 | 86 | 87 | Header Files 88 | 89 | 90 | Header Files 91 | 92 | 93 | Header Files 94 | 95 | 96 | Header Files 97 | 98 | 99 | Header Files 100 | 101 | 102 | Header Files 103 | 104 | 105 | Header Files 106 | 107 | 108 | Header Files 109 | 110 | 111 | Header Files 112 | 113 | 114 | Header Files 115 | 116 | 117 | Header Files 118 | 119 | 120 | Header Files 121 | 122 | 123 | Header Files 124 | 125 | 126 | Header Files 127 | 128 | 129 | 130 | 131 | Resource Files 132 | 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /SketchUpNET/Surface.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Surface.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Texture.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2018, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "loop.h" 38 | #include "vertex.h" 39 | #include "vector.h" 40 | #include "utilities.h" 41 | #include "Color.h" 42 | 43 | 44 | using namespace System; 45 | using namespace System::Collections; 46 | using namespace System::Collections::Generic; 47 | 48 | namespace SketchUpNET 49 | { 50 | public ref class Texture 51 | { 52 | public: 53 | 54 | Color ^ Colour; 55 | System::String^ Name; 56 | double Opacity; 57 | bool useAlpha; 58 | int Height; 59 | int Width; 60 | double ScaleH; 61 | double ScaleW; 62 | 63 | Texture(System::String^ name, Color^ color, bool useAlpha, int height, int width, double scaleH, double scaleW) 64 | { 65 | this->Colour = color; 66 | this->Name = name; 67 | this->useAlpha = useAlpha; 68 | this->Width = width; 69 | this->Height = height; 70 | this->ScaleH = scaleH; 71 | this->ScaleW = scaleW; 72 | }; 73 | 74 | Texture() { 75 | this->Name = ""; 76 | this->Colour = gcnew Color(0, 0, 0, 0); 77 | this->Opacity = 0; 78 | this->useAlpha = false; 79 | this->Width = 0; 80 | this->Height = 0; 81 | this->ScaleH = 0; 82 | this->ScaleW = 0; 83 | }; 84 | 85 | 86 | internal: 87 | 88 | 89 | static Texture^ FromSU(SUTextureRef texture) 90 | { 91 | SUStringRef name = SU_INVALID; 92 | SUStringCreate(&name); 93 | SUTextureGetFileName(texture, &name); 94 | String^ n = SketchUpNET::Utilities::GetString(name); 95 | 96 | 97 | bool usealphachannel = false; 98 | SUTextureGetUseAlphaChannel(texture, &usealphachannel); 99 | 100 | SUColor color = SU_INVALID; 101 | SUTextureGetAverageColor(texture, &color); 102 | 103 | Color^ c = Color::FromSU(color); 104 | 105 | size_t h = 0; 106 | size_t w = 0; 107 | double scaleh = 0; 108 | double scalew = 0; 109 | SUTextureGetDimensions(texture, &w, &h, &scalew, &scaleh); 110 | 111 | Texture^ v = gcnew Texture(n, c, usealphachannel, h,w,scaleh, scalew); 112 | 113 | return v; 114 | } 115 | 116 | 117 | }; 118 | 119 | 120 | } -------------------------------------------------------------------------------- /SketchUpNET/Texture.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2018, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Texture.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Transform.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "vertex.h" 38 | 39 | using namespace System; 40 | using namespace System::Collections; 41 | using namespace System::Collections::Generic; 42 | 43 | namespace SketchUpNET 44 | { 45 | public ref class Transform 46 | { 47 | public: 48 | 49 | Vertex^ GetTransformed(Vertex^ point) 50 | { 51 | 52 | Vertex^ transformedPoint = gcnew Vertex(point->X, point->Y, point->Z); 53 | 54 | double uniform_scale_factor = 1.0 / this->Scale; 55 | 56 | transformedPoint->X = (this->Data[0] * point->X) + (point->Y*this->Data[4]) + (point->Z*this->Data[8]) + this->Data[12]; 57 | transformedPoint->Y = (this->Data[1] * point->X) + (point->Y*this->Data[5]) + (point->Z*this->Data[9]) + this->Data[13]; 58 | transformedPoint->Z = (this->Data[2] * point->X) + (point->Y*this->Data[6]) + (point->Z*this->Data[10]) + this->Data[14]; 59 | 60 | transformedPoint->X = transformedPoint->X* this->Scale; 61 | transformedPoint->Y = transformedPoint->Y* this->Scale; 62 | transformedPoint->Z = transformedPoint->Z* this->Scale; 63 | 64 | return transformedPoint; 65 | } 66 | 67 | 68 | array^ Data; 69 | 70 | double Scale; 71 | double X; 72 | double Y; 73 | double Z; 74 | 75 | Transform(array^ data) 76 | { 77 | this->Data = data; 78 | this->Scale = data[15]; 79 | this->Z = data[14]; 80 | this->Y = data[13]; 81 | this->X = data[12]; 82 | 83 | }; 84 | 85 | Transform(){}; 86 | internal: 87 | static Transform^ FromSU(SUTransformation transformation) 88 | { 89 | double* data = transformation.values; 90 | 91 | array^ ar = gcnew array(16); 92 | for (int i = 0; i < 16; i++) 93 | if (i == 12 || i==13 ||i==14) 94 | ar[i] = data[i] * 0.0254; 95 | else 96 | ar[i] = data[i]; 97 | 98 | Transform^ v = gcnew Transform(ar); 99 | 100 | return v; 101 | 102 | }; 103 | 104 | }; 105 | 106 | 107 | } -------------------------------------------------------------------------------- /SketchUpNET/Transform.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Transform.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Utilities.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | using namespace System; 35 | using namespace System::Collections; 36 | using namespace System::Collections::Generic; 37 | 38 | namespace SketchUpNET 39 | { 40 | public class Utilities 41 | { 42 | public: 43 | 44 | static System::String^ GetLayerName(SULayerRef layer) 45 | { 46 | SUStringRef layername = SU_INVALID; 47 | SUStringCreate(&layername); 48 | SULayerGetName(layer, &layername); 49 | System::String^ name = GetString(layername); 50 | 51 | return name; 52 | } 53 | 54 | 55 | static System::String^ GetString(SUStringRef name) 56 | { 57 | size_t name_length = 0; 58 | SUStringGetUTF8Length(name, &name_length); 59 | if (name_length == 0) return System::String::Empty; 60 | 61 | char* name_utf8 = new char[name_length +1]; 62 | SUStringGetUTF8(name, name_length+1, name_utf8, &name_length); 63 | 64 | return gcnew System::String(name_utf8, 0, name_length, System::Text::Encoding::UTF8); 65 | } 66 | 67 | static const char* ToString(System::String^ value) 68 | { 69 | array^ bytes = System::Text::Encoding::UTF8->GetBytes(value); 70 | char* result = new char[bytes->Length + 1]; 71 | result[bytes->Length] = 0; 72 | int i = 0; 73 | for each(unsigned char c in bytes) { 74 | result[i++] = c; 75 | } 76 | return result; 77 | } 78 | 79 | 80 | 81 | 82 | 83 | }; 84 | 85 | 86 | 87 | 88 | } -------------------------------------------------------------------------------- /SketchUpNET/Utilities.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Utilities.cpp" -------------------------------------------------------------------------------- /SketchUpNET/Vector.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | using namespace System; 37 | using namespace System::Collections; 38 | using namespace System::Collections::Generic; 39 | 40 | namespace SketchUpNET 41 | { 42 | public ref class Vector 43 | { 44 | public: 45 | 46 | double X; 47 | double Y; 48 | double Z; 49 | 50 | /// 51 | /// Creates a new vector 52 | /// 53 | /// 54 | /// 55 | /// 56 | Vector(double x, double y, double z) 57 | { 58 | this->X = x; 59 | this->Y = y; 60 | this->Z = z; 61 | }; 62 | 63 | Vector(){}; 64 | internal: 65 | static Vector^ FromSU(SUVector3D vec) 66 | { 67 | Vector^ v = gcnew Vector(vec.x, vec.y, vec.z); 68 | 69 | return v; 70 | }; 71 | 72 | SUVector3D ToSU() 73 | { 74 | SUVector3D point = { this->X, this->Y, this->Z }; 75 | return point; 76 | } 77 | 78 | }; 79 | 80 | 81 | } -------------------------------------------------------------------------------- /SketchUpNET/Vector.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Vector.cpp" 22 | 23 | -------------------------------------------------------------------------------- /SketchUpNET/Vertex.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | using namespace System; 33 | using namespace System::Collections; 34 | using namespace System::Collections::Generic; 35 | 36 | namespace SketchUpNET 37 | { 38 | public ref class Vertex 39 | { 40 | public: 41 | 42 | double X; 43 | double Y; 44 | double Z; 45 | 46 | /// 47 | /// Creates a new vertex 48 | /// 49 | /// 50 | /// 51 | /// 52 | Vertex(double x, double y, double z) 53 | { 54 | this->X = x; 55 | this->Y = y; 56 | this->Z = z; 57 | }; 58 | 59 | /// 60 | /// Creates a new vertex on z=0 61 | /// 62 | /// 63 | /// 64 | Vertex(double x, double y) { 65 | this->X = x; 66 | this->Y = y; 67 | this->Z = 0; 68 | }; 69 | 70 | Vertex(){}; 71 | internal: 72 | static Vertex^ FromSU(SUPoint3D point) 73 | { 74 | Vertex^ v = gcnew Vertex(point.x* 0.0254, point.y* 0.0254, point.z* 0.0254); 75 | 76 | return v; 77 | }; 78 | 79 | SUPoint3D ToSU() 80 | { 81 | SUPoint3D point = { this->X * 39.3701, this->Y* 39.3701, this->Z* 39.3701 }; 82 | return point; 83 | } 84 | 85 | }; 86 | 87 | 88 | } -------------------------------------------------------------------------------- /SketchUpNET/Vertex.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SketchUpNET - a C++ Wrapper for the Trimble(R) SketchUp(R) C API 4 | Copyright(C) 2015, Autor: Maximilian Thumfart 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 7 | and associated documentation files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | */ 21 | #include "Vertex.cpp" 22 | 23 | -------------------------------------------------------------------------------- /SketchUpNET/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by SketchUpNET.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /SketchUpNETConsole/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SketchUpNETConsole/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SketchUpNETConsole 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | if (args.Length > 0) 14 | { 15 | SketchUpNET.SketchUp skp = new SketchUpNET.SketchUp(); 16 | if (skp.LoadModel(args[0])) 17 | { 18 | // do something 19 | } 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SketchUpNETConsole/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SketchUpNETConsole")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SketchUpNETConsole")] 13 | [assembly: AssemblyCopyright("Copyright © 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("22367ebd-aacb-4494-b909-40fc5e83fcac")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SketchUpNETConsole/SketchUpNETConsole.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {22367EBD-AACB-4494-B909-40FC5E83FCAC} 8 | Exe 9 | SketchUpNETConsole 10 | SketchUpNETConsole 11 | v4.5.2 12 | 512 13 | true 14 | 15 | 16 | x64 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | false 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | sketchup.lib 52 | 53 | 54 | SketchUpAPI.lib 55 | Always 56 | 57 | 58 | 59 | 60 | 61 | {1c4d4501-eb39-45c8-bed0-609a978e823f} 62 | SketchUpNET 63 | 64 | 65 | 66 | 67 | SketchUpAPI.dll 68 | Always 69 | 70 | 71 | SketchUpCommonPreferences.dll 72 | Always 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Testfiles/NewFile.skp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Testfiles/NewFile.skp -------------------------------------------------------------------------------- /Testfiles/TestDefinition.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Testfiles/TestDefinition.gh -------------------------------------------------------------------------------- /Testfiles/TestModel.skb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Testfiles/TestModel.skb -------------------------------------------------------------------------------- /Testfiles/TestModel.skp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Testfiles/TestModel.skp -------------------------------------------------------------------------------- /Testfiles/TestModel~.skp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Testfiles/TestModel~.skp -------------------------------------------------------------------------------- /Testfiles/Überß.skp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moethu/SketchUpNET/eed3cd9a734ec6a3ed66a28a9f85d1d1d6b325e0/Testfiles/Überß.skp --------------------------------------------------------------------------------