![]() |
#1
|
|||
|
|||
![]()
Hi,
I was wondering if anybody had a macro to measure the area inside a shape in meter squared? I am using Draw X4... I have found some code but it does not work... Sub Area() ActiveDocument.Unit = cdrMillimeter MsgBox Round(ActiveDocument.ActiveShape.Curve.Area, 2) End Sub Ta. Fungel |
#2
|
||||
|
||||
![]()
Alex’s Curve Works Macro will do this:
http://www.oberonplace.com/products/...curvestats.htm Also Alex’s P macro: http://macromonster.com/index.php?mo..._desc=127&id=9 -Shelby |
#3
|
||||
|
||||
![]()
As for your code, it is better to use the DisplayCurve, this way you can get the area of shapes like rectangles and ellipses and not just a curve.
Code:
Sub Area() ActiveDocument.Unit = cdrMillimeter MsgBox Round(ActiveShape.DisplayCurve.Area, 2) End Sub |
#4
|
|||
|
|||
![]()
Hey Shelby,
That is fantastic ![]() I changed code to meters squared: Just wondering if there is a way up putting the word "meter squared" after the number coming up so I never get confused with what it is! Sub Area() ActiveDocument.Unit = cdrMeter MsgBox Round(ActiveShape.DisplayCurve.Area, 2) End Sub Ta. Fungel |
#6
|
|||
|
|||
![]()
Thanks Shelby,
That is exactly what I was looking for ![]() Ta. Fungel. |
#7
|
|||
|
|||
![]()
Welcome.
I work for Corel 12, and unfortunately, this script does not work. If I could ask you to rework it to version 12 Thank you and best regards. It shows an error in this line: MsgBox Round(ActiveShape.DisplayCurve.Area, 2) & " meter squared" I hope you will help. ![]() Last edited by grzjanik; 03-03-2011 at 10:00. |
![]() |
Tags |
area |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Basic array/control question | Gadget | CorelDRAW/Corel DESIGNER VBA | 5 | 07-02-2008 06:23 |
Urgent Help: Alex: with Corel VBA and Visual basic program | amollondhe | CorelDRAW/Corel DESIGNER VBA | 1 | 23-11-2006 08:57 |
Visual Basic 2005 | shelbym | CorelDRAW/Corel DESIGNER VBA | 5 | 03-11-2006 21:30 |
Visual basic and text box | Mark Hockert | CorelDRAW/Corel DESIGNER VBA | 0 | 08-06-2006 14:19 |
Curveworks Fillet Gives Visual Basic Error | wetpuppy | CurveWorks | 2 | 05-08-2005 10:08 |