Magnus Lindhe
Magnus Lindhe

Reputation: 7327

How can I tell if a shape is combined or not?

Given a Shape object, how can I tell if that shape is a combination of shapes or not?

I could use BreakApartEx() and get a ShapeRange which I could count, but I would rather not break a part the shape if possible.

I am using Corel Draw X7.

Upvotes: 3

Views: 263

Answers (4)

Anjaz
Anjaz

Reputation: 56

Yup, but as we knew, combined object must be curve shape, so there should be a code to check whether selected object is a curveshape.

May be just simple code like this :

Dim s as shape Dim l as long

For each s in activeselectionrange if s.type=cdrcurveshape then l = CorelScript.GetCurveSubpathCount 'You can display the subpath count as msg or in text box. MsgBox "The shape has " & l & " subpath(s)", vbOKOnly, "MLindhe:)" end if next s

Upvotes: 0

Anjaz
Anjaz

Reputation: 56

Yup, but as we knew, combined object must be curve shape, so there should be a code to check whether selected object is a curveshape.

Upvotes: 0

Anjaz
Anjaz

Reputation: 56

Or you can try CScript.GetCurveSubpathCount. You should add Curve Shape checking first.

Good luck

Upvotes: 0

Anjaz
Anjaz

Reputation: 56

How about creating a duplicate shape, then use BreakApartEX, and shaperange.count? Then delete it. So, you still maintain the original shape.

Upvotes: 3

Related Questions