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 2015 Trimble Inc., All rights reserved.
1
+ // Copyright 2015-2024 Trimble Inc. All rights reserved.
2
2
  // This file is intended for public distribution.
3
3
 
4
4
  /**
@@ -90,13 +90,9 @@ typedef wchar_t unichar; ///< A platform-independent UTF16 type.
90
90
  #endif // GSLAPI_API_EXPORTS
91
91
  #endif // WINDOWS
92
92
 
93
- #if defined __APPLE__
93
+ #if defined __APPLE__ && !defined GSLAPI_NO_EXPORTS
94
94
  #undef SU_EXPORT
95
- #ifdef GSLAPI_API_EXPORTS
96
- #define SU_EXPORT __attribute__((visibility("default")))
97
- #else
98
- #define SU_EXPORT __attribute__((visibility("hidden")))
99
- #endif
95
+ #define SU_EXPORT __attribute__((visibility("default")))
100
96
  #endif // #if defined __APPLE__
101
97
 
102
98
  #define DEFINE_SU_TYPE(TYPENAME) \
@@ -104,8 +100,6 @@ typedef wchar_t unichar; ///< A platform-independent UTF16 type.
104
100
  void* ptr; \
105
101
  } TYPENAME;
106
102
 
107
- // #define SU_RESULT SU_EXPORT enum SUResult
108
-
109
103
  #endif // DOXYGEN_SHOULD_SKIP_THIS
110
104
 
111
105
  /**
@@ -158,6 +152,12 @@ typedef unsigned __int32 uint32_t;
158
152
  #include <stdint.h>
159
153
  #endif // #if !defined(__STDC_HOSTED__) || (__STDC_HOSTED__ == 0)
160
154
 
155
+ #ifndef __cplusplus
156
+ // C compilers need this header for the bool type.
157
+ // This header maps bool to C99's _Bool type.
158
+ #include <stdbool.h>
159
+ #endif
160
+
161
161
  /**
162
162
  @brief This macro is used to indicate if functions are intended to be
163
163
  deprecated. If you would like to hide the deprecation warnings simply
@@ -42,7 +42,15 @@ struct SUExtensionLicense {
42
42
  };
43
43
 
44
44
  /**
45
- @brief Acquires a license for a given extension.
45
+ @brief Gets a license for a given extension.
46
+
47
+ Starting in SketchUp 2025.0 (API 13.0), this function automatically tries to fetch a license from
48
+ Extension Warehouse if the extension doesn't have a license on the current device. This only works
49
+ if the user is signed in. In earlier SketchUp versions, the user has to go to Extension Manager,
50
+ expand the extension in question and press Update License if the license is missing. (For
51
+ performance reasons this automatic fetching is skipped during SketchUp startup. Make sure to do a
52
+ license check when the user interacts with the extension).
53
+
46
54
  @param[in] extension_id The Extension Warehouse UUID for the extension.
47
55
  @param[out] out_license the licensing retrieved.
48
56
  @related SUExtensionLicense
@@ -62,11 +62,11 @@ SU_RESULT SUPoint2DOffset(
62
62
  const struct SUPoint2D* point1, const struct SUVector2D* vector, struct SUPoint2D* point2);
63
63
 
64
64
  /**
65
- @brief Gets the distance between two point objects.
65
+ @brief Gets the distance between two point objects, in inches.
66
66
  @since SketchUp 2017, API 5.0
67
67
  @param[in] point1 The first point object.
68
68
  @param[in] point2 The second point object.
69
- @param[out] distance The distance between the two points.
69
+ @param[out] distance The distance between the two points, in inches.
70
70
  @related SUPoint2D
71
71
  @return
72
72
  - \ref SU_ERROR_NONE on success
@@ -63,11 +63,11 @@ SU_RESULT SUPoint3DOffset(
63
63
  const struct SUPoint3D* point1, const struct SUVector3D* vector, struct SUPoint3D* point2);
64
64
 
65
65
  /**
66
- @brief Gets the distance between two point objects.
66
+ @brief Gets the distance between two point objects, in inches.
67
67
  @since SketchUp 2018 M0, API 6.0
68
68
  @param[in] point1 The first point object.
69
69
  @param[in] point2 The second point object.
70
- @param[out] distance The distance between the two points.
70
+ @param[out] distance The distance between the two points, in inches.
71
71
  @related SUPoint3D
72
72
  @return
73
73
  - \ref SU_ERROR_NONE on success
@@ -62,7 +62,7 @@ SU_RESULT SUTransformation2DNonUniformScale(
62
62
  @since SketchUp 2019, API 7.0
63
63
  @param[out] transform The transformation to be set.
64
64
  @param[in] point The point specifying the translation component of the
65
- transformation.
65
+ transformation. The coordinates of the point are in inches.
66
66
  @param[in] scale The scale value for the transformation.
67
67
  @related SUTransformation2D
68
68
  @return
@@ -78,7 +78,7 @@ SU_RESULT SUTransformation2DScaleAboutPoint(
78
78
  @since SketchUp 2019, API 7.0
79
79
  @param[out] transform The transformation to be set.
80
80
  @param[in] point The point specifying the translation component of the
81
- transformation.
81
+ transformation. The coordinates of the point should be expressed in inches.
82
82
  @param[in] x_scale The x-axis scale value for the transformation.
83
83
  @param[in] y_scale The y-axis scale value for the transformation.
84
84
  @related SUTransformation2D
@@ -96,7 +96,7 @@ SU_RESULT SUTransformation2DNonUniformScaleAboutPoint(
96
96
  @since SketchUp 2019, API 7.0
97
97
  @param[out] transform The calculated transformation.
98
98
  @param[in] point The point specifying the translation component of the
99
- transformation.
99
+ transformation. The coordinates of the point should be expressed in inches.
100
100
  @param[in] angle The rotation in radians for the transformation.
101
101
  @related SUTransformation2D
102
102
  @return
@@ -121,7 +121,7 @@ SU_RESULT SUVector2DNormalize(struct SUVector2D* vector);
121
121
  /**
122
122
  @brief Reverses a vector.
123
123
  @since SketchUp 2017, API 5.0
124
- @param[in] vector The vector object.
124
+ @param[in,out] vector The vector object.
125
125
  @related SUVector2D
126
126
  @return
127
127
  - \ref SU_ERROR_NONE on success
@@ -173,10 +173,10 @@ SU_RESULT SUVector2DCross(
173
173
  SU_RESULT SUVector2DIsUnitVector(const struct SUVector2D* vector, bool* is_unit_vector);
174
174
 
175
175
  /**
176
- @brief Gets the length of a vector.
176
+ @brief Gets the length of a vector, in inches.
177
177
  @since SketchUp 2017, API 5.0
178
178
  @param[in] vector The vector object.
179
- @param[out] length The length of the vector.
179
+ @param[out] length The length of the vector, in inches.
180
180
  @related SUVector2D
181
181
  @return
182
182
  - \ref SU_ERROR_NONE on success
@@ -186,10 +186,10 @@ SU_RESULT SUVector2DIsUnitVector(const struct SUVector2D* vector, bool* is_unit_
186
186
  SU_RESULT SUVector2DGetLength(const struct SUVector2D* vector, double* length);
187
187
 
188
188
  /**
189
- @brief Sets the length of a vector.
189
+ @brief Sets the length of a vector, in inches.
190
190
  @since SketchUp 2017, API 5.0
191
191
  @param[in,out] vector The vector object.
192
- @param[in] length The new length the vector should be.
192
+ @param[in] length The new length the vector should be, in inches.
193
193
  @related SUVector2D
194
194
  @return
195
195
  - \ref SU_ERROR_NONE on success
@@ -187,10 +187,10 @@ SU_RESULT SUVector3DCross(
187
187
  SU_RESULT SUVector3DIsUnitVector(const struct SUVector3D* vector, bool* is_unit_vector);
188
188
 
189
189
  /**
190
- @brief Gets the length of a vector.
190
+ @brief Gets the length of a vector, in inches.
191
191
  @since SketchUp 2018, API 6.0
192
192
  @param[in] vector The vector object.
193
- @param[out] length The length of the vector.
193
+ @param[out] length The length of the vector, in inches.
194
194
  @related SUVector3D
195
195
  @return
196
196
  - \ref SU_ERROR_NONE on success
@@ -200,10 +200,10 @@ SU_RESULT SUVector3DIsUnitVector(const struct SUVector3D* vector, bool* is_unit_
200
200
  SU_RESULT SUVector3DGetLength(const struct SUVector3D* vector, double* length);
201
201
 
202
202
  /**
203
- @brief Sets the length of a vector.
203
+ @brief Sets the length of a vector, in inches.
204
204
  @since SketchUp 2018, API 6.0
205
205
  @param[in,out] vector The vector object.
206
- @param[in] length The new length the vector should be.
206
+ @param[in] length The new length the vector should be, in inches.
207
207
  @related SUVector3D
208
208
  @return
209
209
  - \ref SU_ERROR_NONE on success
@@ -18,7 +18,7 @@ extern "C" {
18
18
 
19
19
  /**
20
20
  @struct SUPoint2D
21
- @brief Represents a point in 2-dimensional space.
21
+ @brief Represents a point in 2-dimensional space. The coordinates are represented in inches.
22
22
  */
23
23
  struct SUPoint2D {
24
24
  double x; ///< X coordinate
@@ -27,7 +27,7 @@ struct SUPoint2D {
27
27
 
28
28
  /**
29
29
  @struct SUVector2D
30
- @brief Represents a vector in 2-dimensional space.
30
+ @brief Represents a vector in 2-dimensional space. The magnitudes are represented in inches.
31
31
  */
32
32
  struct SUVector2D {
33
33
  double x; ///< X magnitude
@@ -36,7 +36,7 @@ struct SUVector2D {
36
36
 
37
37
  /**
38
38
  @struct SUPoint3D
39
- @brief Represents a point in 3-dimensional space.
39
+ @brief Represents a point in 3-dimensional space. The coordinates are represented in inches.
40
40
  */
41
41
  struct SUPoint3D {
42
42
  double x; ///< X coordinate
@@ -46,7 +46,7 @@ struct SUPoint3D {
46
46
 
47
47
  /**
48
48
  @struct SUVector3D
49
- @brief Represents a vector in 3-dimensional space.
49
+ @brief Represents a vector in 3-dimensional space. The magnitudes are represented in inches.
50
50
  */
51
51
  struct SUVector3D {
52
52
  double x; ///< X magnitude
@@ -70,7 +70,8 @@ struct SUPlane3D {
70
70
  /**
71
71
  @struct SUBoundingBox3D
72
72
  @brief Represents a 3D axis-aligned bounding box represented by the extreme
73
- diagonal corner points with minimum and maximum x,y,z coordinates.
73
+ diagonal corner points with minimum and maximum x,y,z coordinates. The coordinates of the
74
+ points are in inches.
74
75
  */
75
76
  struct SUBoundingBox3D {
76
77
  struct SUPoint3D min_point; ///< A 3D point where x, y and z are minimum
@@ -82,7 +83,7 @@ struct SUBoundingBox3D {
82
83
  /**
83
84
  @struct SUAxisAlignedRect2D
84
85
  @brief Represents a 2D rectangle that is aligned with the X and Y axis of the
85
- coordinate system.
86
+ coordinate system. The coordinates of the points of the rectangle are in inches.
86
87
  */
87
88
  struct SUAxisAlignedRect2D {
88
89
  struct SUPoint2D upper_left; ///< Upper left corner of the bounding box.
@@ -91,7 +92,8 @@ struct SUAxisAlignedRect2D {
91
92
 
92
93
  /**
93
94
  @struct SURay3D
94
- @brief Represents a 3D ray defined by a point and normal vector.
95
+ @brief Represents a 3D ray defined by a point and normal vector. The coordinates of the point are
96
+ represented in inches.
95
97
  @since SketchUp 2018, API 6.0
96
98
  */
97
99
  struct SURay3D {
@@ -18,7 +18,7 @@ enum SketchUpOptionsDialogResponse {
18
18
  IMPORTER_OPTIONS_ACCEPTED = 2 ///< Importer options accepted.
19
19
  };
20
20
 
21
- /** Return type of GetImporterBehavior(). */
21
+ /** @brief Return type of GetImporterBehavior(). */
22
22
  enum SketchUpModelImporterBehavior {
23
23
  IMPORT_MODEL_AT_ORIGIN = 0, ///< Preserves coordinates of the imported
24
24
  ///< geometry.
@@ -123,7 +123,7 @@ class SketchUpModelImporterInterface {
123
123
  @brief This performs the conversion from the selected input file to the
124
124
  given temporary output file using options set during the
125
125
  ShowOptionsDialog method. The output file is then inserted into
126
- the current model using rules defined by the GetImporterBehavior
126
+ the current model using rules defined by the GetImporterBehavior()
127
127
  method.
128
128
  @param[in] input The user selected input file. The file
129
129
  name is specified in UTF-8 and may
@@ -143,15 +143,19 @@ class SketchUpModelImporterInterface {
143
143
  virtual bool ConvertToSkp(
144
144
  const std::string& input, const std::string& output_skp,
145
145
  SketchUpPluginProgressCallback* progress, void* reserved) = 0;
146
+
146
147
  /**
147
148
  @brief Displays a modal dialog showing an optional summary of the import
148
- process. The default does nothing. Note that Ruby scripting often
149
- disables this dialog.
149
+ process.
150
+
151
+ The default does nothing.
150
152
  */
151
153
  virtual void ShowSummaryDialog() {
152
154
  }
155
+
153
156
  /**
154
157
  @brief Defines the method SketchUp uses when placing the imported model.
158
+ @return The import behavior SketchUp should use when importing the model.
155
159
  */
156
160
  virtual SketchUpModelImporterBehavior GetImporterBehavior() const {
157
161
  return IMPORT_MODEL_PRESERVE_ORIGIN;
@@ -92,10 +92,10 @@ SU_RESULT SUAttributeDictionaryGetName(SUAttributeDictionaryRef dictionary, SUSt
92
92
 
93
93
  /**
94
94
  @brief Inserts a key-value pair into an attribute dictionary object.
95
- @param[in] dictionary The attribute dictionary object.
96
- @param[in] key The key of the key-value pair. Assumed to be UTF-8
97
- encoded.
98
- @param[in] value_in The value of the key-value pair.
95
+ @param[in,out] dictionary The attribute dictionary object.
96
+ @param[in] key The key of the key-value pair. Assumed to be UTF-8
97
+ encoded.
98
+ @param[in] value_in The value of the key-value pair.
99
99
  @related SUAttributeDictionaryRef
100
100
  @return
101
101
  - \ref SU_ERROR_NONE on success
@@ -1,4 +1,4 @@
1
- // Copyright 2013-2020 Trimble Inc. All Rights Reserved.
1
+ // Copyright 2013-2024 Trimble Inc. All Rights Reserved.
2
2
 
3
3
  /**
4
4
  * @file
@@ -34,24 +34,30 @@ extern "C" {
34
34
  @brief References a component definition.
35
35
  */
36
36
 
37
+ // The SUSnapToBehavior enum was originally defined incorrectly in this struct.
38
+ // This is not valid C. To correct this we conditionally include it in here for
39
+ // C compilers, while leaving the original definition inside the struct for C++
40
+ // compilers.
41
+ #ifndef __cplusplus
42
+ #include <SketchUpAPI/model/component_definition_snap_to_behavior_private.h>
43
+ #endif
44
+
37
45
  /**
38
46
  @struct SUComponentBehavior
39
47
  @brief Describes how the component behaves in a SketchUp model, e.g. how it glues to surfaces.
48
+
49
+ @note See \ref SUSnapToBehavior for examples on how it is defined depending on
50
+ whether the code is compiled as C or C++. (Related to a bug in the original implementation).
51
+
52
+ @see SUSnapToBehavior
53
+ @see SUComponentDefinitionGetBehavior
54
+ @see SUComponentDefinitionSetBehavior
40
55
  */
41
56
  struct SUComponentBehavior {
42
- /**
43
- @enum SUSnapToBehavior
44
- @brief Describes how the component instance can be placed when a user adds
45
- it to a model. For example a window component instance should snap
46
- to a vertical plane.
47
- */
48
- enum SUSnapToBehavior {
49
- SUSnapToBehavior_None = 0,
50
- SUSnapToBehavior_Any,
51
- SUSnapToBehavior_Horizontal,
52
- SUSnapToBehavior_Vertical,
53
- SUSnapToBehavior_Sloped
54
- };
57
+ #ifdef __cplusplus
58
+ // See the note above for why this is included here.
59
+ #include <SketchUpAPI/model/component_definition_snap_to_behavior_private.h>
60
+ #endif
55
61
 
56
62
  /**
57
63
  How the component should snap to the surface where it's placed.
@@ -167,7 +173,7 @@ SU_RESULT SUComponentDefinitionCreate(SUComponentDefinitionRef* comp_def);
167
173
  the provided definition was contained by a model, use
168
174
  SUModelRemoveComponentDefinitions() to remove the definition and all
169
175
  instances.
170
- @param[in] comp_def The component definition object.
176
+ @param[in,out] comp_def The component definition object.
171
177
  @related SUComponentDefinitionRef
172
178
  @return
173
179
  - \ref SU_ERROR_NONE on success
@@ -196,10 +202,10 @@ SU_RESULT SUComponentDefinitionGetName(SUComponentDefinitionRef comp_def, SUStri
196
202
  @bug Before SketchUp 2022.0.1 (API 10.0) this would not ensure the definition name was unique.
197
203
  As of SketchUp 2022.0.1 the component will be given a unique name automatically if needed.
198
204
 
199
- @param[in] comp_def The component definition object.
200
- @param[in] name The name of the component definition. Assumed to be UTF-8
201
- encoded. If the requested name already belongs to another definition in the model,
202
- a unique name will be generated based on this name.
205
+ @param[in,out] comp_def The component definition object.
206
+ @param[in] name The name of the component definition. Assumed to be UTF-8
207
+ encoded. If the requested name already belongs to another definition in the
208
+ model, a unique name will be generated based on this name.
203
209
  @related SUComponentDefinitionRef
204
210
  @return
205
211
  - \ref SU_ERROR_NONE on success
@@ -231,8 +237,8 @@ SU_RESULT SUComponentDefinitionGetGuid(SUComponentDefinitionRef comp_def, SUStri
231
237
 
232
238
  /**
233
239
  @brief Retrieves the entities of the component definition.
234
- @param[in] comp_def The component definition object.
235
- @param[out] entities The entities retrieved.
240
+ @param[in,out] comp_def The component definition object.
241
+ @param[out] entities The entities retrieved.
236
242
  @related SUComponentDefinitionRef
237
243
  @return
238
244
  - \ref SU_ERROR_NONE on success
@@ -258,8 +264,8 @@ SU_RESULT SUComponentDefinitionGetDescription(SUComponentDefinitionRef comp_def,
258
264
 
259
265
  /**
260
266
  @brief Sets the description of the component definition.
261
- @param[in] comp_def The component definition object.
262
- @param[in] desc The description to be set. Assumed to be UTF-8 encoded.
267
+ @param[in,out] comp_def The component definition object.
268
+ @param[in] desc The description to be set. Assumed to be UTF-8 encoded.
263
269
  @related SUComponentDefinitionRef
264
270
  @return
265
271
  - \ref SU_ERROR_NONE on success
@@ -347,34 +353,52 @@ SU_RESULT SUComponentDefinitionGetInstances(
347
353
 
348
354
  /**
349
355
  @brief Retrieves the behavior of a component definition.
356
+
357
+ @note See \ref SUSnapToBehavior for examples on how it is defined depending on
358
+ whether the code is compiled as C or C++. (Related to a bug in the original implementation).
359
+
350
360
  @param[in] comp_def The component definition object.
351
361
  @param[out] behavior The behavior retrieved.
352
362
  @related SUComponentDefinitionRef
353
363
  @return
354
364
  - \ref SU_ERROR_NONE on success
355
365
  - \ref SU_ERROR_INVALID_INPUT if comp_def is invalid
366
+
367
+ @see SUSnapToBehavior
368
+ @see SUComponentBehavior
369
+ @see SUComponentDefinitionGetBehavior
370
+ @see SUComponentDefinitionSetBehavior
356
371
  */
357
372
  SU_RESULT SUComponentDefinitionGetBehavior(
358
373
  SUComponentDefinitionRef comp_def, struct SUComponentBehavior* behavior);
359
374
 
360
375
  /**
361
376
  @brief Sets the component behavior of a component definition.
362
- @param[in] comp_def The component definition object.
363
- @param[in] behavior The behavior to set.
377
+
378
+ @note See \ref SUSnapToBehavior for examples on how it is defined depending on
379
+ whether the code is compiled as C or C++. (Related to a bug in the original implementation).
380
+
381
+ @param[in,out] comp_def The component definition object.
382
+ @param[in] behavior The behavior to set.
364
383
  @related SUComponentDefinitionRef
365
384
  @return
366
385
  - \ref SU_ERROR_NONE on success
367
386
  - \ref SU_ERROR_INVALID_INPUT if comp_def is invalid
368
387
  - \ref SU_ERROR_NULL_POINTER_INPUT if behavior is NULL
388
+
389
+ @see SUSnapToBehavior
390
+ @see SUComponentBehavior
391
+ @see SUComponentDefinitionGetBehavior
392
+ @see SUComponentDefinitionSetBehavior
369
393
  */
370
394
  SU_RESULT SUComponentDefinitionSetBehavior(
371
395
  SUComponentDefinitionRef comp_def, const struct SUComponentBehavior* behavior);
372
396
 
373
397
  /**
374
398
  @brief Applies a schema type from a schema to a component definition.
375
- @param[in] comp_def The component definition object.
376
- @param[in] schema_ref The schema that owns the schema type to apply.
377
- @param[in] schema_type_ref The schema type to apply.
399
+ @param[in,out] comp_def The component definition object.
400
+ @param[in] schema_ref The schema that owns the schema type to apply.
401
+ @param[in] schema_type_ref The schema type to apply.
378
402
  @related SUComponentDefinitionRef
379
403
  @return
380
404
  - \ref SU_ERROR_NONE on success
@@ -463,6 +487,10 @@ SU_RESULT SUComponentDefinitionGetOpenings(
463
487
  /**
464
488
  @brief Retrieves the insertion point from the component definition.
465
489
  @since SketchUp 2016, API 4.0
490
+
491
+ @deprecated Starting with SketchUp 2020.0, this function returns the default origin `[0, 0, 0]`, as
492
+ the insertion point can no longer be changed.
493
+
466
494
  @param[in] comp_def The component definition object.
467
495
  @param[out] point The insertion point retrieved.
468
496
  @related SUComponentDefinitionRef
@@ -493,7 +521,7 @@ SU_RESULT SUComponentDefinitionGetType(
493
521
  @brief Updates the faces in the component definition so that they are oriented
494
522
  consistently.
495
523
  @since SketchUp 2016, API 4.0
496
- @param[in] comp_def The component definition object.
524
+ @param[in,out] comp_def The component definition object.
497
525
  @related SUComponentDefinitionRef
498
526
  @return
499
527
  - \ref SU_ERROR_NONE on success
@@ -514,8 +542,8 @@ SU_RESULT SUComponentDefinitionOrientFacesConsistently(SUComponentDefinitionRef
514
542
  was changed to \ref SU_ERROR_NULL_POINTER_INPUT for consistency with
515
543
  other API methods.
516
544
 
517
- @param[in] comp_def The component definition object.
518
- @param[in] point The \ref SUPoint3D to use.
545
+ @param[in,out] comp_def The component definition object.
546
+ @param[in] point The \ref SUPoint3D to use.
519
547
  @related SUComponentDefinitionRef
520
548
  @return
521
549
  - \ref SU_ERROR_NONE
@@ -527,8 +555,8 @@ SU_RESULT SUComponentDefinitionSetInsertPoint(
527
555
  /**
528
556
  @brief Sets the axes of the component definition.
529
557
  @since SketchUp 2016, API 4.0
530
- @param[in] comp_def The component definition object.
531
- @param[in] axes The \ref SUAxesRef to use.
558
+ @param[in,out] comp_def The component definition object.
559
+ @param[in] axes The \ref SUAxesRef to use.
532
560
  @related SUComponentDefinitionRef
533
561
  @return
534
562
  - \ref SU_ERROR_NONE on success
@@ -575,6 +603,19 @@ SU_RESULT SUComponentDefinitionIsLiveComponent(SUComponentDefinitionRef comp_def
575
603
  SU_RESULT SUComponentDefinitionSaveToFile(
576
604
  SUComponentDefinitionRef comp_def, const char* file_path, enum SUModelVersion version);
577
605
 
606
+ /**
607
+ * @brief Retrieves the flag indicating whether the component definition is manifold.
608
+ * @since SketchUp 2025.0, API 13.0
609
+ * @param[in] comp_def The component definition object.
610
+ * @param[out] is_manifold The bool value retrieved.
611
+ * @related SUComponentDefinitionRef
612
+ * @return
613
+ * - \ref SU_ERROR_NONE on success
614
+ * - \ref SU_ERROR_INVALID_INPUT if \p comp_def is invalid
615
+ * - \ref SU_ERROR_NULL_POINTER_OUTPUT if \p is_manifold is NULL
616
+ */
617
+ SU_RESULT SUComponentDefinitionIsManifold(SUComponentDefinitionRef comp_def, bool* is_manifold);
618
+
578
619
  #ifdef __cplusplus
579
620
  } // extern "C"
580
621
  #endif
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @file
3
+ * @brief Definition for \ref SUSnapToBehavior. 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/component_definition.h`.
7
+ */
8
+
9
+ /**
10
+ @enum SUSnapToBehavior
11
+ @headerfile <SketchUpAPI/model/component_definition.h>
12
+ @brief Describes how the component instance can be placed when a user adds it to a model.
13
+
14
+ For example a window component instance should snap to a vertical plane.
15
+
16
+ @see SUComponentBehavior
17
+
18
+ @bug This enum was incorrectly defined inside the \ref SUComponentBehavior struct. This is
19
+ not valid C. As of SketchUp 2025.0 (API 13.0), this enum is conditionally defined outside
20
+ of the struct when the header is consumed by a C compiler.
21
+
22
+ @code
23
+ // Usage from a C compiler:
24
+ SUSnapToBehavior behavior;
25
+ SUComponentDefinitionSetBehavior(component_definition, &behavior);
26
+ if (behavior.component_snap == SUSnapToBehavior_Vertical) {
27
+ // ...
28
+ }
29
+ @endcode
30
+
31
+ @code
32
+ // Usage from a C++ compiler:
33
+ SUSnapToBehavior behavior;
34
+ SUComponentDefinitionSetBehavior(component_definition, &behavior);
35
+ if (behavior.component_snap == SUComponentBehavior::SUSnapToBehavior_Vertical) {
36
+ // ...
37
+ }
38
+ @endcode
39
+ */
40
+ enum SUSnapToBehavior {
41
+ SUSnapToBehavior_None = 0,
42
+ SUSnapToBehavior_Any,
43
+ SUSnapToBehavior_Horizontal,
44
+ SUSnapToBehavior_Vertical,
45
+ SUSnapToBehavior_Sloped
46
+ };
@@ -72,9 +72,9 @@ SUComponentInstanceFromDrawingElement(SUDrawingElementRef drawing_elem);
72
72
 
73
73
  /**
74
74
  @brief Sets the name of a component instance object.
75
- @param[in] instance The component instance object.
76
- @param[in] name The name string to set the component instance object.
77
- Assumed to be UTF-8 encoded.
75
+ @param[in,out] instance The component instance object.
76
+ @param[in] name The name string to set the component instance object.
77
+ Assumed to be UTF-8 encoded.
78
78
  @related SUComponentInstanceRef
79
79
  @return
80
80
  - \ref SU_ERROR_NONE on success
@@ -86,7 +86,7 @@ SU_RESULT SUComponentInstanceSetName(SUComponentInstanceRef instance, const char
86
86
  /**
87
87
  @brief Deallocates a component instance object created with
88
88
  SUComponentDefinitionCreateInstance().
89
- @param[in] instance The component instance object.
89
+ @param[in,out] instance The component instance object.
90
90
  @related SUComponentInstanceRef
91
91
  @return
92
92
  - \ref SU_ERROR_NONE on success
@@ -111,8 +111,8 @@ SU_RESULT SUComponentInstanceGetName(SUComponentInstanceRef instance, SUStringRe
111
111
  /**
112
112
  @brief Sets the globally unique identifier (guid) string of a instance object.
113
113
  @since SketchUp 2015, API 3.0
114
- @param[in] instance The component instance object.
115
- @param[in] guid The utf-8 formatted guid string.
114
+ @param[in,out] instance The component instance object.
115
+ @param[in] guid The utf-8 formatted guid string.
116
116
  @related SUComponentInstanceRef
117
117
  @return
118
118
  - \ref SU_ERROR_NONE on success
@@ -141,12 +141,12 @@ SU_RESULT SUComponentInstanceGetGuid(SUComponentInstanceRef instance, SUStringRe
141
141
  The transform is relative to the parent component. If the parent component is
142
142
  the root component of a model, then the transform is relative to absolute
143
143
  coordinates.
144
- @param[in] instance The component instance object.
145
- @param[in] transform The affine transform to set.
144
+ @param[in,out] instance The component instance object.
145
+ @param[in] transform The affine transform to set.
146
146
  @related SUComponentInstanceRef
147
147
  @return
148
148
  - \ref SU_ERROR_NONE on success
149
- - \ref SU_ERROR_INVALID_INPUT if instance is not a valid object
149
+ - \ref SU_ERROR_INVALID_INPUT if instance is not a valid object or transform is non invertible
150
150
  - \ref SU_ERROR_NULL_POINTER_INPUT if transform is NULL
151
151
  */
152
152
  SU_RESULT SUComponentInstanceSetTransform(
@@ -184,8 +184,8 @@ SU_RESULT SUComponentInstanceGetDefinition(
184
184
  /**
185
185
  @brief Locks the instance if is_locked is true, otherwise unlocks the instance.
186
186
  @since SketchUp 2016, API 4.0
187
- @param[in] instance The instance object.
188
- @param[in] lock if true lock the instance, otherwise unlock it.
187
+ @param[in,out] instance The instance object.
188
+ @param[in] lock if true lock the instance, otherwise unlock it.
189
189
  @related SUComponentInstanceRef
190
190
  @return
191
191
  - \ref SU_ERROR_NONE on success
@@ -56,9 +56,9 @@ SU_EXPORT SUCurveRef SUCurveFromEntity(SUEntityRef entity);
56
56
  same as the end position of the previous edge in the array. Each
57
57
  element of the array of edges is subsequently associated with the
58
58
  created curve object and must not be deallocated via SUEdgeRelease().
59
- @param curve The curve object created.
60
- @param edges The array of edge objects.
61
- @param len The number of edge objects in the array.
59
+ @param[out] curve The curve object created.
60
+ @param[in] edges The array of edge objects.
61
+ @param[in] len The number of edge objects in the array.
62
62
  @related SUCurveRef
63
63
  @return
64
64
  - \ref SU_ERROR_NONE on success
@@ -74,7 +74,7 @@ SU_RESULT SUCurveCreateWithEdges(SUCurveRef* curve, const SUEdgeRef edges[], siz
74
74
 
75
75
  /**
76
76
  @brief Releases a curve object and its associated edge objects.
77
- @param curve The curve object.
77
+ @param[in,out] curve The curve object.
78
78
  @related SUCurveRef
79
79
  @return
80
80
  - \ref SU_ERROR_NONE on success