Previous Document Next Document

Object Model Reference : Classes : S : Shape : Properties : Shape.Type


Shape.Type

Property Type As cdrShapeType

Description

Member of Shape

The Type property returns the type of a shape. You can use this property to distinguish among shape types (rectangles, ellipses, text, curves, and so on).

The Type property returns a read-only value.

VBA example

The following VBA example distorts a curve by moving each of its nodes by a random offset.

Sub Test()
 Dim x As Double, y As Double, max As Double
 Dim n As Node
 If ActiveShape Is Nothing Then
  MsgBox "Select an object first", vbCritical
  Exit Sub
 End If
 If ActiveShape.Type <> cdrCurveShape Then ActiveShape.ConvertToCurves
 If ActiveShape.Type <> cdrCurveShape Then
  MsgBox "Unable to convert the object to curve", vbCritical
  Exit Sub
 End If
 ActiveShape.GetSize x, y
 If x < y Then max = y / 10 Else max = x / 10
 For Each n In ActiveShape.Curve.Nodes
  n.Move (Rnd() - 0.5) * max, (Rnd() - 0.5) * max
 Next n
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.