SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
group.h File Reference
#include <SketchUpAPI/common.h>
#include <SketchUpAPI/unicodestring.h>
#include <SketchUpAPI/transformation.h>
#include <SketchUpAPI/model/defs.h>

Go to the source code of this file.

Functions

SU_EXPORT SUEntityRef SUGroupToEntity (SUGroupRef group)
 Converts from an SUGroupRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SU_EXPORT SUGroupRef SUGroupFromEntity (SUEntityRef entity)
 Converts from an SUEntityRef to an SUGroupRef. This is essentially a downcast operation so the given entity must be convertible to an SUGroupRef. More...
 
SU_EXPORT SUDrawingElementRef SUGroupToDrawingElement (SUGroupRef group)
 Converts from an SUGroupRef to an SUDrawingElementRef. This is essentially an upcast operation. More...
 
SU_EXPORT SUGroupRef SUGroupFromDrawingElement (SUDrawingElementRef drawing_elem)
 Converts from an SUDrawingElementRef to an SUGroupRef. This is essentially a downcast operation so the given element must be convertible to an SUGroupRef. More...
 
SU_EXPORT SUComponentInstanceRef SUGroupToComponentInstance (SUGroupRef group)
 Converts from an SUGroupRef to an SUComponentInstanceRef. This is essentially an upcast operation. More...
 
SU_EXPORT SUGroupRef SUGroupFromComponentInstance (SUComponentInstanceRef component_inst)
 Converts from an SUComponentInstanceRef to an SUGroupRef. This is essentially a downcast operation so the given element must be convertible to an SUGroupRef. More...
 
SU_RESULT SUGroupCreate (SUGroupRef *group)
 Creates a new group object. More...
 
SU_RESULT SUGroupSetName (SUGroupRef group, const char *name)
 Sets the name of a group object. More...
 
SU_RESULT SUGroupGetName (SUGroupRef group, SUStringRef *name)
 Retrieves the name of a group object. More...
 
SU_RESULT SUGroupGetGuid (SUGroupRef group, SUStringRef *guid)
 Retrieves the globally unique identifier (guid) string of a group object. More...
 
SU_RESULT SUGroupSetGuid (SUGroupRef group, const char *guid_str)
 Sets the globally unique identifier (guid) string of a group object. More...
 
SU_RESULT SUGroupSetTransform (SUGroupRef group, const struct SUTransformation *transform)
 Sets the transform of a group object. More...
 
SU_RESULT SUGroupGetTransform (SUGroupRef group, struct SUTransformation *transform)
 Retrieves the transform of a group object. More...
 
SU_RESULT SUGroupGetEntities (SUGroupRef group, SUEntitiesRef *entities)
 Retrieves the entities of the group object. More...
 

Function Documentation

SU_RESULT SUGroupCreate ( SUGroupRef group)

Creates a new group object.

The created group must be subsequently added to the Entities of a model, component definition or a group. Use SUModelRemoveComponentDefinitions to remove the group from a model.

Parameters
[out]groupThe group object created.
Returns
SU_EXPORT SUGroupRef SUGroupFromComponentInstance ( SUComponentInstanceRef  component_inst)

Converts from an SUComponentInstanceRef to an SUGroupRef. This is essentially a downcast operation so the given element must be convertible to an SUGroupRef.

Since
SketchUp 2016, API 4.0
Parameters
[in]component_instThe given component instance reference.
Returns
  • The converted SUGroupRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
SU_EXPORT SUGroupRef SUGroupFromDrawingElement ( SUDrawingElementRef  drawing_elem)

Converts from an SUDrawingElementRef to an SUGroupRef. This is essentially a downcast operation so the given element must be convertible to an SUGroupRef.

Parameters
[in]drawing_elemThe given element reference.
Returns
  • The converted SUGroupRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
SU_EXPORT SUGroupRef SUGroupFromEntity ( SUEntityRef  entity)

Converts from an SUEntityRef to an SUGroupRef. This is essentially a downcast operation so the given entity must be convertible to an SUGroupRef.

Parameters
[in]entityThe given entity reference.
Returns
  • The converted SUGroupRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
SU_RESULT SUGroupGetEntities ( SUGroupRef  group,
SUEntitiesRef entities 
)

Retrieves the entities of the group object.

Parameters
[in]groupThe group object.
[out]entitiesThe entities retrieved.
Returns
SU_RESULT SUGroupGetGuid ( SUGroupRef  group,
SUStringRef guid 
)

Retrieves the globally unique identifier (guid) string of a group object.

Since
SketchUp 2015, API 3.0
Parameters
[in]groupThe group object.
[out]guidThe guid retrieved.
Returns
SU_RESULT SUGroupGetName ( SUGroupRef  group,
SUStringRef name 
)

Retrieves the name of a group object.

Parameters
[in]groupThe group object.
[out]nameThe name retrieved.
Returns
SU_RESULT SUGroupGetTransform ( SUGroupRef  group,
struct SUTransformation transform 
)

Retrieves the transform of a group object.

See description of SUGroupSetTransform for a discussion of group transforms.

Parameters
[in]groupThe group object.
[out]transformThe transform retrieved.
Returns
SU_RESULT SUGroupSetGuid ( SUGroupRef  group,
const char *  guid_str 
)

Sets the globally unique identifier (guid) string of a group object.

Since
SketchUp 2015, API 3.0
Parameters
[in]groupThe group object.
[in]guid_strThe utf-8 formatted guid string.
Returns
SU_RESULT SUGroupSetName ( SUGroupRef  group,
const char *  name 
)

Sets the name of a group object.

Parameters
[in]groupThe group object.
[in]nameThe name string to set the group object. Assumed to be UTF-8 encoded.
Returns
SU_RESULT SUGroupSetTransform ( SUGroupRef  group,
const struct SUTransformation transform 
)

Sets the transform of a group object.

The transform is relative to the parent component. If the parent component is the root component of a model, then the transform is relative to absolute coordinates.

Parameters
[in]groupThe group object.
[in]transformThe affine transform to set.
Returns
SU_EXPORT SUComponentInstanceRef SUGroupToComponentInstance ( SUGroupRef  group)

Converts from an SUGroupRef to an SUComponentInstanceRef. This is essentially an upcast operation.

Since
SketchUp 2016, API 4.0
Parameters
[in]groupThe given group reference.
Returns
  • The converted SUComponentInstanceRef if group is a valid group
  • If not, the returned reference will be invalid
SU_EXPORT SUDrawingElementRef SUGroupToDrawingElement ( SUGroupRef  group)

Converts from an SUGroupRef to an SUDrawingElementRef. This is essentially an upcast operation.

Parameters
[in]groupThe given group reference.
Returns
  • The converted SUDrawingElementRef if group is a valid group
  • If not, the returned reference will be invalid
SU_EXPORT SUEntityRef SUGroupToEntity ( SUGroupRef  group)

Converts from an SUGroupRef to an SUEntityRef. This is essentially an upcast operation.

Parameters
[in]groupThe given group reference.
Returns
  • The converted SUEntityRef if group is a valid group
  • If not, the returned reference will be invalid