scriptup 2026.0.0 → 2026.0.1

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 (133) hide show
  1. checksums.yaml +4 -4
  2. data/ext/entity.c +3 -0
  3. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonGeometry.dylib +0 -0
  4. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/{Libraries → Frameworks}/libCommonGeoutils.dylib +0 -0
  5. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/{Libraries → Frameworks}/libCommonImage.dylib +0 -0
  6. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonPreferences.dylib +0 -0
  7. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonUnits.dylib +0 -0
  8. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonUtils.dylib +0 -0
  9. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Frameworks/libCommonZip.dylib +0 -0
  10. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/model.h +4 -4
  11. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/application/overlay.h +20 -6
  12. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/common.h +9 -9
  13. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/extension_license.h +9 -1
  14. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point2d.h +2 -2
  15. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/point3d.h +2 -2
  16. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/transformation2d.h +3 -3
  17. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector2d.h +5 -5
  18. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry/vector3d.h +4 -4
  19. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/geometry.h +9 -7
  20. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/import_export/modelimporterplugin.h +8 -4
  21. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/attribute_dictionary.h +4 -4
  22. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_definition.h +74 -33
  23. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_definition_snap_to_behavior_private.h +46 -0
  24. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/component_instance.h +11 -11
  25. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/curve.h +4 -4
  26. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/defs.h +7 -2
  27. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/dimension.h +2 -0
  28. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/drawing_element.h +11 -11
  29. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/edge.h +7 -7
  30. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entities.h +106 -61
  31. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/entity.h +7 -4
  32. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/environment.h +382 -0
  33. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/environments.h +133 -0
  34. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/face.h +43 -27
  35. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/geometry_input.h +126 -116
  36. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/group.h +9 -8
  37. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/image.h +6 -5
  38. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/layer.h +3 -3
  39. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/material.h +432 -25
  40. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model.h +263 -100
  41. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/model_entity_type_private.h +44 -0
  42. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/rendering_options.h +82 -81
  43. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/scene.h +222 -42
  44. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/snap.h +183 -0
  45. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/space.h +26 -0
  46. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/styles.h +29 -27
  47. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/text.h +14 -6
  48. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/texture.h +23 -1
  49. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/typed_value.h +26 -26
  50. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/model/vertex.h +2 -2
  51. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/sketchup.h +4 -1
  52. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Headers/unicodestring.h +7 -7
  53. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Resources/Info.plist +8 -8
  54. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/SketchUpAPI +0 -0
  55. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/_CodeSignature/CodeResources +144 -88
  56. data/sketchup-sdk-win/binaries/layout/x64/LayOutAPI.dll +0 -0
  57. data/sketchup-sdk-win/binaries/layout/x64/LayOutAPI.lib +0 -0
  58. data/sketchup-sdk-win/binaries/layout/x64/LayOutControllers.dll +0 -0
  59. data/sketchup-sdk-win/binaries/layout/x64/LayOutModel.dll +0 -0
  60. data/sketchup-sdk-win/binaries/layout/x64/LayOutRTF.dll +0 -0
  61. data/sketchup-sdk-win/binaries/layout/x64/LayOutUtils.dll +0 -0
  62. data/sketchup-sdk-win/binaries/layout/x64/LayOutView.dll +0 -0
  63. data/sketchup-sdk-win/binaries/layout/x64/SketchUpCommonPreferences.dll +0 -0
  64. data/sketchup-sdk-win/binaries/layout/x64/SketchUpViewerAPI.dll +0 -0
  65. data/sketchup-sdk-win/binaries/layout/x64/SketchUpViewerAPI.lib +0 -0
  66. data/sketchup-sdk-win/binaries/layout/x64/pdflib.dll +0 -0
  67. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpAPI.dll +0 -0
  68. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpAPI.lib +0 -0
  69. data/sketchup-sdk-win/binaries/sketchup/x64/SketchUpCommonPreferences.dll +0 -0
  70. data/sketchup-sdk-win/binaries/sketchup/x64/sketchup.lib +0 -0
  71. data/sketchup-sdk-win/headers/LayOutAPI/application/application.h +14 -14
  72. data/sketchup-sdk-win/headers/LayOutAPI/layout.h +1 -1
  73. data/sketchup-sdk-win/headers/LayOutAPI/model/dictionary.h +1 -1
  74. data/sketchup-sdk-win/headers/LayOutAPI/model/document.h +73 -0
  75. data/sketchup-sdk-win/headers/LayOutAPI/model/documentexportoptions.h +21 -2
  76. data/sketchup-sdk-win/headers/LayOutAPI/model/entity.h +72 -0
  77. data/sketchup-sdk-win/headers/LayOutAPI/model/group.h +2 -1
  78. data/sketchup-sdk-win/headers/LayOutAPI/model/lineardimension.h +54 -2
  79. data/sketchup-sdk-win/headers/LayOutAPI/model/page.h +70 -0
  80. data/sketchup-sdk-win/headers/LayOutAPI/model/sketchupmodel.h +58 -1
  81. data/sketchup-sdk-win/headers/LayOutAPI/model/style.h +39 -3
  82. data/sketchup-sdk-win/headers/LayOutAPI/model/table.h +2 -0
  83. data/sketchup-sdk-win/headers/LayOutAPI/model/typed_value.h +25 -1
  84. data/sketchup-sdk-win/headers/SketchUpAPI/application/model.h +4 -4
  85. data/sketchup-sdk-win/headers/SketchUpAPI/application/overlay.h +20 -6
  86. data/sketchup-sdk-win/headers/SketchUpAPI/common.h +9 -9
  87. data/sketchup-sdk-win/headers/SketchUpAPI/extension_license.h +9 -1
  88. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point2d.h +2 -2
  89. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/point3d.h +2 -2
  90. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/transformation2d.h +3 -3
  91. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector2d.h +5 -5
  92. data/sketchup-sdk-win/headers/SketchUpAPI/geometry/vector3d.h +4 -4
  93. data/sketchup-sdk-win/headers/SketchUpAPI/geometry.h +9 -7
  94. data/sketchup-sdk-win/headers/SketchUpAPI/import_export/modelimporterplugin.h +8 -4
  95. data/sketchup-sdk-win/headers/SketchUpAPI/model/attribute_dictionary.h +4 -4
  96. data/sketchup-sdk-win/headers/SketchUpAPI/model/component_definition.h +74 -33
  97. data/sketchup-sdk-win/headers/SketchUpAPI/model/component_definition_snap_to_behavior_private.h +46 -0
  98. data/sketchup-sdk-win/headers/SketchUpAPI/model/component_instance.h +11 -11
  99. data/sketchup-sdk-win/headers/SketchUpAPI/model/curve.h +4 -4
  100. data/sketchup-sdk-win/headers/SketchUpAPI/model/defs.h +7 -2
  101. data/sketchup-sdk-win/headers/SketchUpAPI/model/dimension.h +2 -0
  102. data/sketchup-sdk-win/headers/SketchUpAPI/model/drawing_element.h +11 -11
  103. data/sketchup-sdk-win/headers/SketchUpAPI/model/edge.h +7 -7
  104. data/sketchup-sdk-win/headers/SketchUpAPI/model/entities.h +106 -61
  105. data/sketchup-sdk-win/headers/SketchUpAPI/model/entity.h +7 -4
  106. data/sketchup-sdk-win/headers/SketchUpAPI/model/environment.h +382 -0
  107. data/sketchup-sdk-win/headers/SketchUpAPI/model/environments.h +133 -0
  108. data/sketchup-sdk-win/headers/SketchUpAPI/model/face.h +43 -27
  109. data/sketchup-sdk-win/headers/SketchUpAPI/model/geometry_input.h +126 -116
  110. data/sketchup-sdk-win/headers/SketchUpAPI/model/group.h +9 -8
  111. data/sketchup-sdk-win/headers/SketchUpAPI/model/image.h +6 -5
  112. data/sketchup-sdk-win/headers/SketchUpAPI/model/layer.h +3 -3
  113. data/sketchup-sdk-win/headers/SketchUpAPI/model/material.h +432 -25
  114. data/sketchup-sdk-win/headers/SketchUpAPI/model/model.h +263 -100
  115. data/sketchup-sdk-win/headers/SketchUpAPI/model/model_entity_type_private.h +44 -0
  116. data/sketchup-sdk-win/headers/SketchUpAPI/model/rendering_options.h +82 -81
  117. data/sketchup-sdk-win/headers/SketchUpAPI/model/scene.h +222 -42
  118. data/sketchup-sdk-win/headers/SketchUpAPI/model/snap.h +183 -0
  119. data/sketchup-sdk-win/headers/SketchUpAPI/model/space.h +26 -0
  120. data/sketchup-sdk-win/headers/SketchUpAPI/model/styles.h +29 -27
  121. data/sketchup-sdk-win/headers/SketchUpAPI/model/text.h +14 -6
  122. data/sketchup-sdk-win/headers/SketchUpAPI/model/texture.h +23 -1
  123. data/sketchup-sdk-win/headers/SketchUpAPI/model/typed_value.h +26 -26
  124. data/sketchup-sdk-win/headers/SketchUpAPI/model/vertex.h +2 -2
  125. data/sketchup-sdk-win/headers/SketchUpAPI/sketchup.h +4 -1
  126. data/sketchup-sdk-win/headers/SketchUpAPI/unicodestring.h +7 -7
  127. metadata +22 -10
  128. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonGeometry.dylib +0 -0
  129. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonPreferences.dylib +0 -0
  130. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonUnits.dylib +0 -0
  131. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonUtils.dylib +0 -0
  132. data/sketchup-sdk-mac/SketchUpAPI.framework/Versions/A/Libraries/libCommonZip.dylib +0 -0
  133. data/sketchup-sdk-win/headers/LayOutAPI/model/skpfilereference.h +0 -94
@@ -1,4 +1,4 @@
1
- // Copyright 2013-2020 Trimble Inc Ltd. All Rights Reserved.
1
+ // Copyright 2013-2024 Trimble Inc Ltd. All Rights Reserved.
2
2
 
3
3
  /**
4
4
  * @file
@@ -30,26 +30,30 @@ extern "C" {
30
30
  @brief A SketchUp model.
31
31
  */
32
32
 
33
+ // The SUEntityType enum was originally defined incorrectly in this struct.
34
+ // This is not valid C. To correct this we conditionally include it in here for
35
+ // C compilers, while leaving the original definition inside the struct for C++
36
+ // compilers.
37
+ #ifndef __cplusplus
38
+ #include <SketchUpAPI/model/model_entity_type_private.h>
39
+ #endif
40
+
33
41
  /**
34
42
  @struct SUModelStatistics
35
43
  @brief Contains an array of entity counts that can be indexed per entity type.
44
+
45
+ @note See \ref SUEntityType for examples on how it is defined depending on
46
+ whether the code is compiled as C or C++. (Related to a bug in the original implementation).
47
+
48
+ @see SUEntityType
49
+ @see SUModelGetStatistics
36
50
  */
37
51
  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
- };
52
+ #ifdef __cplusplus
53
+ // See the note above for why this is included here.
54
+ #include <SketchUpAPI/model/model_entity_type_private.h>
55
+ #endif
56
+
53
57
  int entity_counts[SUNumEntityTypes]; ///< Count of each entity type.
54
58
  };
55
59
 
@@ -214,7 +218,7 @@ SU_RESULT SUModelCreateFromBufferWithStatus(
214
218
  @brief Releases a model object and its associated resources. The root component
215
219
  of the model object and all its child objects must not be released
216
220
  explicitly
217
- @param[in] model The model object.
221
+ @param[in,out] model The model object.
218
222
  @related SUModelRef
219
223
  @return
220
224
  - \ref SU_ERROR_NONE on success
@@ -305,12 +309,25 @@ SU_RESULT SUModelGetNumMaterials(SUModelRef model, size_t* count);
305
309
  SU_RESULT SUModelGetMaterials(
306
310
  SUModelRef model, size_t len, SUMaterialRef materials[], size_t* count);
307
311
 
312
+ /**
313
+ * @brief Retrieves the environments collection in the model.
314
+ * @since SketchUp 2025.0, API 13.0
315
+ * @param[in] model The model object.
316
+ * @param[out] environments The environments collection retrieved.
317
+ * @related SUModelRef
318
+ * @return
319
+ * - \ref SU_ERROR_NONE on success
320
+ * - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
321
+ * - \ref SU_ERROR_NULL_POINTER_OUTPUT if environments is NULL
322
+ */
323
+ SU_RESULT SUModelGetEnvironments(SUModelRef model, SUEnvironmentsRef* environments);
324
+
308
325
  /**
309
326
  @brief Adds materials to a model object. Note that the materials cannot be
310
327
  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.
328
+ @param[in,out] model The model object.
329
+ @param[in] len The number of material objects to add.
330
+ @param[in] materials The array of material objects to add.
314
331
  @related SUModelRef
315
332
  @return
316
333
  - \ref SU_ERROR_NONE on success
@@ -326,11 +343,11 @@ SU_RESULT SUModelAddMaterials(SUModelRef model, size_t len, const SUMaterialRef
326
343
  If a matching material exists in the model it will be returned instead.
327
344
 
328
345
  @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
346
+ @param[in,out] model The model object.
347
+ @param[in] file_path The location to load the material from. Assumed to be
348
+ UTF-8 encoded.
349
+ @param[out] material The material object.
350
+ @related SUModelRef
334
351
  @return
335
352
  - \ref SU_ERROR_NONE on success
336
353
  - \ref SU_ERROR_INVALID_INPUT if \p model is not a valid object
@@ -428,9 +445,9 @@ SU_RESULT SUModelGetImageDefinitions(
428
445
 
429
446
  /**
430
447
  @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.
448
+ @param[in,out] model The model object.
449
+ @param[in] len The number of component definitions to add.
450
+ @param[in] components The array of component definitions to add.
434
451
  @related SUModelRef
435
452
  @return
436
453
  - \ref SU_ERROR_NONE on success
@@ -445,9 +462,9 @@ SU_RESULT SUModelAddComponentDefinitions(
445
462
  All component definitions, their geometry, and attached instances will be
446
463
  released.
447
464
  @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.
465
+ @param[in,out] model The model object.
466
+ @param[in] len The number of component definitions to remove.
467
+ @param[in] components The array of component definitions to remove.
451
468
  @related SUModelRef
452
469
  @return
453
470
  - \ref SU_ERROR_NONE on success
@@ -513,9 +530,9 @@ SU_RESULT SUModelGetCamera(SUModelRef model, SUCameraRef* camera);
513
530
  /**
514
531
  @brief Sets the current camera of a model object.
515
532
  @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.
533
+ @param[in,out] model The model object.
534
+ @param[in,out] camera The camera object. This reference will become invalid when
535
+ this function returns.
519
536
  @related SUModelRef
520
537
  @return
521
538
  - \ref SU_ERROR_NONE on success
@@ -571,9 +588,9 @@ SU_RESULT SUModelGetLayers(SUModelRef model, size_t len, SULayerRef layers[], si
571
588
 
572
589
  /**
573
590
  @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.
591
+ @param[in,out] model The model object.
592
+ @param[in] len The number of layers to add.
593
+ @param[in] layers The layers to add.
577
594
  @related SUModelRef
578
595
  @return
579
596
  - \ref SU_ERROR_NONE on success
@@ -598,9 +615,9 @@ SU_RESULT SUModelGetDefaultLayer(SUModelRef model, SULayerRef* layer);
598
615
  @brief Removes all layers provided in the array. The default layer cannot be
599
616
  removed. All entities on the deleted layers will be moved to the default layer.
600
617
  @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.
618
+ @param[in,out] model The model object.
619
+ @param[in] len The length of the array.
620
+ @param[in] layers The layers to be deleted.
604
621
  @related SUModelRef
605
622
  @return
606
623
  - \ref SU_ERROR_NONE on success
@@ -627,8 +644,8 @@ SU_RESULT SUModelGetActiveLayer(SUModelRef model, SULayerRef* layer);
627
644
  /**
628
645
  @brief Sets the active layer object of a model object.
629
646
  @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.
647
+ @param[in,out] model The model object.
648
+ @param[in] layer The layer object to be set as the active layer.
632
649
  @related SUModelRef
633
650
  @return
634
651
  - \ref SU_ERROR_NONE on success
@@ -724,6 +741,10 @@ SU_RESULT SUModelGetLocation(SUModelRef model, SULocationRef* location);
724
741
 
725
742
  /**
726
743
  @brief Calculates the sum of all entities by type in the model.
744
+
745
+ @note See \ref SUEntityType for examples on how it is defined depending on
746
+ whether the code is compiled as C or C++. (Related to a bug in the original implementation).
747
+
727
748
  @param[in] model The model object.
728
749
  @param[out] statistics The SUModelStatistics() struct that will be populated
729
750
  with the number of each entity type in the model.
@@ -732,18 +753,36 @@ SU_RESULT SUModelGetLocation(SUModelRef model, SULocationRef* location);
732
753
  - \ref SU_ERROR_NONE on success
733
754
  - \ref SU_ERROR_INVALID_INPUT if model is not a valid object
734
755
  - \ref SU_ERROR_NULL_POINTER_OUTPUT if statistics is NULL
756
+
757
+ @see SUEntityType
758
+ @see SUModelStatistics
759
+ @see SUModelGetStatistics
760
+
761
+ @code
762
+ // Usage from a C compiler:
763
+ SUModelStatistics statistics;
764
+ SUModelGetStatistics(model, &statistics);
765
+ std::cout << "Faces: " << statistics.entity_counts[SUEntityType_Face] << "\n";
766
+ @endcode
767
+
768
+ @code
769
+ // Usage from a C++ compiler:
770
+ SUModelStatistics statistics;
771
+ SUModelGetStatistics(model, &statistics);
772
+ std::cout << "Faces: " << statistics.entity_counts[SUModelStatistics::SUEntityType_Face] << "\n";
773
+ @endcode
735
774
  */
736
775
  SU_RESULT SUModelGetStatistics(SUModelRef model, struct SUModelStatistics* statistics);
737
776
 
738
777
  /**
739
778
  @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.
779
+ @param[in,out] model The model object.
780
+ @param[in] latitude Latitude of the model.
781
+ @param[in] longitude Longitude of the model.
782
+ @param[in] altitude Altitude of the model.
783
+ @param[in] is_z_value_centered Indicates if z value should be centered.
784
+ @param[in] is_on_ocean_floor Indicates whether the model is on the ocean
785
+ floor.
747
786
  @related SUModelRef
748
787
  @return
749
788
  - \ref SU_ERROR_NONE on success
@@ -811,7 +850,7 @@ SU_RESULT SUModelGetNorthCorrection(SUModelRef model, double* north_correction);
811
850
 
812
851
  /**
813
852
  @brief Merges all adjacent, coplanar faces in the model.
814
- @param[in] model The model object.
853
+ @param[in,out] model The model object.
815
854
  @related SUModelRef
816
855
  @return
817
856
  - \ref SU_ERROR_NONE on success
@@ -859,9 +898,12 @@ SU_RESULT SUModelGetSceneWithName(SUModelRef model, const char* name, SUSceneRef
859
898
  least one scene name already exists in the model or if there are
860
899
  duplicated names in the scenes array.
861
900
 
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.
901
+ @note When adding a scene the current state of the model is saved to the scene
902
+ based on the \ref SUSceneFlags set on the scene prior to adding it.
903
+
904
+ @param[in,out] model The model object.
905
+ @param[in] len The number of scene objects to add.
906
+ @param[in] scenes The array of scene objects to add.
865
907
  @related SUModelRef
866
908
  @return
867
909
  - \ref SU_ERROR_NONE on success
@@ -879,10 +921,10 @@ SU_RESULT SUModelAddScenes(SUModelRef model, size_t len, const SUSceneRef scenes
879
921
  SketchUp SDK 2018 API 6.0 to return SU_ERROR_INVALID_ARGUMENT if the
880
922
  given scene name already exists in the model.
881
923
 
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.
924
+ @param[in,out] model The model object.
925
+ @param[in] index Where in the list to add the scene. -1 to place at the end.
926
+ @param[in] scene The scene object to add.
927
+ @param[out] out_index The index that the scene was added at.
886
928
  @related SUModelRef
887
929
  @return
888
930
  - \ref SU_ERROR_NONE on success
@@ -891,6 +933,21 @@ SU_RESULT SUModelAddScenes(SUModelRef model, size_t len, const SUSceneRef scenes
891
933
  */
892
934
  SU_RESULT SUModelAddScene(SUModelRef model, int index, SUSceneRef scene, int* out_index);
893
935
 
936
+ /**
937
+ @brief Reorder \p scene based on \p new_index to \p model object.
938
+ @since SketchUp 2025.0, API 13.0
939
+ @param[in,out] model The \p model object.
940
+ @param[in] scene The \p scene object to reorder.
941
+ @param[in] new_index The \p new_index where the scene should be placed.
942
+ @related SUModelRef
943
+ @return
944
+ - \ref SU_ERROR_NONE on success
945
+ - \ref SU_ERROR_INVALID_INPUT if \p model or \p scene are not a valid object
946
+ - \ref SU_ERROR_INVALID_ARGUMENT if \p scene does not exists within \p model
947
+ - \ref SU_ERROR_OUT_OF_RANGE if the \p new_index is greater than the number of scenes in the model
948
+ */
949
+ SU_RESULT SUModelReorderScene(SUModelRef model, SUSceneRef scene, size_t new_index);
950
+
894
951
  /**
895
952
  @brief Retrieves the active scene associated with a model object.
896
953
  @since SketchUp 2016, API 4.0
@@ -909,8 +966,8 @@ SU_RESULT SUModelGetActiveScene(SUModelRef model, SUSceneRef* scene);
909
966
  /**
910
967
  @brief Sets the provided scene as the active scene.
911
968
  @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.
969
+ @param[in,out] model The model object.
970
+ @param[in] scene The scene object to be set as the active scene.
914
971
  @related SUModelRef
915
972
  @return
916
973
  - \ref SU_ERROR_NONE on success
@@ -922,11 +979,11 @@ SU_RESULT SUModelSetActiveScene(SUModelRef model, SUSceneRef scene);
922
979
  /**
923
980
  @brief Adds a single matched photo scene to a model object.
924
981
  @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.
982
+ @param[in,out] model The model object.
983
+ @param[in] image_file The full path of the image associated with this scene.
984
+ @param[in] camera The camera associated with this scene.
985
+ @param[in] scene_name The name of the scene to add.
986
+ @param[out] scene The scene object created.
930
987
  @related SUModelRef
931
988
  @return
932
989
  - \ref SU_ERROR_NONE on success
@@ -955,8 +1012,8 @@ SU_RESULT SUModelGetName(SUModelRef model, SUStringRef* name);
955
1012
 
956
1013
  /**
957
1014
  @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.
1015
+ @param[in,out] model The model object.
1016
+ @param[in] name The name of the model object. Assumed to be UTF-8 encoded.
960
1017
  @related SUModelRef
961
1018
  @return
962
1019
  - \ref SU_ERROR_NONE on success
@@ -1011,9 +1068,9 @@ SU_RESULT SUModelGetDescription(SUModelRef model, SUStringRef* description);
1011
1068
 
1012
1069
  /**
1013
1070
  @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.
1071
+ @param[in,out] model The model object.
1072
+ @param[in] description The description of the model object. Assumed to be UTF-8
1073
+ encoded.
1017
1074
  @related SUModelRef
1018
1075
  @return
1019
1076
  - \ref SU_ERROR_NONE on success
@@ -1107,6 +1164,8 @@ SU_RESULT SUModelGetNumFonts(SUModelRef model, size_t* count);
1107
1164
 
1108
1165
  /**
1109
1166
  @brief Retrieves all the fonts associated with a model object.
1167
+ @note The returned font references may become invalid if another font is
1168
+ assigned to objects using them later.
1110
1169
  @since SketchUp 2017, API 5.0
1111
1170
  @param[in] model The model object.
1112
1171
  @param[in] len The number of font objects to retrieve.
@@ -1120,6 +1179,81 @@ SU_RESULT SUModelGetNumFonts(SUModelRef model, size_t* count);
1120
1179
  */
1121
1180
  SU_RESULT SUModelGetFonts(SUModelRef model, size_t len, SUFontRef fonts[], size_t* count);
1122
1181
 
1182
+ /**
1183
+ @brief Current version of the SUFontInfo struct
1184
+ @related SUFontRef
1185
+ */
1186
+ #define SU_FONT_INFO_VERSION 1
1187
+
1188
+ /**
1189
+ @struct SUFontInfo
1190
+ @brief Information about the font that is to be created by SUModelAddFont.
1191
+ @since SketchUp 2026.0, API 14.0
1192
+ @related SUFontRef
1193
+ */
1194
+ struct SUFontInfo {
1195
+ /**
1196
+ Version of the SUFontInfo struct. Must be set to SU_FONT_INFO_VERSION.
1197
+ */
1198
+ unsigned int version;
1199
+
1200
+ /**
1201
+ Name of the font. Assumed to be UTF-8 encoded.
1202
+ */
1203
+ const char* font_name;
1204
+
1205
+ /**
1206
+ Boldness of the font (true for bold, false for normal).
1207
+ */
1208
+ bool is_bold;
1209
+
1210
+ /**
1211
+ Italic (true for italic, false for normal).
1212
+ */
1213
+ bool is_italic;
1214
+
1215
+ /**
1216
+ 2D font size in screen points (when use_world_size is false).
1217
+ */
1218
+ int point_size;
1219
+
1220
+ /**
1221
+ Which sizing style to use.
1222
+
1223
+ - true: font size scales relative to in-model 3D objects.
1224
+ - false: font size stays constant on user's screen.
1225
+ */
1226
+ bool use_world_size;
1227
+
1228
+ /**
1229
+ 3D font size in inches (when use_world_size is true).
1230
+ */
1231
+ double world_size;
1232
+ };
1233
+
1234
+ /**
1235
+ @brief Returns an object reference to a font object based on font_info.
1236
+ @note The returned font reference may be for either an existing object in the
1237
+ model or a new in-model object if none existed previously. It may also
1238
+ become invalid if assigned to an object which later has a different font
1239
+ assigned to it.
1240
+ @since SketchUp 2026.0, API 14.0
1241
+ @param[in] model_ref The model font is to be associated with.
1242
+ @param[in] font_info Struct that defines all parameters of the new font.
1243
+ @param[out] added_font_ref The font object returned.
1244
+ @related SUFontRef
1245
+ @return
1246
+ - \ref SU_ERROR_NONE on success
1247
+ - \ref SU_ERROR_INVALID_INPUT if \p model_ref is not a valid object
1248
+ - \ref SU_ERROR_NULL_POINTER_INPUT if \p font_info is NULL
1249
+ - \ref SU_ERROR_INVALID_ARGUMENT if \p font_info contains invalid data
1250
+ - \ref SU_ERROR_OUT_OF_RANGE if \p font_info contains values that are out of range
1251
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p added_font_ref is NULL
1252
+ - \ref SU_ERROR_OVERWRITE_VALID if \p added_font_ref already references a valid object
1253
+ */
1254
+ SU_RESULT SUModelAddFont(
1255
+ SUModelRef model_ref, const struct SUFontInfo* font_info, SUFontRef* added_font_ref);
1256
+
1123
1257
  /**
1124
1258
  @brief Retrieves the dimension style associated with a model object.
1125
1259
  @since SketchUp 2017, API 5.0
@@ -1174,7 +1308,7 @@ SU_RESULT SUModelGenerateUniqueMaterialName(
1174
1308
  /**
1175
1309
  @brief Fixes any errors found in the given model.
1176
1310
  @since SketchUp 2018, API 6.0
1177
- @param[in] model The model object.
1311
+ @param[in,out] model The model object.
1178
1312
  @related SUModelRef
1179
1313
  @return
1180
1314
  - \ref SU_ERROR_NONE on success
@@ -1186,8 +1320,8 @@ SU_RESULT SUModelFixErrors(SUModelRef model);
1186
1320
  @brief Updates the faces in the model so that they are oriented
1187
1321
  consistently.
1188
1322
  @since SketchUp 2018, API 6.0
1189
- @param[in] model The model object.
1190
- @param[in] recurse_components Orient components of the model.
1323
+ @param[in,out] model The model object.
1324
+ @param[in] recurse_components Orient components of the model.
1191
1325
  @related SUModelRef
1192
1326
  @return
1193
1327
  - \ref SU_ERROR_NONE on success
@@ -1215,9 +1349,9 @@ SU_RESULT SUModelGetLineStyles(SUModelRef model, SULineStylesRef* line_styles);
1215
1349
  SUModelLoadDefinitionWithStatus() which can load components
1216
1350
  saved by newer versions of SketchUp.
1217
1351
  @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.
1352
+ @param[in,out] model The model object.
1353
+ @param[in] filename The full path and filename to a SkethchUp model.
1354
+ @param[out] definition The component definition that is created after load.
1221
1355
  @related SUModelRef
1222
1356
  @return
1223
1357
  - \ref SU_ERROR_NONE on success
@@ -1242,12 +1376,12 @@ SU_RESULT SUModelLoadDefinition(
1242
1376
  @warning When reading a file created with a newer version of SketchUp, you may lose data
1243
1377
  if you write over the same file.
1244
1378
 
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.
1379
+ @param[in,out] model The model object.
1380
+ @param[in] filename The full path and filename to a SkethchUp model.
1381
+ @param[out] definition The component definition that is created after load.
1382
+ @param[out] status Returns additional information on the status of a
1383
+ successful operation. Valid when the return value is
1384
+ \ref SU_ERROR_NONE.
1251
1385
  @related SUModelRef
1252
1386
  @return
1253
1387
  - \ref SU_ERROR_NONE on success
@@ -1267,9 +1401,9 @@ SU_RESULT SUModelLoadDefinitionWithStatus(
1267
1401
  /**
1268
1402
  @brief Removes all materials provided in the array.
1269
1403
  @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.
1404
+ @param[in,out] model The model object.
1405
+ @param[in] len The length of the array.
1406
+ @param[in] materials The materials to be deleted.
1273
1407
  @related SUModelRef
1274
1408
  @return
1275
1409
  - \ref SU_ERROR_NONE on success
@@ -1284,9 +1418,9 @@ SU_RESULT SUModelRemoveMaterials(SUModelRef model, size_t len, SUMaterialRef mat
1284
1418
  /**
1285
1419
  @brief Removes selected scenes from a model.
1286
1420
  @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.
1421
+ @param[in,out] model The model object.
1422
+ @param[in] len The number of scenes in the array for removal.
1423
+ @param[in] scenes The scenes to be deleted from the model.
1290
1424
  @related SUModelRef
1291
1425
  @return
1292
1426
  - \ref SU_ERROR_NONE on success
@@ -1474,13 +1608,13 @@ SU_RESULT SUModelGetNumLayerFolders(SUModelRef model, size_t* count);
1474
1608
  - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p layer_folders or \p count is NULL
1475
1609
  */
1476
1610
  SU_RESULT SUModelGetLayerFolders(
1477
- SUModelRef model, size_t len, SULayerFolderRef* layer_folders, size_t* count);
1611
+ SUModelRef model, size_t len, SULayerFolderRef layer_folders[], size_t* count);
1478
1612
 
1479
1613
  /**
1480
1614
  @brief Removes empty \ref SULayerFolderRef objects from the model.
1481
1615
  @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,
1616
+ @param[in,out] model The model object.
1617
+ @param[out] count The number of empty layer folders removed. If NULL,
1484
1618
  count will not be retrieved.
1485
1619
  @related SUModelRef
1486
1620
  @return
@@ -1492,8 +1626,8 @@ SU_RESULT SUModelPurgeEmptyLayerFolders(SUModelRef model, size_t* count);
1492
1626
  /**
1493
1627
  @brief Adds a \ref SULayerFolderRef object to the model.
1494
1628
  @since SketchUp 2021.0, API 9.0
1495
- @param[in] model The model object.
1496
- @param[in] layer_folder The layer folder to add.
1629
+ @param[in,out] model The model object.
1630
+ @param[in] layer_folder The layer folder to add.
1497
1631
  @related SUModelRef
1498
1632
  @return
1499
1633
  - \ref SU_ERROR_NONE on success
@@ -1507,9 +1641,9 @@ SU_RESULT SUModelAddLayerFolder(SUModelRef model, SULayerFolderRef layer_folder)
1507
1641
  /**
1508
1642
  @brief Removes unused \ref SULayerRef objects from the model.
1509
1643
  @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.
1644
+ @param[in,out] model The model object.
1645
+ @param[out] count The number of layers deleted. If NULL, count
1646
+ will not be retrieved.
1513
1647
  @related SUModelRef
1514
1648
  @return
1515
1649
  - \ref SU_ERROR_NONE on success
@@ -1554,9 +1688,9 @@ SU_RESULT SUModelGetTopLevelLayers(
1554
1688
  @brief Removes all layer folders provided in the array. All children of the
1555
1689
  deleted layer folders will be moved to the parent of the deleted folder.
1556
1690
  @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.
1691
+ @param[in,out] model The model object.
1692
+ @param[in] len The length of the array.
1693
+ @param[in] layer_folders The layer folders to be deleted.
1560
1694
  @related SUModelRef
1561
1695
  @return
1562
1696
  - \ref SU_ERROR_NONE on success
@@ -1640,8 +1774,8 @@ SU_RESULT SUModelGetBehavior(SUModelRef model, struct SUComponentBehavior* behav
1640
1774
  /**
1641
1775
  @brief Sets the component behavior of a SketchUp model.
1642
1776
  @since SketchUp 2021.1, API 9.1
1643
- @param[in] model The model object.
1644
- @param[in] behavior The behavior to set.
1777
+ @param[in,out] model The model object.
1778
+ @param[in] behavior The behavior to set.
1645
1779
  @related SUModelRef
1646
1780
  @return
1647
1781
  - \ref SU_ERROR_NONE on success
@@ -1650,6 +1784,35 @@ SU_RESULT SUModelGetBehavior(SUModelRef model, struct SUComponentBehavior* behav
1650
1784
  */
1651
1785
  SU_RESULT SUModelSetBehavior(SUModelRef model, const struct SUComponentBehavior* behavior);
1652
1786
 
1787
+ /**
1788
+ * @brief Retrieves the number of active section planes in the model.
1789
+ * @since SketchUp 2025.1, API 13.1
1790
+ * @param[in] model The model object.
1791
+ * @param[out] count The number of active section planes.
1792
+ * @related SUModelRef
1793
+ * @return
1794
+ * - \ref SU_ERROR_NONE on success
1795
+ * - \ref SU_ERROR_INVALID_INPUT if \p model is not a valid object
1796
+ * - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p count is `NULL`
1797
+ */
1798
+ SU_RESULT SUModelGetNumActiveSectionPlanes(SUModelRef model, size_t* count);
1799
+
1800
+ /**
1801
+ * @brief Retrieves the active section planes in the model.
1802
+ * @since SketchUp 2025.1, API 13.1
1803
+ * @param[in] model The model object.
1804
+ * @param[in] len The number of active section planes to retrieve.
1805
+ * @param[out] active_section_planes The active section planes retrieved.
1806
+ * @param[out] count The number of active section planes retrieved.
1807
+ * @related SUModelRef
1808
+ * @return
1809
+ * - \ref SU_ERROR_NONE on success
1810
+ * - \ref SU_ERROR_INVALID_INPUT if \p model is not a valid object
1811
+ * - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p active_section_planes or \p count is `NULL`
1812
+ */
1813
+ SU_RESULT SUModelGetActiveSectionPlanes(
1814
+ SUModelRef model, size_t len, SUSectionPlaneRef active_section_planes[], size_t* count);
1815
+
1653
1816
  #ifdef __cplusplus
1654
1817
  }
1655
1818
  #endif
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @file
3
+ * @brief Definition for \ref SUEntityType. Don't include directly.
4
+ *
5
+ * @warning Do not include this header directly. This file is part of a
6
+ * compatibility shim. Instead include `SketchUpAPI/model.h`.
7
+ */
8
+
9
+ /**
10
+ @enum SUEntityType
11
+ @headerfile <SketchUpAPI/model.h>
12
+ @brief Types of \ref SUEntityRef objects.
13
+
14
+ @see SUModelStatistics
15
+
16
+ @bug This enum was incorrectly defined inside the \ref SUModelStatistics struct. This is
17
+ not valid C. As of SketchUp 2025.0 (API 13.0), this enum is conditionally defined outside
18
+ of the struct when the header is consumed by a C compiler.
19
+
20
+ @code
21
+ // Usage from a C compiler:
22
+ SUModelStatistics statistics;
23
+ SUModelGetStatistics(model, &statistics);
24
+ std::cout << "Faces: " << statistics.entity_counts[SUEntityType_Face] << "\n";
25
+ @endcode
26
+
27
+ @code
28
+ // Usage from a C++ compiler:
29
+ SUModelStatistics statistics;
30
+ SUModelGetStatistics(model, &statistics);
31
+ std::cout << "Faces: " << statistics.entity_counts[SUModelStatistics::SUEntityType_Face] << "\n";
32
+ @endcode
33
+ */
34
+ enum SUEntityType {
35
+ SUEntityType_Edge = 0, ///< SUEdgeRef entities
36
+ SUEntityType_Face, ///< SUFaceRef entities
37
+ SUEntityType_ComponentInstance, ///< SUComponentInstanceRef entities
38
+ SUEntityType_Group, ///< SUGroupRef entities
39
+ SUEntityType_Image, ///< SUImageRef entities
40
+ SUEntityType_ComponentDefinition, ///< SUComponentDefinitionRef entities
41
+ SUEntityType_Layer, ///< SULayerRef entities
42
+ SUEntityType_Material, ///< SUMaterialRef entities
43
+ SUNumEntityTypes ///< Number of entity types
44
+ };