hm_setshapeattribute

Sets an attribute for an existing graphical shape.

Syntax

hm_setshapeattribute type index attribute value

Type

HyperMesh Tcl GUI

Description

Creates a shape in the modeling window. Returns an index to the shape, which is required to further manage the shape.

Inputs

type
The type of shape to update. Valid values are BOX, SEGMENT, CYLINDER, SPHERE, POLYHEDRON, and FACET.
index
The index of the shape, as returned from hm_createshape
attribute
value
The attribute and value to update. Attributes are dependent on the dimension of the shape (1D, 2D or 3D). Valid attributes and values are:
VISIBILITY
  • 0 - Not visible
  • 1 - Visible
COLOR
  • Sets the color of the shape. Valid values are 1-64.
TRANSPARENCY
  • The level of transparency between 0 and 10. Applicable only for 2D & 3D shapes.
DRAWMODE
  • The mode to draw the shape. Applicable only for 2D & 3D shapes. Valid values are:
  • 0 - Wire frame
  • 1 - Shaded with mesh lines
  • 2 - Shaded
LINEWIDTH
  • The width of the line. Applicable only for 1D primitives.

Examples

To update a sphere with index 5 to color 12:
hm_setshapeattribute SPHERE 5 COLOR 12
To update a sphere with index 5 to be invisible:
hm_setshapeattribute SPHERE 5 VISIBILITY 0
To update a sphere with index 5 to have a transparency of 8:
hm_setshapeattribute SPHERE 5 TRANSPARENCY 8

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}