scriptup 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +11 -0
  3. data/README.md +5 -0
  4. data/ext/attribute_dictionaries.c +45 -0
  5. data/ext/attribute_dictionaries.h +3 -0
  6. data/ext/attribute_dictionary.c +156 -0
  7. data/ext/attribute_dictionary.h +3 -0
  8. data/ext/behavior.c +10 -0
  9. data/ext/behavior.h +3 -0
  10. data/ext/color.c +211 -0
  11. data/ext/color.h +3 -0
  12. data/ext/component_definition.c +188 -0
  13. data/ext/component_definition.h +3 -0
  14. data/ext/component_instance.c +10 -0
  15. data/ext/component_instance.h +3 -0
  16. data/ext/definition_list.c +145 -0
  17. data/ext/definition_list.h +3 -0
  18. data/ext/drawing_element.c +10 -0
  19. data/ext/drawing_element.h +3 -0
  20. data/ext/entities.c +11 -0
  21. data/ext/entities.h +3 -0
  22. data/ext/entity.c +253 -0
  23. data/ext/entity.h +3 -0
  24. data/ext/extconf.rb +38 -0
  25. data/ext/material.c +242 -0
  26. data/ext/material.h +3 -0
  27. data/ext/materials.c +80 -0
  28. data/ext/materials.h +3 -0
  29. data/ext/model.c +42 -0
  30. data/ext/model.h +3 -0
  31. data/ext/sketchup.c +89 -0
  32. data/ext/sketchup.h +4 -0
  33. data/ext/texture.c +9 -0
  34. data/ext/texture.h +3 -0
  35. data/ext/typed_value.c +84 -0
  36. data/ext/typed_value.h +5 -0
  37. data/ext/utils.h +80 -0
  38. data/lib/sketchup.rb +12 -0
  39. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/application.h +36 -0
  40. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/model.h +59 -0
  41. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/overlay.h +248 -0
  42. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/ruby_api.h +118 -0
  43. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/color.h +107 -0
  44. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/common.h +178 -0
  45. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/defs.h +19 -0
  46. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/extension_license.h +62 -0
  47. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/bounding_box.h +34 -0
  48. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/plane3d.h +153 -0
  49. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point2d.h +96 -0
  50. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point3d.h +98 -0
  51. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/ray3d.h +64 -0
  52. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation.h +321 -0
  53. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation2d.h +163 -0
  54. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector2d.h +235 -0
  55. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector3d.h +285 -0
  56. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry.h +152 -0
  57. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelexporterplugin.h +165 -0
  58. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelimporterplugin.h +183 -0
  59. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/pluginprogresscallback.h +84 -0
  60. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/initialize.h +43 -0
  61. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/length_formatter.h +424 -0
  62. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/arccurve.h +244 -0
  63. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/arrow_type.h +17 -0
  64. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/attribute_dictionary.h +161 -0
  65. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/axes.h +242 -0
  66. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/camera.h +398 -0
  67. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classification_attribute.h +89 -0
  68. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classification_info.h +125 -0
  69. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/classifications.h +86 -0
  70. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_definition.h +588 -0
  71. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_instance.h +344 -0
  72. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/curve.h +143 -0
  73. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/defs.h +142 -0
  74. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension.h +222 -0
  75. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_linear.h +421 -0
  76. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_radial.h +194 -0
  77. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension_style.h +253 -0
  78. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/drawing_element.h +198 -0
  79. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dynamic_component_attribute.h +92 -0
  80. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dynamic_component_info.h +70 -0
  81. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge.h +271 -0
  82. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge_use.h +214 -0
  83. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entities.h +834 -0
  84. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity.h +186 -0
  85. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity_list.h +80 -0
  86. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity_list_iterator.h +90 -0
  87. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/face.h +686 -0
  88. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/font.h +138 -0
  89. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry.h +20 -0
  90. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry_input.h +685 -0
  91. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/group.h +244 -0
  92. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/guide_line.h +155 -0
  93. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/guide_point.h +153 -0
  94. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image.h +288 -0
  95. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image_rep.h +275 -0
  96. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/instancepath.h +266 -0
  97. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer.h +265 -0
  98. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer_folder.h +301 -0
  99. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/line_style.h +211 -0
  100. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/line_styles.h +81 -0
  101. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/location.h +65 -0
  102. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/loop.h +182 -0
  103. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/material.h +390 -0
  104. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/mesh_helper.h +187 -0
  105. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model.h +1663 -0
  106. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model_version.h +49 -0
  107. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/opening.h +72 -0
  108. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/options_manager.h +79 -0
  109. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/options_provider.h +166 -0
  110. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/polyline3d.h +140 -0
  111. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/rendering_options.h +179 -0
  112. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/scene.h +836 -0
  113. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/schema.h +56 -0
  114. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/schema_type.h +26 -0
  115. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/section_plane.h +212 -0
  116. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/selection.h +156 -0
  117. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/shadow_info.h +147 -0
  118. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/skp.h +45 -0
  119. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/style.h +303 -0
  120. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/styles.h +190 -0
  121. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/text.h +384 -0
  122. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture.h +358 -0
  123. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture_writer.h +280 -0
  124. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/typed_value.h +390 -0
  125. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/uv_helper.h +79 -0
  126. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/vertex.h +154 -0
  127. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup.h +122 -0
  128. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup_info.h +65 -0
  129. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/slapi.h +16 -0
  130. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/transformation.h +16 -0
  131. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/unicodestring.h +239 -0
  132. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/utils/math_helpers.h +124 -0
  133. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonGeometry.dylib +0 -0
  134. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonGeoutils.dylib +0 -0
  135. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonImage.dylib +0 -0
  136. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonPreferences.dylib +0 -0
  137. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonUnits.dylib +0 -0
  138. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonUtils.dylib +0 -0
  139. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonZip.dylib +0 -0
  140. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Resources/Info.plist +50 -0
  141. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/SketchUpAPI +0 -0
  142. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/_CodeSignature/CodeResources +835 -0
  143. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpAPI.dll +0 -0
  144. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpAPI.lib +0 -0
  145. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpCommonPreferences.dll +0 -0
  146. data/sketchup-sdk-win/binaries/sketchup/x64/sketchup.lib +0 -0
  147. data/sketchup-sdk-win/headers/SketchUpAPI/application/application.h +36 -0
  148. data/sketchup-sdk-win/headers/SketchUpAPI/application/model.h +59 -0
  149. data/sketchup-sdk-win/headers/SketchUpAPI/application/overlay.h +248 -0
  150. data/sketchup-sdk-win/headers/SketchUpAPI/application/ruby_api.h +118 -0
  151. data/sketchup-sdk-win/headers/SketchUpAPI/color.h +107 -0
  152. data/sketchup-sdk-win/headers/SketchUpAPI/common.h +178 -0
  153. data/sketchup-sdk-win/headers/SketchUpAPI/defs.h +19 -0
  154. data/sketchup-sdk-win/headers/SketchUpAPI/extension_license.h +62 -0
  155. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/bounding_box.h +34 -0
  156. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/plane3d.h +153 -0
  157. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point2d.h +96 -0
  158. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point3d.h +98 -0
  159. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/ray3d.h +64 -0
  160. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation.h +321 -0
  161. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation2d.h +163 -0
  162. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector2d.h +235 -0
  163. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector3d.h +285 -0
  164. data/sketchup-sdk-win/headers/SketchUpAPI/geometry.h +152 -0
  165. data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelexporterplugin.h +165 -0
  166. data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelimporterplugin.h +183 -0
  167. data/sketchup-sdk-win/headers/SketchUpAPI/import_export/pluginprogresscallback.h +84 -0
  168. data/sketchup-sdk-win/headers/SketchUpAPI/initialize.h +43 -0
  169. data/sketchup-sdk-win/headers/SketchUpAPI/length_formatter.h +424 -0
  170. data/sketchup-sdk-win/headers/SketchUpAPI/model/arccurve.h +244 -0
  171. data/sketchup-sdk-win/headers/SketchUpAPI/model/arrow_type.h +17 -0
  172. data/sketchup-sdk-win/headers/SketchUpAPI/model/attribute_dictionary.h +161 -0
  173. data/sketchup-sdk-win/headers/SketchUpAPI/model/axes.h +242 -0
  174. data/sketchup-sdk-win/headers/SketchUpAPI/model/camera.h +398 -0
  175. data/sketchup-sdk-win/headers/SketchUpAPI/model/classification_attribute.h +89 -0
  176. data/sketchup-sdk-win/headers/SketchUpAPI/model/classification_info.h +125 -0
  177. data/sketchup-sdk-win/headers/SketchUpAPI/model/classifications.h +86 -0
  178. data/sketchup-sdk-win/headers/SketchUpAPI/model/component_definition.h +588 -0
  179. data/sketchup-sdk-win/headers/SketchUpAPI/model/component_instance.h +344 -0
  180. data/sketchup-sdk-win/headers/SketchUpAPI/model/curve.h +143 -0
  181. data/sketchup-sdk-win/headers/SketchUpAPI/model/defs.h +142 -0
  182. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension.h +222 -0
  183. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_linear.h +421 -0
  184. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_radial.h +194 -0
  185. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension_style.h +253 -0
  186. data/sketchup-sdk-win/headers/SketchUpAPI/model/drawing_element.h +198 -0
  187. data/sketchup-sdk-win/headers/SketchUpAPI/model/dynamic_component_attribute.h +92 -0
  188. data/sketchup-sdk-win/headers/SketchUpAPI/model/dynamic_component_info.h +70 -0
  189. data/sketchup-sdk-win/headers/SketchUpAPI/model/edge.h +271 -0
  190. data/sketchup-sdk-win/headers/SketchUpAPI/model/edge_use.h +214 -0
  191. data/sketchup-sdk-win/headers/SketchUpAPI/model/entities.h +834 -0
  192. data/sketchup-sdk-win/headers/SketchUpAPI/model/entity.h +186 -0
  193. data/sketchup-sdk-win/headers/SketchUpAPI/model/entity_list.h +80 -0
  194. data/sketchup-sdk-win/headers/SketchUpAPI/model/entity_list_iterator.h +90 -0
  195. data/sketchup-sdk-win/headers/SketchUpAPI/model/face.h +686 -0
  196. data/sketchup-sdk-win/headers/SketchUpAPI/model/font.h +138 -0
  197. data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry.h +20 -0
  198. data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry_input.h +685 -0
  199. data/sketchup-sdk-win/headers/SketchUpAPI/model/group.h +244 -0
  200. data/sketchup-sdk-win/headers/SketchUpAPI/model/guide_line.h +155 -0
  201. data/sketchup-sdk-win/headers/SketchUpAPI/model/guide_point.h +153 -0
  202. data/sketchup-sdk-win/headers/SketchUpAPI/model/image.h +288 -0
  203. data/sketchup-sdk-win/headers/SketchUpAPI/model/image_rep.h +275 -0
  204. data/sketchup-sdk-win/headers/SketchUpAPI/model/instancepath.h +266 -0
  205. data/sketchup-sdk-win/headers/SketchUpAPI/model/layer.h +265 -0
  206. data/sketchup-sdk-win/headers/SketchUpAPI/model/layer_folder.h +301 -0
  207. data/sketchup-sdk-win/headers/SketchUpAPI/model/line_style.h +211 -0
  208. data/sketchup-sdk-win/headers/SketchUpAPI/model/line_styles.h +81 -0
  209. data/sketchup-sdk-win/headers/SketchUpAPI/model/location.h +65 -0
  210. data/sketchup-sdk-win/headers/SketchUpAPI/model/loop.h +182 -0
  211. data/sketchup-sdk-win/headers/SketchUpAPI/model/material.h +390 -0
  212. data/sketchup-sdk-win/headers/SketchUpAPI/model/mesh_helper.h +187 -0
  213. data/sketchup-sdk-win/headers/SketchUpAPI/model/model.h +1663 -0
  214. data/sketchup-sdk-win/headers/SketchUpAPI/model/model_version.h +49 -0
  215. data/sketchup-sdk-win/headers/SketchUpAPI/model/opening.h +72 -0
  216. data/sketchup-sdk-win/headers/SketchUpAPI/model/options_manager.h +79 -0
  217. data/sketchup-sdk-win/headers/SketchUpAPI/model/options_provider.h +166 -0
  218. data/sketchup-sdk-win/headers/SketchUpAPI/model/polyline3d.h +140 -0
  219. data/sketchup-sdk-win/headers/SketchUpAPI/model/rendering_options.h +179 -0
  220. data/sketchup-sdk-win/headers/SketchUpAPI/model/scene.h +836 -0
  221. data/sketchup-sdk-win/headers/SketchUpAPI/model/schema.h +56 -0
  222. data/sketchup-sdk-win/headers/SketchUpAPI/model/schema_type.h +26 -0
  223. data/sketchup-sdk-win/headers/SketchUpAPI/model/section_plane.h +212 -0
  224. data/sketchup-sdk-win/headers/SketchUpAPI/model/selection.h +156 -0
  225. data/sketchup-sdk-win/headers/SketchUpAPI/model/shadow_info.h +147 -0
  226. data/sketchup-sdk-win/headers/SketchUpAPI/model/skp.h +45 -0
  227. data/sketchup-sdk-win/headers/SketchUpAPI/model/style.h +303 -0
  228. data/sketchup-sdk-win/headers/SketchUpAPI/model/styles.h +190 -0
  229. data/sketchup-sdk-win/headers/SketchUpAPI/model/text.h +384 -0
  230. data/sketchup-sdk-win/headers/SketchUpAPI/model/texture.h +358 -0
  231. data/sketchup-sdk-win/headers/SketchUpAPI/model/texture_writer.h +280 -0
  232. data/sketchup-sdk-win/headers/SketchUpAPI/model/typed_value.h +390 -0
  233. data/sketchup-sdk-win/headers/SketchUpAPI/model/uv_helper.h +79 -0
  234. data/sketchup-sdk-win/headers/SketchUpAPI/model/vertex.h +154 -0
  235. data/sketchup-sdk-win/headers/SketchUpAPI/sketchup.h +122 -0
  236. data/sketchup-sdk-win/headers/SketchUpAPI/sketchup_info.h +65 -0
  237. data/sketchup-sdk-win/headers/SketchUpAPI/slapi.h +16 -0
  238. data/sketchup-sdk-win/headers/SketchUpAPI/transformation.h +16 -0
  239. data/sketchup-sdk-win/headers/SketchUpAPI/unicodestring.h +239 -0
  240. data/sketchup-sdk-win/headers/SketchUpAPI/utils/math_helpers.h +124 -0
  241. metadata +313 -0
@@ -0,0 +1,1663 @@
1
+ // Copyright 2013-2020 Trimble Inc Ltd. All Rights Reserved.
2
+
3
+ /**
4
+ * @file
5
+ * @brief Interfaces for SUModelRef.
6
+ */
7
+ #ifndef SKETCHUP_MODEL_MODEL_H_
8
+ #define SKETCHUP_MODEL_MODEL_H_
9
+
10
+ #include <SketchUpAPI/common.h>
11
+ #include <SketchUpAPI/unicodestring.h>
12
+ #include <SketchUpAPI/model/defs.h>
13
+ #include <SketchUpAPI/model/model_version.h>
14
+
15
+ #pragma pack(push, 8)
16
+
17
+ #if defined(__APPLE__)
18
+ // This is added to remove the missing declarations warning on the mac
19
+ // for an enum defined inside a structure. [SUEntityType]
20
+ #pragma GCC diagnostic push
21
+ #pragma GCC diagnostic ignored "-Wmissing-declarations"
22
+ #endif
23
+
24
+ #ifdef __cplusplus
25
+ extern "C" {
26
+ #endif
27
+
28
+ /**
29
+ @struct SUModelRef
30
+ @brief A SketchUp model.
31
+ */
32
+
33
+ /**
34
+ @struct SUModelStatistics
35
+ @brief Contains an array of entity counts that can be indexed per entity type.
36
+ */
37
+ struct SUModelStatistics {
38
+ /**
39
+ @enum SUEntityType
40
+ @brief Types of \ref SUEntityRef objects.
41
+ */
42
+ enum SUEntityType {
43
+ SUEntityType_Edge = 0, ///< SUEdgeRef entities
44
+ SUEntityType_Face, ///< SUFaceRef entities
45
+ SUEntityType_ComponentInstance, ///< SUComponentInstanceRef entities
46
+ SUEntityType_Group, ///< SUGroupRef entities
47
+ SUEntityType_Image, ///< SUImageRef entities
48
+ SUEntityType_ComponentDefinition, ///< SUComponentDefinitionRef entities
49
+ SUEntityType_Layer, ///< SULayerRef entities
50
+ SUEntityType_Material, ///< SUMaterialRef entities
51
+ SUNumEntityTypes ///< Number of entity types
52
+ };
53
+ int entity_counts[SUNumEntityTypes]; ///< Count of each entity type.
54
+ };
55
+
56
+ /**
57
+ @enum SUModelUnits
58
+ @brief Units options settings
59
+ */
60
+ enum SUModelUnits {
61
+ SUModelUnits_Inches,
62
+ SUModelUnits_Feet,
63
+ SUModelUnits_Millimeters,
64
+ SUModelUnits_Centimeters,
65
+ SUModelUnits_Meters
66
+ };
67
+
68
+ /**
69
+ @enum SUModelLoadStatus
70
+ @brief Provides additional status information after loading a model successfully.
71
+ @since SketchUp 2021, API 9.0
72
+ */
73
+ enum SUModelLoadStatus {
74
+ SUModelLoadStatus_Success = 0, ///< Model was loaded successfully.
75
+ SUModelLoadStatus_Success_MoreRecent ///< Model was loaded successfully,
76
+ ///< however it was saved by a newer
77
+ ///< version of SketchUp. We strongly
78
+ ///< recommended that you update your SDK
79
+ ///< to the latest version.
80
+ };
81
+
82
+ /**
83
+ @brief Creates an empty model object for the purposes of writing a SketchUp
84
+ document. This model object must be released with \ref SUModelRelease().
85
+ @param[out] model The model object created.
86
+ @related SUModelRef
87
+ @return
88
+ - \ref SU_ERROR_NONE on success
89
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if model is NULL
90
+ - \ref SU_ERROR_OVERWRITE_VALID if model is already a valid object
91
+ */
92
+ SU_RESULT SUModelCreate(SUModelRef* model);
93
+
94
+ /**
95
+ @brief Creates a model from a SketchUp file on local disk. This model object
96
+ must be released with \ref SUModelRelease().
97
+ @deprecated This method will be removed in SketchUp 2022.0. It is replaced by
98
+ SUModelCreateFromFileWithStatus() which can read models
99
+ saved by newer versions of SketchUp.
100
+ @param[out] model The model object created.
101
+ @param[in] file_path The source file path of the SketchUp file. Assumed to be
102
+ UTF-8 encoded.
103
+ @related SUModelRef
104
+ @return
105
+ - \ref SU_ERROR_NONE on success
106
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p file_path is NULL
107
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p model is NULL
108
+ - \ref SU_ERROR_OVERWRITE_VALID if \p model is already a valid object
109
+ - \ref SU_ERROR_SERIALIZATION if an error occurs during reading of the file
110
+ - \ref SU_ERROR_MODEL_INVALID if the file specified by \p file_path is an
111
+ invalid model. (since SketchUp 2014, API 2.0)
112
+ - \ref SU_ERROR_MODEL_VERSION if the model file has a newer version
113
+ than is supported by the current build of the SDK. (since SketchUp 2014, API 2.0)
114
+ */
115
+ SU_DEPRECATED_FUNCTION("SketchUp API 9.0")
116
+ SU_RESULT SUModelCreateFromFile(SUModelRef* model, const char* file_path);
117
+
118
+ /**
119
+ @brief Creates a model from a SketchUp file on local disk. This model object
120
+ must be released with \ref SUModelRelease().
121
+ @since SketchUp 2021, API 9.0
122
+
123
+ @note As of SketchUp 2021.0, SketchUp can open .skp files created with newer versions of SketchUp.
124
+ However, opening newer versions with an older SDK might omit model data. Use the load
125
+ \p status value to check if the file was created with a newer version of SketchUp.
126
+
127
+ @warning When reading a file created with a newer version of SketchUp, you may lose data
128
+ if you write over the same file.
129
+
130
+ @param[out] model The model object created.
131
+ @param[in] file_path The source file path of the SketchUp file. Assumed to be
132
+ UTF-8 encoded.
133
+ @param[out] status Returns additional information on the status of a
134
+ successful operation. Valid when the return value is
135
+ \ref SU_ERROR_NONE.
136
+ @related SUModelRef
137
+ @return
138
+ - \ref SU_ERROR_NONE on success
139
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p file_path is NULL
140
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p model is NULL
141
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p status is NULL
142
+ - \ref SU_ERROR_OVERWRITE_VALID if \p model is already a valid object
143
+ - \ref SU_ERROR_SERIALIZATION if an error occurs during reading of the file
144
+ - \ref SU_ERROR_MODEL_INVALID if the file specified by \p file_path is an
145
+ invalid model.
146
+ - \ref SU_ERROR_MODEL_VERSION if the model file has a newer version
147
+ than is supported by the current build of the SDK.
148
+ */
149
+ SU_RESULT SUModelCreateFromFileWithStatus(
150
+ SUModelRef* model, const char* file_path, enum SUModelLoadStatus* status);
151
+
152
+ /**
153
+ @brief Creates a model from a SketchUp skp file buffer. This model object must
154
+ be released with \ref SUModelRelease().
155
+ @since SketchUp 2017 M2, API 5.2
156
+ @deprecated This method will be removed in SketchUp 2022.0. It is replaced by
157
+ SUModelCreateFromBufferWithStatus() which can read models saved by newer
158
+ versions of SketchUp.
159
+ @param[out] model The model object created.
160
+ @param[in] buffer The SketchUp file buffer.
161
+ @param[in] buffer_size The SketchUp file buffer size.
162
+ @related SUModelRef
163
+ @return
164
+ - \ref SU_ERROR_NONE on success
165
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p buffer is NULL
166
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p model is NULL
167
+ - \ref SU_ERROR_OVERWRITE_VALID if \p model is already a valid object
168
+ - \ref SU_ERROR_SERIALIZATION if an error occurs during reading of the file
169
+ - \ref SU_ERROR_MODEL_INVALID if the file specified by \p buffer is an
170
+ invalid model.
171
+ - \ref SU_ERROR_MODEL_VERSION if the model buffer has a newer version
172
+ than is supported by the current build of the SDK.
173
+ */
174
+ SU_DEPRECATED_FUNCTION("SketchUp API 9.0")
175
+ SU_RESULT SUModelCreateFromBuffer(
176
+ SUModelRef* model, const unsigned char* buffer, size_t buffer_size);
177
+
178
+ /**
179
+ @brief Creates a model from a SketchUp skp file buffer. This model object must
180
+ be released with \ref SUModelRelease().
181
+ @since SketchUp 2021, API 9.0
182
+
183
+ @note As of SketchUp 2021.0, SketchUp can open .skp files created with newer versions of SketchUp.
184
+ However, opening newer versions with an older SDK might omit model data. Use the load
185
+ \p status value to check if the file was created with a newer version of SketchUp.
186
+
187
+ @warning When reading a file created with a newer version of SketchUp, you may lose data
188
+ if you write over the same file.
189
+
190
+ @param[out] model The model object created.
191
+ @param[in] buffer The SketchUp file buffer.
192
+ @param[in] buffer_size The SketchUp file buffer size.
193
+ @param[out] status Returns additional information on the status of a
194
+ successful operation. Valid when the return value is
195
+ \ref SU_ERROR_NONE.
196
+ @related SUModelRef
197
+ @return
198
+ - \ref SU_ERROR_NONE on success
199
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p buffer is NULL
200
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p model is NULL
201
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p status is NULL
202
+ - \ref SU_ERROR_OVERWRITE_VALID if model is already a valid object
203
+ - \ref SU_ERROR_SERIALIZATION if an error occurs during reading of the file
204
+ - \ref SU_ERROR_MODEL_INVALID if the file specified by \p buffer is an invalid
205
+ model.
206
+ - \ref SU_ERROR_MODEL_VERSION if the model buffer has a newer version
207
+ than is supported by the current build of the SDK.
208
+ */
209
+ SU_RESULT SUModelCreateFromBufferWithStatus(
210
+ SUModelRef* model, const unsigned char* buffer, size_t buffer_size,
211
+ enum SUModelLoadStatus* status);
212
+
213
+ /**
214
+ @brief Releases a model object and its associated resources. The root component
215
+ of the model object and all its child objects must not be released
216
+ explicitly
217
+ @param[in] model The model object.
218
+ @related SUModelRef
219
+ @return
220
+ - \ref SU_ERROR_NONE on success
221
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
222
+ - \ref SU_ERROR_NULL_POINTER_INPUT if model is NULL
223
+ */
224
+ SU_RESULT SUModelRelease(SUModelRef* model);
225
+
226
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
227
+ /**
228
+ @brief Returns a model reference for a given internal model representation.
229
+ This model object must NOT be released with \ref SUModelRelease().
230
+ @param[in] data Internal model representation.
231
+ @related SUModelRef
232
+ @return The created model reference.
233
+ */
234
+ SU_EXPORT SUModelRef SUModelFromExisting(uintptr_t data);
235
+ #endif // DOXYGEN_SHOULD_SKIP_THIS
236
+
237
+ /**
238
+ @brief Retrieves the root model entities.
239
+ @param[in] model The model object.
240
+ @param[out] entities The entities retrieved.
241
+ @related SUModelRef
242
+ @return
243
+ - \ref SU_ERROR_NONE on success
244
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
245
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if entities is NULL
246
+ */
247
+ SU_RESULT SUModelGetEntities(SUModelRef model, SUEntitiesRef* entities);
248
+
249
+ /**
250
+ @brief Retrieves the model entities of the active context
251
+ (open group or component).
252
+ @since SketchUp 2020.2, API 8.2
253
+ @param[in] model The model object.
254
+ @param[out] entities The entities retrieved.
255
+ @related SUModelRef
256
+ @return
257
+ - \ref SU_ERROR_NONE on success
258
+ - \ref SU_ERROR_INVALID_INPUT if \p model is an invalid object
259
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p entities is `NULL`
260
+ */
261
+ SU_RESULT SUModelGetActiveEntities(SUModelRef model, SUEntitiesRef* entities);
262
+
263
+ /**
264
+ @brief Retrieves the instance path of the active context
265
+ (open group or component).
266
+ @note This method only works from within the SketchUp application.
267
+ @param[in] model The model object.
268
+ @param[out] instance_path The instance path retrieved. This must be released to
269
+ avoid memory leak.
270
+ @related SUModelRef
271
+ @return
272
+ - \ref SU_ERROR_NONE on success
273
+ - \ref SU_ERROR_INVALID_INPUT if \p model is an invalid object
274
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p instance_path is `NULL`
275
+ - \ref SU_ERROR_OVERWRITE_VALID if \p instance_path is already a valid object
276
+ - \ref SU_ERROR_NO_DATA if there is no active path open.
277
+ - \ref SU_ERROR_NO_DATA if this isn't called from within SketchUp
278
+ */
279
+ SU_RESULT SUModelGetActivePath(SUModelRef model, SUInstancePathRef* instance_path);
280
+
281
+ /**
282
+ @brief Retrieves the number of materials in a model object.
283
+ @param[in] model The model object.
284
+ @param[out] count The number of material objects available.
285
+ @related SUModelRef
286
+ @return
287
+ - \ref SU_ERROR_NONE on success
288
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
289
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
290
+ */
291
+ SU_RESULT SUModelGetNumMaterials(SUModelRef model, size_t* count);
292
+
293
+ /**
294
+ @brief Retrieves all the materials associated with a model object.
295
+ @param[in] model The model object.
296
+ @param[in] len The number of material objects to retrieve.
297
+ @param[out] materials The material objects retrieved.
298
+ @param[out] count The number of material objects retrieved.
299
+ @related SUModelRef
300
+ @return
301
+ - \ref SU_ERROR_NONE on success
302
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
303
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if materials or count is NULL
304
+ */
305
+ SU_RESULT SUModelGetMaterials(
306
+ SUModelRef model, size_t len, SUMaterialRef materials[], size_t* count);
307
+
308
+ /**
309
+ @brief Adds materials to a model object. Note that the materials cannot be
310
+ already owned.
311
+ @param[in] model The model object.
312
+ @param[in] len The number of material objects to add.
313
+ @param[in] materials The array of material objects to add.
314
+ @related SUModelRef
315
+ @return
316
+ - \ref SU_ERROR_NONE on success
317
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
318
+ - \ref SU_ERROR_NULL_POINTER_INPUT if materials is NULL
319
+ - \ref SU_ERROR_PARTIAL_SUCCESS if any of the materials are already owned
320
+ */
321
+ SU_RESULT SUModelAddMaterials(SUModelRef model, size_t len, const SUMaterialRef materials[]);
322
+
323
+ /**
324
+ @brief Loads a material from a SKM file.
325
+
326
+ If a matching material exists in the model it will be returned instead.
327
+
328
+ @since SketchUp 2021.1, API 9.1
329
+ @param[in] model The model object.
330
+ @param[in] file_path The location to load the material from. Assumed to be
331
+ UTF-8 encoded.
332
+ @param[out] material The material object.
333
+ @related SUMaterialRef
334
+ @return
335
+ - \ref SU_ERROR_NONE on success
336
+ - \ref SU_ERROR_INVALID_INPUT if \p model is not a valid object
337
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p file_path is NULL
338
+ - \ref SU_ERROR_OVERWRITE_VALID if \p material is already a valid object
339
+ - \ref SU_ERROR_SERIALIZATION if the serialization operation itself fails
340
+ */
341
+ SU_RESULT SUModelLoadMaterial(SUModelRef model, const char* file_path, SUMaterialRef* material);
342
+
343
+ /**
344
+ @brief Retrieves the number of components associated with a model.
345
+ @param[in] model The model object.
346
+ @param[out] count The number of components available.
347
+ @related SUModelRef
348
+ @return
349
+ - \ref SU_ERROR_NONE on success
350
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
351
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
352
+ */
353
+ SU_RESULT SUModelGetNumComponentDefinitions(SUModelRef model, size_t* count);
354
+
355
+ /**
356
+ @brief Retrieves the component definitions that define component instances but
357
+ not groups.
358
+ @param[in] model The model object.
359
+ @param[in] len The number of component definitions to retrieve.
360
+ @param[out] definitions The component definitions retrieved.
361
+ @param[out] count The number of component definitions retrieved.
362
+ @related SUModelRef
363
+ @return
364
+ - \ref SU_ERROR_NONE on success
365
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
366
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if definitions or count is NULL
367
+ */
368
+ SU_RESULT SUModelGetComponentDefinitions(
369
+ SUModelRef model, size_t len, SUComponentDefinitionRef definitions[], size_t* count);
370
+
371
+ /**
372
+ @brief Retrieves the number of component definitions that define groups.
373
+ @since SketchUp 2016, API 4.0
374
+ @param[in] model The model object.
375
+ @param[out] count The number of component definitions available.
376
+ @related SUModelRef
377
+ @return
378
+ - \ref SU_ERROR_NONE on success
379
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
380
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
381
+ */
382
+ SU_RESULT SUModelGetNumGroupDefinitions(SUModelRef model, size_t* count);
383
+
384
+ /**
385
+ @brief Retrieves the component definitions that define groups.
386
+ @since SketchUp 2016, API 4.0
387
+ @param[in] model The model object.
388
+ @param[in] len The number of component definitions to retrieve.
389
+ @param[out] definitions The component definitions retrieved.
390
+ @param[out] count The number of component definitions retrieved.
391
+ @related SUModelRef
392
+ @return
393
+ - \ref SU_ERROR_NONE on success
394
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
395
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if definitions or count is NULL
396
+ */
397
+ SU_RESULT SUModelGetGroupDefinitions(
398
+ SUModelRef model, size_t len, SUComponentDefinitionRef definitions[], size_t* count);
399
+
400
+ /**
401
+ @brief Retrieves the number of component definitions that define images.
402
+ @since SketchUp 2019, API 7.0
403
+ @param[in] model The model object.
404
+ @param[out] count The number of component definitions available.
405
+ @related SUModelRef
406
+ @return
407
+ - \ref SU_ERROR_NONE on success
408
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
409
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
410
+ */
411
+ SU_RESULT SUModelGetNumImageDefinitions(SUModelRef model, size_t* count);
412
+
413
+ /**
414
+ @brief Retrieves the component definitions that define images.
415
+ @since SketchUp 2019, API 7.0
416
+ @param[in] model The model object.
417
+ @param[in] len The number of component definitions to retrieve.
418
+ @param[out] definitions The component definitions retrieved.
419
+ @param[out] count The number of component definitions retrieved.
420
+ @related SUModelRef
421
+ @return
422
+ - \ref SU_ERROR_NONE on success
423
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
424
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if definitions or count is NULL
425
+ */
426
+ SU_RESULT SUModelGetImageDefinitions(
427
+ SUModelRef model, size_t len, SUComponentDefinitionRef definitions[], size_t* count);
428
+
429
+ /**
430
+ @brief Adds component definitions to a model object.
431
+ @param[in] model The model object.
432
+ @param[in] len The number of component definitions to add.
433
+ @param[in] components The array of component definitions to add.
434
+ @related SUModelRef
435
+ @return
436
+ - \ref SU_ERROR_NONE on success
437
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
438
+ - \ref SU_ERROR_NULL_POINTER_INPUT if components is NULL
439
+ */
440
+ SU_RESULT SUModelAddComponentDefinitions(
441
+ SUModelRef model, size_t len, const SUComponentDefinitionRef components[]);
442
+
443
+ /**
444
+ @brief Remove definitions of components, images, and groups from a model object.
445
+ All component definitions, their geometry, and attached instances will be
446
+ released.
447
+ @since SketchUp 2019.2, API 7.1
448
+ @param[in] model The model object.
449
+ @param[in] len The number of component definitions to remove.
450
+ @param[in] components The array of component definitions to remove.
451
+ @related SUModelRef
452
+ @return
453
+ - \ref SU_ERROR_NONE on success
454
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
455
+ - \ref SU_ERROR_OUT_OF_RANGE if the number of components is less than one
456
+ - \ref SU_ERROR_NULL_POINTER_INPUT if components is NULL
457
+ - \ref SU_ERROR_PARTIAL_SUCCESS if removing a component definition fails
458
+ mid-process
459
+ */
460
+ SU_RESULT SUModelRemoveComponentDefinitions(
461
+ SUModelRef model, size_t len, SUComponentDefinitionRef components[]);
462
+
463
+ /**
464
+ @brief Saves the model to a file.
465
+ @note Prior to SketchUp 2019.2, API 7.1 this function did not generate a new
466
+ model GUID.
467
+ @param[in] model The model object.
468
+ @param[in] file_path The file path destination of the serialization operation.
469
+ Assumed to be UTF-8 encoded.
470
+ @related SUModelRef
471
+ @return
472
+ - \ref SU_ERROR_NONE on success
473
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
474
+ - \ref SU_ERROR_NULL_POINTER_INPUT if file_path is NULL
475
+ - \ref SU_ERROR_SERIALIZATION if the serialization operation itself fails
476
+ */
477
+ SU_RESULT SUModelSaveToFile(SUModelRef model, const char* file_path);
478
+
479
+ /**
480
+ @brief Saves the model to a file using a specific SketchUp version format.
481
+ @note Prior to SketchUp 2019.2, API 7.1 this function did not generate a new
482
+ model GUID.
483
+ @since SketchUp 2014, API 2.0
484
+ @param[in] model The model object.
485
+ @param[in] file_path The file path destination of the serialization operation.
486
+ Assumed to be UTF-8 encoded.
487
+ @param[in] version The SKP file format version to use when saving.
488
+ @related SUModelRef
489
+ @return
490
+ - \ref SU_ERROR_NONE on success
491
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
492
+ - \ref SU_ERROR_MODEL_VERSION if version is invalid
493
+ - \ref SU_ERROR_NULL_POINTER_INPUT if file_path is NULL
494
+ - \ref SU_ERROR_SERIALIZATION if the serialization operation itself fails
495
+ */
496
+ SU_RESULT SUModelSaveToFileWithVersion(
497
+ SUModelRef model, const char* file_path, enum SUModelVersion version);
498
+
499
+ /**
500
+ @brief Retrieves the camera of a model object. The returned camera object
501
+ points to model's internal camera. So it must not be released via
502
+ SUCameraRelease().
503
+ @param[in] model The model object.
504
+ @param[out] camera The camera object retrieved.
505
+ @related SUModelRef
506
+ @return
507
+ - \ref SU_ERROR_NONE on success
508
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
509
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if camera is NULL
510
+ */
511
+ SU_RESULT SUModelGetCamera(SUModelRef model, SUCameraRef* camera);
512
+
513
+ /**
514
+ @brief Sets the current camera of a model object.
515
+ @since SketchUp 2016, API 4.0
516
+ @param[in] model The model object.
517
+ @param[in] camera The camera object. This reference will become invalid when
518
+ this function returns.
519
+ @related SUModelRef
520
+ @return
521
+ - \ref SU_ERROR_NONE on success
522
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
523
+ - \ref SU_ERROR_INVALID_INPUT if camera is not a valid object
524
+ - \ref SU_ERROR_NULL_POINTER_INPUT if camera is NULL
525
+ */
526
+ SU_RESULT SUModelSetCamera(SUModelRef model, SUCameraRef* camera);
527
+
528
+ /**
529
+ @brief Retrieves the number of scene cameras of a model object.
530
+ @param[in] model The model object.
531
+ @param[out] num_scenes The number of scenes available.
532
+ @related SUModelRef
533
+ @return
534
+ - \ref SU_ERROR_NONE on success
535
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
536
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if num_scenes is NULL
537
+ */
538
+ SU_RESULT SUModelGetNumScenes(SUModelRef model, size_t* num_scenes);
539
+
540
+ /**
541
+ @brief Retrieves the number of layers in a model object.
542
+ @note This counts all layers regardless of whether or not they are contained
543
+ in a \ref SULayerFolderRef.
544
+ @param[in] model The model object.
545
+ @param[out] count The number of layers available.
546
+ @related SUModelRef
547
+ @see SUModelGetNumTopLevelLayers()
548
+ @return
549
+ - \ref SU_ERROR_NONE on success
550
+ - \ref SU_ERROR_INVALID_INPUT of model is not a valid object
551
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
552
+ */
553
+ SU_RESULT SUModelGetNumLayers(SUModelRef model, size_t* count);
554
+
555
+ /**
556
+ @brief Retrieves the layers in a model object.
557
+ @note This retrieves all layers regardless of whether or not they are contained
558
+ in a \ref SULayerFolderRef.
559
+ @param[in] model The model object.
560
+ @param[in] len The number of layers to retrieve.
561
+ @param[out] layers The layers retrieved.
562
+ @param[out] count The number of layers retrieved.
563
+ @related SUModelRef
564
+ @see SUModelGetTopLevelLayers()
565
+ @return
566
+ - \ref SU_ERROR_NONE on success
567
+ - \ref SU_ERROR_INVALID_INPUT of model is not a valid object
568
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if layers or count is NULL
569
+ */
570
+ SU_RESULT SUModelGetLayers(SUModelRef model, size_t len, SULayerRef layers[], size_t* count);
571
+
572
+ /**
573
+ @brief Adds layer objects to a model object.
574
+ @param[in] model The model object.
575
+ @param[in] len The number of layers to add.
576
+ @param[in] layers The layers to add.
577
+ @related SUModelRef
578
+ @return
579
+ - \ref SU_ERROR_NONE on success
580
+ - \ref SU_ERROR_INVALID_INPUT of model is not a valid object
581
+ - \ref SU_ERROR_INVALID_INPUT if any item in layers is not a valid object
582
+ */
583
+ SU_RESULT SUModelAddLayers(SUModelRef model, size_t len, const SULayerRef layers[]);
584
+
585
+ /**
586
+ @brief Retrieves the default layer object of a model object.
587
+ @param[in] model The model object.
588
+ @param[out] layer The layer object retrieved.
589
+ @related SUModelRef
590
+ @return
591
+ - \ref SU_ERROR_NONE on success
592
+ - \ref SU_ERROR_INVALID_INPUT of model is not a valid object
593
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if layer is NULL
594
+ */
595
+ SU_RESULT SUModelGetDefaultLayer(SUModelRef model, SULayerRef* layer);
596
+
597
+ /**
598
+ @brief Removes all layers provided in the array. The default layer cannot be
599
+ removed. All entities on the deleted layers will be moved to the default layer.
600
+ @since SketchUp 2019.2 API 7.1
601
+ @param[in] model The model object.
602
+ @param[in] len The length of the array.
603
+ @param[in] layers The layers to be deleted.
604
+ @related SUModelRef
605
+ @return
606
+ - \ref SU_ERROR_NONE on success
607
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
608
+ - \ref SU_ERROR_NULL_POINTER_INPUT if layers is NULL
609
+ - \ref SU_ERROR_OUT_OF_RANGE if len is less than one.
610
+ - \ref SU_ERROR_PARTIAL_SUCCESS if removing the layers failed mid-process
611
+ */
612
+ SU_RESULT SUModelRemoveLayers(SUModelRef model, size_t len, SULayerRef layers[]);
613
+
614
+ /**
615
+ @brief Retrieves the active layer object of a model object.
616
+ @since SketchUp 2020, API 8.0
617
+ @param[in] model The model object.
618
+ @param[out] layer The layer object retrieved.
619
+ @related SUModelRef
620
+ @return
621
+ - \ref SU_ERROR_NONE on success
622
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
623
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if layer is NULL
624
+ */
625
+ SU_RESULT SUModelGetActiveLayer(SUModelRef model, SULayerRef* layer);
626
+
627
+ /**
628
+ @brief Sets the active layer object of a model object.
629
+ @since SketchUp 2020, API 8.0
630
+ @param[in] model The model object.
631
+ @param[in] layer The layer object to be set as the active layer.
632
+ @related SUModelRef
633
+ @return
634
+ - \ref SU_ERROR_NONE on success
635
+ - \ref SU_ERROR_INVALID_ARGUMENT if layer doesn't belong to model
636
+ - \ref SU_ERROR_INVALID_INPUT if model or layer is not a valid object
637
+ */
638
+ SU_RESULT SUModelSetActiveLayer(SUModelRef model, SULayerRef layer);
639
+
640
+ /**
641
+ @brief Retrieves the version of a model object. The version consists of three
642
+ numbers: major version number, minor version number, and the build number.
643
+ @param[in] model The model object.
644
+ @param[out] major The major version number retrieved.
645
+ @param[out] minor The minor version number retrieved.
646
+ @param[out] build The build version number retrieved.
647
+ @related SUModelRef
648
+ @return
649
+ - \ref SU_ERROR_NONE on success
650
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
651
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if major, minor, or build is NULL
652
+ */
653
+ SU_RESULT SUModelGetVersion(SUModelRef model, int* major, int* minor, int* build);
654
+
655
+ /**
656
+ @brief Retrieves the number of attribute dictionaries of a model object.
657
+ @param[in] model The model object.
658
+ @param[out] count The number of attribute dictionaries available.
659
+ @related SUModelRef
660
+ @return
661
+ - \ref SU_ERROR_NONE on success
662
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
663
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
664
+ */
665
+ SU_RESULT SUModelGetNumAttributeDictionaries(SUModelRef model, size_t* count);
666
+
667
+ /**
668
+ @brief Retrieves the attribute dictionaries of a model object.
669
+ @param[in] model The model object.
670
+ @param[in] len The number of attribute dictionaries to retrieve.
671
+ @param[out] dictionaries The dictionaries retrieved.
672
+ @param[out] count The number of attribute dictionaries retrieved.
673
+ @related SUModelRef
674
+ @return
675
+ - \ref SU_ERROR_NONE on success
676
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
677
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if dictionaries or count is NULL
678
+ */
679
+ SU_RESULT SUModelGetAttributeDictionaries(
680
+ SUModelRef model, size_t len, SUAttributeDictionaryRef dictionaries[], size_t* count);
681
+
682
+ /**
683
+ @brief Retrieves the attribute dictionary of a model object that has the given
684
+ name. If a dictionary with the given name does not exist, one is added
685
+ to the model object.
686
+ @param[in] model The model object.
687
+ @param[in] name The name of the attribute dictionary to retrieve. Assumed
688
+ to be UTF-8 encoded.
689
+ @param[out] dictionary The dictionary object retrieved.
690
+ @related SUModelRef
691
+ @return
692
+ - \ref SU_ERROR_NONE on success
693
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
694
+ - \ref SU_ERROR_NULL_POINTER_INPUT if name is NULL
695
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if dictionary is NULL
696
+ */
697
+ SU_RESULT SUModelGetAttributeDictionary(
698
+ SUModelRef model, const char* name, SUAttributeDictionaryRef* dictionary);
699
+
700
+ /**
701
+ @brief Retrieves whether the model is georeferenced.
702
+ @since SketchUp 2017, API 5.0
703
+ @param[in] model The model object.
704
+ @param[out] is_geo_ref The flag retrieved.
705
+ @related SUModelRef
706
+ @return
707
+ - \ref SU_ERROR_NONE on success
708
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
709
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if is_used is NULL
710
+ */
711
+ SU_RESULT SUModelIsGeoReferenced(SUModelRef model, bool* is_geo_ref);
712
+
713
+ /**
714
+ @brief Retrieves the location information of a given model.
715
+ @param[in] model The model object.
716
+ @param[out] location The location retrieved.
717
+ @related SUModelRef
718
+ @return
719
+ - \ref SU_ERROR_NONE on success
720
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
721
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if location is NULL
722
+ */
723
+ SU_RESULT SUModelGetLocation(SUModelRef model, SULocationRef* location);
724
+
725
+ /**
726
+ @brief Calculates the sum of all entities by type in the model.
727
+ @param[in] model The model object.
728
+ @param[out] statistics The SUModelStatistics() struct that will be populated
729
+ with the number of each entity type in the model.
730
+ @related SUModelRef
731
+ @return
732
+ - \ref SU_ERROR_NONE on success
733
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
734
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if statistics is NULL
735
+ */
736
+ SU_RESULT SUModelGetStatistics(SUModelRef model, struct SUModelStatistics* statistics);
737
+
738
+ /**
739
+ @brief Georeferences the model.
740
+ @param[in] model The model object.
741
+ @param[in] latitude Latitude of the model.
742
+ @param[in] longitude Longitude of the model.
743
+ @param[in] altitude Altitude of the model.
744
+ @param[in] is_z_value_centered Indicates if z value should be centered.
745
+ @param[in] is_on_ocean_floor Indicates whether the model is on the ocean
746
+ floor.
747
+ @related SUModelRef
748
+ @return
749
+ - \ref SU_ERROR_NONE on success
750
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object or if latitude or
751
+ longitude does not lie within a valid range
752
+ */
753
+ SU_RESULT SUModelSetGeoReference(
754
+ SUModelRef model, double latitude, double longitude, double altitude, bool is_z_value_centered,
755
+ bool is_on_ocean_floor);
756
+
757
+ /**
758
+ @brief Retrieves the rendering options of a model object.
759
+ @param[in] model The model object.
760
+ @param[out] rendering_options The rendering options object retrieved. This
761
+ object is owned by the model and must not be
762
+ explicitly released.
763
+ @related SUModelRef
764
+ @return
765
+ - \ref SU_ERROR_NONE on success
766
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
767
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if rendering_options is NULL
768
+ - \ref SU_ERROR_NO_DATA if no rendering options is available
769
+ */
770
+ SU_RESULT SUModelGetRenderingOptions(SUModelRef model, SURenderingOptionsRef* rendering_options);
771
+
772
+ /**
773
+ @brief Retrieves the shadow info of a model object.
774
+ @since SketchUp 2015, API 3.0
775
+ @param[in] model The model object.
776
+ @param[out] shadow_info The shadow info object retrieved. This object is owned
777
+ by the model and must not be explicitly released.
778
+ @related SUModelRef
779
+ @return
780
+ - \ref SU_ERROR_NONE on success
781
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
782
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if shadow_info is NULL
783
+ - \ref SU_ERROR_NO_DATA if no shadow info is available
784
+ */
785
+ SU_RESULT SUModelGetShadowInfo(SUModelRef model, SUShadowInfoRef* shadow_info);
786
+
787
+ /**
788
+ @brief Retrieves options manager associated with the model.
789
+ @param[in] model The model object.
790
+ @param[out] options_manager The options manager object retrieved.
791
+ @related SUModelRef
792
+ @return
793
+ - \ref SU_ERROR_NONE on success
794
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
795
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if options_manager is NULL
796
+ */
797
+ SU_RESULT SUModelGetOptionsManager(SUModelRef model, SUOptionsManagerRef* options_manager);
798
+
799
+ /**
800
+ @brief Retrieves the angle which will rotate the north direction to the y-axis
801
+ for a given model.
802
+ @param[in] model The model object.
803
+ @param[out] north_correction The north correction angle retrieved (in degrees).
804
+ @related SUModelRef
805
+ @return
806
+ - \ref SU_ERROR_NONE on success
807
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
808
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if north_angle is NULL
809
+ */
810
+ SU_RESULT SUModelGetNorthCorrection(SUModelRef model, double* north_correction);
811
+
812
+ /**
813
+ @brief Merges all adjacent, coplanar faces in the model.
814
+ @param[in] model The model object.
815
+ @related SUModelRef
816
+ @return
817
+ - \ref SU_ERROR_NONE on success
818
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid
819
+ */
820
+ SU_RESULT SUModelMergeCoplanarFaces(SUModelRef model);
821
+
822
+ /**
823
+ @brief Retrieves all the scenes associated with a model object.
824
+ @param[in] model The model object.
825
+ @param[in] len The number of scene objects to retrieve.
826
+ @param[out] scenes The scene objects retrieved.
827
+ @param[out] count The number of scene objects retrieved.
828
+ @related SUModelRef
829
+ @return
830
+ - \ref SU_ERROR_NONE on success
831
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
832
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if scenes or count is NULL
833
+ - \ref SU_ERROR_OVERWRITE_VALID if any element of scenes is already a valid
834
+ object
835
+ - \ref SU_ERROR_NO_DATA if there are no scene objects to retrieve.
836
+ */
837
+ SU_RESULT SUModelGetScenes(SUModelRef model, size_t len, SUSceneRef scenes[], size_t* count);
838
+
839
+ /**
840
+ @brief Retrieves the scenes with the given name associated with a model object.
841
+ @param[in] model The model object.
842
+ @param[in] name The name of scene object to retrieve.
843
+ @param[out] scene The scene object retrieved.
844
+ @related SUModelRef
845
+ @return
846
+ - \ref SU_ERROR_NONE on success
847
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
848
+ - \ref SU_ERROR_NULL_POINTER_INPUT if name is NULL
849
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if scene is NULL
850
+ - \ref SU_ERROR_NO_DATA if there are no scene objects to retrieve.
851
+ */
852
+ SU_RESULT SUModelGetSceneWithName(SUModelRef model, const char* name, SUSceneRef* scene);
853
+
854
+ /**
855
+ @brief Adds scenes to a model object.
856
+
857
+ @warning Breaking Change: The behavior of SUModelAddScenes changed in
858
+ SketchUp SDK 2018 API 6.0 to return SU_ERROR_INVALID_ARGUMENT if at
859
+ least one scene name already exists in the model or if there are
860
+ duplicated names in the scenes array.
861
+
862
+ @param[in] model The model object.
863
+ @param[in] len The number of scene objects to add.
864
+ @param[in] scenes The array of scene objects to add.
865
+ @related SUModelRef
866
+ @return
867
+ - \ref SU_ERROR_NONE on success
868
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
869
+ - \ref SU_ERROR_NULL_POINTER_INPUT if scenes is NULL
870
+ - \ref SU_ERROR_INVALID_ARGUMENT if the names of the given scenes are not unique
871
+ among themselves or among existing scenes
872
+ */
873
+ SU_RESULT SUModelAddScenes(SUModelRef model, size_t len, const SUSceneRef scenes[]);
874
+
875
+ /**
876
+ @brief Adds scenes to a model object.
877
+
878
+ @warning Breaking Change: The behavior of SUModelAddScene changed in
879
+ SketchUp SDK 2018 API 6.0 to return SU_ERROR_INVALID_ARGUMENT if the
880
+ given scene name already exists in the model.
881
+
882
+ @param[in] model The model object.
883
+ @param[in] index Where in the list to add the scene. -1 to place at the end.
884
+ @param[in] scene The scene object to add.
885
+ @param[out] out_index The index that the scene was added at.
886
+ @related SUModelRef
887
+ @return
888
+ - \ref SU_ERROR_NONE on success
889
+ - \ref SU_ERROR_INVALID_INPUT if model or scene are not a valid object
890
+ - \ref SU_ERROR_INVALID_ARGUMENT if a scene with the same name already exists
891
+ */
892
+ SU_RESULT SUModelAddScene(SUModelRef model, int index, SUSceneRef scene, int* out_index);
893
+
894
+ /**
895
+ @brief Retrieves the active scene associated with a model object.
896
+ @since SketchUp 2016, API 4.0
897
+ @param[in] model The model object.
898
+ @param[out] scene The scene object retrieved.
899
+ @related SUModelRef
900
+ @return
901
+ - \ref SU_ERROR_NONE on success
902
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
903
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if scene is NULL
904
+ - \ref SU_ERROR_OVERWRITE_VALID if scene is already a valid object
905
+ - \ref SU_ERROR_NO_DATA if there is no active scene to retrieve
906
+ */
907
+ SU_RESULT SUModelGetActiveScene(SUModelRef model, SUSceneRef* scene);
908
+
909
+ /**
910
+ @brief Sets the provided scene as the active scene.
911
+ @since SketchUp 2016, API 4.0
912
+ @param[in] model The model object.
913
+ @param[in] scene The scene object to be set as the active scene.
914
+ @related SUModelRef
915
+ @return
916
+ - \ref SU_ERROR_NONE on success
917
+ - \ref SU_ERROR_INVALID_INPUT if model or scene is not a valid object
918
+ - \ref SU_ERROR_GENERIC if try to activate a scene which is not in the model
919
+ */
920
+ SU_RESULT SUModelSetActiveScene(SUModelRef model, SUSceneRef scene);
921
+
922
+ /**
923
+ @brief Adds a single matched photo scene to a model object.
924
+ @since SketchUp 2015, API 3.0
925
+ @param[in] model The model object.
926
+ @param[in] image_file The full path of the image associated with this scene.
927
+ @param[in] camera The camera associated with this scene.
928
+ @param[in] scene_name The name of the scene to add.
929
+ @param[out] scene The scene object created.
930
+ @related SUModelRef
931
+ @return
932
+ - \ref SU_ERROR_NONE on success
933
+ - \ref SU_ERROR_INVALID_INPUT if model or camera is not a valid object
934
+ - \ref SU_ERROR_NULL_POINTER_INPUT if scene_name or image_file is NULL
935
+ - \ref SU_ERROR_INVALID_OUTPUT if scene is NULL
936
+ - \ref SU_ERROR_GENERIC if image_file is invalid or not found
937
+ */
938
+ SU_RESULT SUModelAddMatchPhotoScene(
939
+ SUModelRef model, const char* image_file, SUCameraRef camera, const char* scene_name,
940
+ SUSceneRef* scene);
941
+
942
+ /**
943
+ @brief Retrieves the name of a model object.
944
+ @param[in] model The model object.
945
+ @param[out] name The destination of the retrieved name object.
946
+ @related SUModelRef
947
+ @return
948
+ - \ref SU_ERROR_NONE on success
949
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
950
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if name is NULL
951
+ - \ref SU_ERROR_INVALID_OUTPUT if name does not point to a valid \ref
952
+ SUStringRef object
953
+ */
954
+ SU_RESULT SUModelGetName(SUModelRef model, SUStringRef* name);
955
+
956
+ /**
957
+ @brief Sets the name of a model object.
958
+ @param[in] model The model object.
959
+ @param[in] name The name of the model object. Assumed to be UTF-8 encoded.
960
+ @related SUModelRef
961
+ @return
962
+ - \ref SU_ERROR_NONE on success
963
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
964
+ - \ref SU_ERROR_NULL_POINTER_INPUT if name is NULL
965
+ */
966
+ SU_RESULT SUModelSetName(SUModelRef model, const char* name);
967
+
968
+ /**
969
+ @brief Retrieves the file path of a model object.
970
+ @since SketchUp 2018, API 6.0
971
+ @param[in] model The model object.
972
+ @param[out] path The destination of the retrieved path object.
973
+ @related SUModelRef
974
+ @return
975
+ - \ref SU_ERROR_NONE on success
976
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
977
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if path is NULL
978
+ - \ref SU_ERROR_INVALID_OUTPUT if path does not point to a valid \ref
979
+ SUStringRef object
980
+ */
981
+ SU_RESULT SUModelGetPath(SUModelRef model, SUStringRef* path);
982
+
983
+ /**
984
+ @brief Retrieves the title of a model object.
985
+ @since SketchUp 2018, API 6.0
986
+ @param[in] model The model object.
987
+ @param[out] title The destination of the retrieved title object.
988
+ @related SUModelRef
989
+ @return
990
+ - \ref SU_ERROR_NONE on success
991
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
992
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if title is NULL
993
+ - \ref SU_ERROR_INVALID_OUTPUT if title does not point to a valid \ref
994
+ SUStringRef object
995
+ */
996
+ SU_RESULT SUModelGetTitle(SUModelRef model, SUStringRef* title);
997
+
998
+ /**
999
+ @brief Retrieves the description of a model object.
1000
+ @param[in] model The model object.
1001
+ @param[out] description The destination of the retrieved description object.
1002
+ @related SUModelRef
1003
+ @return
1004
+ - \ref SU_ERROR_NONE on success
1005
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
1006
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if description is NULL
1007
+ - \ref SU_ERROR_INVALID_OUTPUT if description does not point to a valid \ref
1008
+ SUStringRef object
1009
+ */
1010
+ SU_RESULT SUModelGetDescription(SUModelRef model, SUStringRef* description);
1011
+
1012
+ /**
1013
+ @brief Sets the description of a model object.
1014
+ @param[in] model The model object.
1015
+ @param[in] description The description of the model object. Assumed to be UTF-8
1016
+ encoded.
1017
+ @related SUModelRef
1018
+ @return
1019
+ - \ref SU_ERROR_NONE on success
1020
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
1021
+ - \ref SU_ERROR_NULL_POINTER_INPUT if description is NULL
1022
+ */
1023
+ SU_RESULT SUModelSetDescription(SUModelRef model, const char* description);
1024
+
1025
+ /**
1026
+ @brief Returns the units associated with the given model.
1027
+ @param[in] model The model object.
1028
+ @param[out] units The units retrieved.
1029
+ @related SUModelRef
1030
+ @return
1031
+ - \ref SU_ERROR_NONE on success
1032
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
1033
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if the units argument is invalid
1034
+ */
1035
+ SU_RESULT SUModelGetUnits(SUModelRef model, enum SUModelUnits* units);
1036
+
1037
+ /**
1038
+ @brief Retrieves the classifications of a model object.
1039
+ @param[in] model The model object.
1040
+ @param[out] classifications The classifications object retrieved.
1041
+ @related SUModelRef
1042
+ @return
1043
+ - \ref SU_ERROR_NONE on success
1044
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1045
+ - \ref SU_ERROR_NULL_POINTER_INPUT if classifications is NULL
1046
+ */
1047
+ SU_RESULT SUModelGetClassifications(SUModelRef model, SUClassificationsRef* classifications);
1048
+
1049
+ /**
1050
+ @brief Retrieves the axes of a model object.
1051
+ @param[in] model The model object.
1052
+ @param[out] axes The axes object retrieved.
1053
+ @related SUModelRef
1054
+ @return
1055
+ - \ref SU_ERROR_NONE on success
1056
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1057
+ - \ref SU_ERROR_NULL_POINTER_INPUT if axes is NULL
1058
+ */
1059
+ SU_RESULT SUModelGetAxes(SUModelRef model, SUAxesRef* axes);
1060
+
1061
+ /**
1062
+ @brief Retrieves the styles of a model object.
1063
+ @since SketchUp 2017, API 5.0
1064
+ @param[in] model The model object.
1065
+ @param[out] styles The styles object retrieved.
1066
+ @related SUModelRef
1067
+ @return
1068
+ - \ref SU_ERROR_NONE on success
1069
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1070
+ - \ref SU_ERROR_NULL_POINTER_INPUT if manager is NULL
1071
+ */
1072
+ SU_RESULT SUModelGetStyles(SUModelRef model, SUStylesRef* styles);
1073
+
1074
+ /**
1075
+ @brief Retrieves the instance path (including an entity) corresponding
1076
+ to a given persistent id.
1077
+ @param[in] model The model object.
1078
+ @param[in] pid_ref Persistent id of the entity.
1079
+ @param[out] instance_path_ref Instance path to the entity.
1080
+ @related SUModelRef
1081
+ @note Starting in SketchUp 2020.1, API 8.1, SU_ERROR_NO_DATA will be returned
1082
+ if pid_ref isn't a valid instance path in the model.
1083
+ @return
1084
+ - \ref SU_ERROR_NONE on success
1085
+ - \ref SU_ERROR_INVALID_INPUT if model or pid_ref are not a valid object
1086
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if instance_path_ref is NULL
1087
+ - \ref SU_ERROR_NO_DATA if the persistent id path didn't exist in the model
1088
+ - \ref SU_ERROR_INVALID_OUTPUT if instance_path_ref is not a valid object
1089
+ - \ref SU_ERROR_PARTIAL_SUCCESS if an instance path can not be is fully traced
1090
+ - \ref SU_ERROR_GENERIC on general failure
1091
+ */
1092
+ SU_RESULT SUModelGetInstancePathByPid(
1093
+ SUModelRef model, SUStringRef pid_ref, SUInstancePathRef* instance_path_ref);
1094
+
1095
+ /**
1096
+ @brief Retrieves the number of fonts in a model object.
1097
+ @since SketchUp 2017, API 5.0
1098
+ @param[in] model The model object.
1099
+ @param[out] count The number of font objects available.
1100
+ @related SUModelRef
1101
+ @return
1102
+ - \ref SU_ERROR_NONE on success
1103
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1104
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
1105
+ */
1106
+ SU_RESULT SUModelGetNumFonts(SUModelRef model, size_t* count);
1107
+
1108
+ /**
1109
+ @brief Retrieves all the fonts associated with a model object.
1110
+ @since SketchUp 2017, API 5.0
1111
+ @param[in] model The model object.
1112
+ @param[in] len The number of font objects to retrieve.
1113
+ @param[out] fonts The font objects retrieved.
1114
+ @param[out] count The number of font objects retrieved.
1115
+ @related SUModelRef
1116
+ @return
1117
+ - \ref SU_ERROR_NONE on success
1118
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1119
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if fonts or count is NULL
1120
+ */
1121
+ SU_RESULT SUModelGetFonts(SUModelRef model, size_t len, SUFontRef fonts[], size_t* count);
1122
+
1123
+ /**
1124
+ @brief Retrieves the dimension style associated with a model object.
1125
+ @since SketchUp 2017, API 5.0
1126
+ @param[in] model The model object.
1127
+ @param[out] style The dimension style retrieved.
1128
+ @related SUModelRef
1129
+ @return
1130
+ - \ref SU_ERROR_NONE on success
1131
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1132
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if style is NULL
1133
+ */
1134
+ SU_RESULT SUModelGetDimensionStyle(SUModelRef model, SUDimensionStyleRef* style);
1135
+
1136
+ /**
1137
+ @brief Retrieves length formatter settings from the model. The given length
1138
+ formatter object must have been constructed using
1139
+ SULengthFormatterCreate(). It must be released using
1140
+ SULengthFormatterRelease().
1141
+ @since SketchUp 2018, API 6.0
1142
+ @param[in] model The model object.
1143
+ @param[out] formatter The formatter used to retrieve the settings.
1144
+ @related SUModelRef
1145
+ @return
1146
+ - \ref SU_ERROR_NONE on success
1147
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1148
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if formatter is NULL
1149
+ - \ref SU_ERROR_INVALID_OUTPUT if formatter does not point to a valid \ref
1150
+ SULengthFormatterRef object
1151
+ */
1152
+ SU_RESULT SUModelGetLengthFormatter(SUModelRef model, SULengthFormatterRef* formatter);
1153
+
1154
+ /**
1155
+ @brief Retrieves a unique material name from the model that is based on the
1156
+ provided one. If the provided name is unique it will be returned,
1157
+ otherwise any trailing indices will be replaced by a new index.
1158
+ @since SketchUp 2018, API 6.0
1159
+ @param[in] model The model object.
1160
+ @param[in] in_name The suggested name.
1161
+ @param[out] out_name The returned name.
1162
+ @related SUModelRef
1163
+ @return
1164
+ - \ref SU_ERROR_NONE on success
1165
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1166
+ - \ref SU_ERROR_NULL_POINTER_INPUT if in_name is NULL
1167
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if out_name is NULL
1168
+ - \ref SU_ERROR_INVALID_OUTPUT if out_name does not point to a valid \ref
1169
+ SUStringRef object
1170
+ */
1171
+ SU_RESULT SUModelGenerateUniqueMaterialName(
1172
+ SUModelRef model, const char* in_name, SUStringRef* out_name);
1173
+
1174
+ /**
1175
+ @brief Fixes any errors found in the given model.
1176
+ @since SketchUp 2018, API 6.0
1177
+ @param[in] model The model object.
1178
+ @related SUModelRef
1179
+ @return
1180
+ - \ref SU_ERROR_NONE on success
1181
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1182
+ */
1183
+ SU_RESULT SUModelFixErrors(SUModelRef model);
1184
+
1185
+ /**
1186
+ @brief Updates the faces in the model so that they are oriented
1187
+ consistently.
1188
+ @since SketchUp 2018, API 6.0
1189
+ @param[in] model The model object.
1190
+ @param[in] recurse_components Orient components of the model.
1191
+ @related SUModelRef
1192
+ @return
1193
+ - \ref SU_ERROR_NONE on success
1194
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1195
+ */
1196
+ SU_RESULT SUModelOrientFacesConsistently(SUModelRef model, bool recurse_components);
1197
+
1198
+
1199
+ /**
1200
+ @brief Retrieves line styles from the model.
1201
+ @since SketchUp 2019, API 7.0
1202
+ @param[in] model The model object.
1203
+ @param[out] line_styles The line styles of the model.
1204
+ @related SUModelRef
1205
+ @return
1206
+ - \ref SU_ERROR_NONE on success
1207
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1208
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if line_styles is NULL
1209
+ */
1210
+ SU_RESULT SUModelGetLineStyles(SUModelRef model, SULineStylesRef* line_styles);
1211
+
1212
+ /**
1213
+ @brief Loads a component from a file.
1214
+ @deprecated This method will be removed in SketchUp 2022.0. It is replaced by
1215
+ SUModelLoadDefinitionWithStatus() which can load components
1216
+ saved by newer versions of SketchUp.
1217
+ @since SketchUp 2019.2, API 7.1
1218
+ @param[in] model The model object.
1219
+ @param[in] filename The full path and filename to a SkethchUp model.
1220
+ @param[out] definition The component definition that is created after load.
1221
+ @related SUModelRef
1222
+ @return
1223
+ - \ref SU_ERROR_NONE on success
1224
+ - \ref SU_ERROR_INVALID_INPUT if \p model is not a valid object
1225
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p filename is NULL
1226
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p definition is NULL
1227
+ - \ref SU_ERROR_OVERWRITE_VALID if \p definition is already a valid object
1228
+ - \ref SU_ERROR_SERIALIZATION if loading the file failed
1229
+ */
1230
+ SU_DEPRECATED_FUNCTION("SketchUp API 9.0")
1231
+ SU_RESULT SUModelLoadDefinition(
1232
+ SUModelRef model, const char* filename, SUComponentDefinitionRef* definition);
1233
+
1234
+ /**
1235
+ @brief Loads a component from a file.
1236
+ @since SketchUp 2021, API 9.0
1237
+
1238
+ @note As of SketchUp 2021.0, SketchUp can open .skp files created with newer versions of SketchUp.
1239
+ However, opening newer versions with an older SDK might omit model data. Use the load
1240
+ \p status value to check if the file was created with a newer version of SketchUp.
1241
+
1242
+ @warning When reading a file created with a newer version of SketchUp, you may lose data
1243
+ if you write over the same file.
1244
+
1245
+ @param[in] model The model object.
1246
+ @param[in] filename The full path and filename to a SkethchUp model.
1247
+ @param[out] definition The component definition that is created after load.
1248
+ @param[out] status Returns additional information on the status of a
1249
+ successful operation. Valid when the return value is
1250
+ \ref SU_ERROR_NONE.
1251
+ @related SUModelRef
1252
+ @return
1253
+ - \ref SU_ERROR_NONE on success
1254
+ - \ref SU_ERROR_INVALID_INPUT if \p model is not a valid object
1255
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p filename is NULL
1256
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p definition is NULL
1257
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p status is NULL
1258
+ - \ref SU_ERROR_OVERWRITE_VALID if \p definition is already a valid object
1259
+ - \ref SU_ERROR_MODEL_VERSION if the component file has a newer version
1260
+ than is supported by the current build of the SDK.
1261
+ - \ref SU_ERROR_SERIALIZATION if loading the file failed
1262
+ */
1263
+ SU_RESULT SUModelLoadDefinitionWithStatus(
1264
+ SUModelRef model, const char* filename, SUComponentDefinitionRef* definition,
1265
+ enum SUModelLoadStatus* status);
1266
+
1267
+ /**
1268
+ @brief Removes all materials provided in the array.
1269
+ @since SketchUp 2019.2, API 7.1
1270
+ @param[in] model The model object.
1271
+ @param[in] len The length of the array.
1272
+ @param[in] materials The materials to be deleted.
1273
+ @related SUModelRef
1274
+ @return
1275
+ - \ref SU_ERROR_NONE on success
1276
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1277
+ - \ref SU_ERROR_NULL_POINTER_INPUT if materials is NULL
1278
+ - \ref SU_ERROR_OUT_OF_RANGE if len is zero
1279
+ - \ref SU_ERROR_PARTIAL_SUCCESS if removing the materials failed mid-process
1280
+ - \ref SU_ERROR_NO_DATA if materials provided are invalid
1281
+ */
1282
+ SU_RESULT SUModelRemoveMaterials(SUModelRef model, size_t len, SUMaterialRef materials[]);
1283
+
1284
+ /**
1285
+ @brief Removes selected scenes from a model.
1286
+ @since SketchUp 2019.2, API 7.1
1287
+ @param[in] model The model object.
1288
+ @param[in] len The number of scenes in the array for removal.
1289
+ @param[in] scenes The scenes to be deleted from the model.
1290
+ @related SUModelRef
1291
+ @return
1292
+ - \ref SU_ERROR_NONE on success
1293
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1294
+ - \ref SU_ERROR_OUT_OF_RANGE if len is zero
1295
+ - \ref SU_ERROR_PARTIAL_SUCCESS if the deletion process failed mid-process or
1296
+ if not all of scenes for deletion were found in the model
1297
+ - \ref SU_ERROR_NO_DATA if none of the requested scenes could be found for deletion
1298
+ */
1299
+ SU_RESULT SUModelRemoveScenes(SUModelRef model, size_t len, SUSceneRef scenes[]);
1300
+
1301
+ /**
1302
+ @brief Retrieves the number of all the materials in a model including those
1303
+ belonging to SUImageRef and SULayerRef.
1304
+
1305
+ @warning Materials from SUImageRef and SULayerRef should not be applied to
1306
+ any other entity in the model. They are uniquely owned by the image
1307
+ or layer.
1308
+
1309
+ @since SketchUp 2019.2, API 7.1
1310
+ @param[in] model The model object.
1311
+ @param[out] count The number of material objects available.
1312
+ @related SUModelRef
1313
+ @return
1314
+ - \ref SU_ERROR_NONE on success
1315
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1316
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if count is NULL
1317
+ */
1318
+ SU_RESULT SUModelGetNumAllMaterials(SUModelRef model, size_t* count);
1319
+
1320
+ /**
1321
+ @brief Retrieves all the materials associated with a model object including
1322
+ those belonging to SUImageRef and SULayerRef.
1323
+
1324
+ @warning Materials from SUImageRef and SULayerRef should not be applied to
1325
+ any other entity in the model. They are uniquely owned by the image
1326
+ or layer.
1327
+
1328
+ @since SketchUp 2019.2, API 7.1
1329
+ @param[in] model The model object.
1330
+ @param[in] len The number of material objects to retrieve.
1331
+ @param[out] materials The material objects retrieved.
1332
+ @param[out] count The number of material objects retrieved.
1333
+ @related SUModelRef
1334
+ @return
1335
+ - \ref SU_ERROR_NONE on success
1336
+ - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
1337
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if materials or count is NULL
1338
+ */
1339
+ SU_RESULT SUModelGetAllMaterials(
1340
+ SUModelRef model, size_t len, SUMaterialRef materials[], size_t* count);
1341
+
1342
+ /**
1343
+ @since SketchUp 2019.2, API 7.1
1344
+
1345
+ @brief Retrieves the guid of a model object.
1346
+
1347
+ @see SUComponentDefinitionGetGuid
1348
+ @see SUSkpReadGuid
1349
+
1350
+ @param[in] model The model object.
1351
+ @param[out] guid The guid string.
1352
+ @related SUModelRef
1353
+ @return
1354
+ - \ref SU_ERROR_NONE on success
1355
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
1356
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if guid is NULL
1357
+ - \ref SU_ERROR_INVALID_OUTPUT if guid does not point to a valid \ref
1358
+ SUStringRef object
1359
+ */
1360
+ SU_RESULT SUModelGetGuid(SUModelRef model, SUStringRef* guid);
1361
+
1362
+ /**
1363
+ @brief Retrieves layers by their persistent ids. The layers retrieved will be in
1364
+ the same order as to the peristent ids passed in. If a persistent id
1365
+ doesn't belong to a layer, then a \ref SU_INVALID element will be
1366
+ returned along with \ref SU_ERROR_PARTIAL_SUCCESS.
1367
+ @since SketchUp 2020.0, API 8.0
1368
+ @see SUModelGetEntitiesOfTypeByPersistentIDs()
1369
+ @deprecated Prefer the more flexible SUModelGetEntitiesOfTypeByPersistentIDs()
1370
+ which lets you narrow the search scope.
1371
+ @param[in] model The model object.
1372
+ @param[in] num_pids The number of persistent ids.
1373
+ @param[in] pids The persistent ids.
1374
+ @param[out] layers The retrieved layer objects.
1375
+ @related SUModelRef
1376
+ @return
1377
+ - \ref SU_ERROR_NONE on success or if num_pids is zero
1378
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
1379
+ - \ref SU_ERROR_NULL_POINTER_INPUT if pids is NULL
1380
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if layer is NULL
1381
+ - \ref SU_ERROR_PARTIAL_SUCCESS if one or more layers could not be found
1382
+ - \ref SU_ERROR_OVERWRITE_VALID if layers contains a valid \ref SULayerRef
1383
+ */
1384
+ SU_DEPRECATED_FUNCTION("SketchUp API 8.2")
1385
+ SU_RESULT SUModelGetLayersByPersistentIDs(
1386
+ SUModelRef model, size_t num_pids, const int64_t pids[], SULayerRef layers[]);
1387
+
1388
+ /**
1389
+ @brief Reports whether the given \ref SUDrawingElementRef in an
1390
+ \ref SUInstancePathRef is visible given the model's rendering options.
1391
+ This will take into account "DrawHiddenGeometry" and "DrawHiddenObjects"
1392
+ to determine if the drawing element is visible in the viewport.
1393
+ @since SketchUp 2020.0, API 8.0
1394
+ @param[in] model The model object.
1395
+ @param[in] path The instance path to resolve visibility for.
1396
+ @param[out] visible The retrieved layer objects.
1397
+ @related SUModelRef
1398
+ @return
1399
+ - \ref SU_ERROR_NONE on success
1400
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
1401
+ - \ref SU_ERROR_INVALID_INPUT if path is an invalid object
1402
+ - \ref SU_ERROR_INVALID_ARGUMENT if the instance path is not valid in the model
1403
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if visible is NULL
1404
+ */
1405
+ SU_RESULT SUModelIsDrawingElementVisible(SUModelRef model, SUInstancePathRef path, bool* visible);
1406
+
1407
+ /**
1408
+ @brief Retrieves entities by their persistent ids. The entities retrieved will
1409
+ be in the same order as to the peristent ids passed in. If a persistent
1410
+ id doesn't belong to a entity, then a \ref SU_INVALID element will be
1411
+ returned along with \ref SU_ERROR_PARTIAL_SUCCESS.
1412
+ @since SketchUp 2020.0, API 8.0
1413
+ @see SUModelGetEntitiesOfTypeByPersistentIDs()
1414
+ @deprecated Prefer the more flexible SUModelGetEntitiesOfTypeByPersistentIDs()
1415
+ which lets you narrow the search scope.
1416
+ @param[in] model The model object.
1417
+ @param[in] num_pids The number of persistent ids.
1418
+ @param[in] pids The persistent ids.
1419
+ @param[out] entities The retrieved entity objects.
1420
+ @related SUModelRef
1421
+ @return
1422
+ - \ref SU_ERROR_NONE on success or if num_pids is zero
1423
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
1424
+ - \ref SU_ERROR_NULL_POINTER_INPUT if pids is NULL
1425
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if model is NULL
1426
+ - \ref SU_ERROR_PARTIAL_SUCCESS if one or more entities could not be found
1427
+ - \ref SU_ERROR_OVERWRITE_VALID if entities contains a valid \ref SUEntityRef
1428
+ */
1429
+ SU_DEPRECATED_FUNCTION("SketchUp API 8.2")
1430
+ SU_RESULT SUModelGetEntitiesByPersistentIDs(
1431
+ SUModelRef model, size_t num_pids, const int64_t pids[], SUEntityRef entities[]);
1432
+
1433
+ /**
1434
+ @brief Retrieves the selection object for a model.
1435
+ @note This method only works from within the SketchUp application.
1436
+ @since SketchUp 2020.2, API 8.2
1437
+ @param[in] model The model object.
1438
+ @param[out] selection The retrieved selection object.
1439
+ @related SUModelRef
1440
+ @return
1441
+ - \ref SU_ERROR_NONE on success
1442
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
1443
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if selection is NULL
1444
+ - \ref SU_ERROR_OVERWRITE_VALID if selection is already a valid object
1445
+ - \ref SU_ERROR_NO_DATA if this isn't called from within SketchUp
1446
+ */
1447
+ SU_RESULT SUModelGetSelection(SUModelRef model, SUSelectionRef* selection);
1448
+
1449
+ /**
1450
+ @brief Gets the number of \ref SULayerFolderRef objects owned by the given
1451
+ model.
1452
+ @since SketchUp 2021.0, API 9.0
1453
+ @param[in] model The model object.
1454
+ @param[out] count The number of layer folder objects.
1455
+ @related SUModelRef
1456
+ @return
1457
+ - \ref SU_ERROR_NONE on success
1458
+ - \ref SU_ERROR_INVALID_INPUT if \p model is an invalid object
1459
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p count is NULL
1460
+ */
1461
+ SU_RESULT SUModelGetNumLayerFolders(SUModelRef model, size_t* count);
1462
+
1463
+ /**
1464
+ @brief Gets the \ref SULayerFolderRef objects that are owned by the given model.
1465
+ @since SketchUp 2021.0, API 9.0
1466
+ @param[in] model The model object.
1467
+ @param[in] len The number of elements in \p layer_folders.
1468
+ @param[out] layer_folders An array of layer folder objects.
1469
+ @param[out] count The number of elements written into \p layer_folders.
1470
+ @related SUModelRef
1471
+ @return
1472
+ - \ref SU_ERROR_NONE on success
1473
+ - \ref SU_ERROR_INVALID_INPUT if \p model is an invalid object
1474
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p layer_folders or \p count is NULL
1475
+ */
1476
+ SU_RESULT SUModelGetLayerFolders(
1477
+ SUModelRef model, size_t len, SULayerFolderRef* layer_folders, size_t* count);
1478
+
1479
+ /**
1480
+ @brief Removes empty \ref SULayerFolderRef objects from the model.
1481
+ @since SketchUp 2021.0, API 9.0
1482
+ @param[in] model The model object.
1483
+ @param[out] count The number of empty layer folders removed. If NULL,
1484
+ count will not be retrieved.
1485
+ @related SUModelRef
1486
+ @return
1487
+ - \ref SU_ERROR_NONE on success
1488
+ - \ref SU_ERROR_INVALID_INPUT if \p model is an invalid object
1489
+ */
1490
+ SU_RESULT SUModelPurgeEmptyLayerFolders(SUModelRef model, size_t* count);
1491
+
1492
+ /**
1493
+ @brief Adds a \ref SULayerFolderRef object to the model.
1494
+ @since SketchUp 2021.0, API 9.0
1495
+ @param[in] model The model object.
1496
+ @param[in] layer_folder The layer folder to add.
1497
+ @related SUModelRef
1498
+ @return
1499
+ - \ref SU_ERROR_NONE on success
1500
+ - \ref SU_ERROR_INVALID_INPUT if \p model or \p layer_folder is an invalid
1501
+ object
1502
+ - \ref SU_ERROR_INVALID_ARGUMENT if \p layer_folder fails to be added or is
1503
+ already part of the model.
1504
+ */
1505
+ SU_RESULT SUModelAddLayerFolder(SUModelRef model, SULayerFolderRef layer_folder);
1506
+
1507
+ /**
1508
+ @brief Removes unused \ref SULayerRef objects from the model.
1509
+ @since SketchUp 2020.2, API 8.2
1510
+ @param[in] model The model object.
1511
+ @param[out] count The number of layers deleted. If NULL, count
1512
+ will not be retrieved.
1513
+ @related SUModelRef
1514
+ @return
1515
+ - \ref SU_ERROR_NONE on success
1516
+ - \ref SU_ERROR_INVALID_INPUT if \p model is an invalid object
1517
+ */
1518
+ SU_RESULT SUModelPurgeUnusedLayers(SUModelRef model, size_t* count);
1519
+
1520
+ /**
1521
+ @brief Retrieves the number of layers in a model object that have not been
1522
+ added to any layer folder.
1523
+ @since SketchUp 2021.0, API 9.0
1524
+ @param[in] model The model object.
1525
+ @param[out] count The number of top-level layers available.
1526
+ @related SUModelRef
1527
+ @see SUModelGetNumLayers()
1528
+ @return
1529
+ - \ref SU_ERROR_NONE on success
1530
+ - \ref SU_ERROR_INVALID_INPUT if \p model is not a valid object
1531
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p count is NULL
1532
+ */
1533
+ SU_RESULT SUModelGetNumTopLevelLayers(SUModelRef model, size_t* count);
1534
+
1535
+ /**
1536
+ @brief Retrieves the layers in a model that have not been added to a
1537
+ layer folder.
1538
+ @since SketchUp 2021.0, API 9.0
1539
+ @param[in] model The model object.
1540
+ @param[in] len The number of layers to retrieve.
1541
+ @param[out] layers The layers retrieved.
1542
+ @param[out] count The number of layers retrieved.
1543
+ @related SUModelRef
1544
+ @see SUModelGetLayers()
1545
+ @return
1546
+ - \ref SU_ERROR_NONE on success
1547
+ - \ref SU_ERROR_INVALID_INPUT if \p model is not a valid object
1548
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p layers or \p count is NULL
1549
+ */
1550
+ SU_RESULT SUModelGetTopLevelLayers(
1551
+ SUModelRef model, size_t len, SULayerRef layers[], size_t* count);
1552
+
1553
+ /**
1554
+ @brief Removes all layer folders provided in the array. All children of the
1555
+ deleted layer folders will be moved to the parent of the deleted folder.
1556
+ @since SketchUp 2021.0, API 9.0
1557
+ @param[in] model The model object.
1558
+ @param[in] len The length of the array.
1559
+ @param[in] layer_folders The layer folders to be deleted.
1560
+ @related SUModelRef
1561
+ @return
1562
+ - \ref SU_ERROR_NONE on success
1563
+ - \ref SU_ERROR_INVALID_INPUT if \p model is not a valid object.
1564
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p layer_folders is NULL
1565
+ - \ref SU_ERROR_OUT_OF_RANGE if \p len is less than one.
1566
+ - \ref SU_ERROR_INVALID_ARGUMENT if the number of successfully removed items
1567
+ in \p layer_folders is 0.
1568
+ - \ref SU_ERROR_PARTIAL_SUCCESS if we successfully remove at least 1 of the
1569
+ items provided in \p layer_folders but fail to remove others.
1570
+ */
1571
+ SU_RESULT SUModelRemoveLayerFolders(SUModelRef model, size_t len, SULayerFolderRef layer_folders[]);
1572
+
1573
+ /**
1574
+ * @anchor SUModelGetEntitiesType
1575
+ * @since SketchUp 2020.2, API 8.2
1576
+ * @name Entity Type Flags
1577
+ * @brief Flags for SUModelGetEntitiesOfTypeByPersistentIDs(). These can be
1578
+ * combined bitwise.
1579
+ * @see SUModelRef
1580
+ * @{
1581
+ */
1582
+ /// Any entities inside the root or another definition's entities.
1583
+ #define FLAG_GET_ENTITIES_TYPE_DEFINITION_ENTITIES 0x0001
1584
+ /// SULayerRef entities.
1585
+ #define FLAG_GET_ENTITIES_TYPE_LAYERS 0x0002
1586
+ /// SULayerFolderRef entities.
1587
+ #define FLAG_GET_ENTITIES_TYPE_LAYER_FOLDERS 0x0004
1588
+ /// SUMaterialRef entities.
1589
+ #define FLAG_GET_ENTITIES_TYPE_MATERIALS 0x0008
1590
+ /// SUSceneRef entities.
1591
+ #define FLAG_GET_ENTITIES_TYPE_SCENES 0x0010
1592
+ /// SUStyleRef entities.
1593
+ #define FLAG_GET_ENTITIES_TYPE_STYLES 0x0020
1594
+ /// SUComponentDefinitionRef entities.
1595
+ #define FLAG_GET_ENTITIES_TYPE_DEFINITIONS 0x0040
1596
+ /// Search all types.
1597
+ #define FLAG_GET_ENTITIES_TYPE_ALL 0xffff
1598
+ /**@}*/
1599
+
1600
+ /**
1601
+ @brief Retrieves entities of a given type by their persistent ids. The
1602
+ entities retrieved will be in the same order as to the peristent ids passed
1603
+ in. If a persistent id doesn't belong to an entity, then a \ref SU_INVALID
1604
+ element will be returned along with \ref SU_ERROR_PARTIAL_SUCCESS.
1605
+ @note This method allows the user to search for specific types of entities
1606
+ which allows us to ignore parts of the model for faster results.
1607
+ @since SketchUp 2020.2, API 8.2
1608
+ @param[in] model The model object.
1609
+ @param[in] type_flags An integer made up by combining \ref SUModelGetEntitiesType
1610
+ "Entity Type Flag" values together with bitwise 'or'. This
1611
+ determines what types of entities to look for.
1612
+ @param[in] num_pids The number of persistent ids.
1613
+ @param[in] pids The persistent ids.
1614
+ @param[out] entities The retrieved entity objects.
1615
+ @related SUModelRef
1616
+ @return
1617
+ - \ref SU_ERROR_NONE on success or if num_pids is zero
1618
+ - \ref SU_ERROR_INVALID_INPUT if model is an invalid object
1619
+ - \ref SU_ERROR_NULL_POINTER_INPUT if pids is NULL
1620
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if entities is NULL
1621
+ - \ref SU_ERROR_PARTIAL_SUCCESS if one or more entities could not be found
1622
+ - \ref SU_ERROR_OVERWRITE_VALID if entities contains a valid \ref SUEntityRef
1623
+ */
1624
+ SU_RESULT SUModelGetEntitiesOfTypeByPersistentIDs(
1625
+ SUModelRef model, const uint32_t type_flags, const size_t num_pids, const int64_t pids[],
1626
+ SUEntityRef entities[]);
1627
+
1628
+ /**
1629
+ @brief Retrieves the component behavior of a SketchUp model.
1630
+ @since SketchUp 2021.1, API 9.1
1631
+ @param[in] model The model object.
1632
+ @param[out] behavior The behavior retrieved.
1633
+ @related SUModelRef
1634
+ @return
1635
+ - \ref SU_ERROR_NONE on success
1636
+ - \ref SU_ERROR_INVALID_INPUT if \p behavior is invalid
1637
+ */
1638
+ SU_RESULT SUModelGetBehavior(SUModelRef model, struct SUComponentBehavior* behavior);
1639
+
1640
+ /**
1641
+ @brief Sets the component behavior of a SketchUp model.
1642
+ @since SketchUp 2021.1, API 9.1
1643
+ @param[in] model The model object.
1644
+ @param[in] behavior The behavior to set.
1645
+ @related SUModelRef
1646
+ @return
1647
+ - \ref SU_ERROR_NONE on success
1648
+ - \ref SU_ERROR_INVALID_INPUT if \p model is invalid
1649
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p behavior is NULL
1650
+ */
1651
+ SU_RESULT SUModelSetBehavior(SUModelRef model, const struct SUComponentBehavior* behavior);
1652
+
1653
+ #ifdef __cplusplus
1654
+ }
1655
+ #endif
1656
+
1657
+ #if defined(__APPLE__)
1658
+ #pragma GCC diagnostic pop
1659
+ #endif
1660
+
1661
+ #pragma pack(pop)
1662
+
1663
+ #endif // SKETCHUP_MODEL_MODEL_H_