OberonPlace.com Forums Measuring area of basic shape in meters squared
 User Name Remember Me? Password
 Blogs Gallery FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

 Thread Tools Search this Thread Display Modes
#1
10-10-2010, 10:55
 fungel Guest Posts: n/a
Measuring area of basic shape in meters squared

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
10-10-2010, 11:31
 shelbym Senior Member Join Date: Nov 2002 Location: Cheyenne, WY Posts: 1,770 Blog Entries: 10
Area Macros

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
10-10-2010, 11:35
 shelbym Senior Member Join Date: Nov 2002 Location: Cheyenne, WY Posts: 1,770 Blog Entries: 10
Area

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```
-Shelby
#4
10-10-2010, 14:53
 fungel Guest Posts: n/a
That is fantastic

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
#5
10-10-2010, 22:07
 shelbym Senior Member Join Date: Nov 2002 Location: Cheyenne, WY Posts: 1,770 Blog Entries: 10
Area

Sure just do this:
Code:
```Sub Area()
ActiveDocument.Unit = cdrMeter
MsgBox Round(ActiveShape.DisplayCurve.Area, 2) & " meter squared"
End Sub```
-Shelby
#6
14-10-2010, 09:00
 fungel Guest Posts: n/a
Thank you - it works great.

Thanks Shelby,

That is exactly what I was looking for

Ta.

Fungel.
#7
03-03-2011, 09:56
 grzjanik Member Join Date: Mar 2010 Location: Lodz, Poland Posts: 86
Area

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 Search this Thread: Advanced Search Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home OberonPlace Discussion     Site News     Web site suggestions     Image Gallery     Testing Oberon Products     CurveWorks     SecuriDesign     Calendar Wizard     Oberon Function Plotter     Jigsaw Puzzle Creator     Other Oberon Commercial Products     New product ideas Corel User Forums     CorelDRAW         General         Tutorials         FAQ         Feature requests/wishlist         Macros/Add-ons         Artwork Showcase     Corel DESIGNER         General         Tutorials         FAQ         Feature requests/wishlist         Macros/Add-ons         Artwork Showcase     Corel PHOTO-PAINT         General         Tutorials         FAQ         Feature requests/wishlist         Macros/Add-ons         Artwork Showcase     General         About Corel         Off-Topic Developer Forums     OberonPlace Development Portal     VBA         CorelDRAW/Corel DESIGNER VBA         Corel Photo-Paint VBA         Code Critique     Corel Script         CorelDRAW CS         Corel Photo-Paint CS

 Similar Threads Thread Thread Starter Forum Replies Last Post Gadget CorelDRAW/Corel DESIGNER VBA 5 07-02-2008 06:23 amollondhe CorelDRAW/Corel DESIGNER VBA 1 23-11-2006 08:57 shelbym CorelDRAW/Corel DESIGNER VBA 5 03-11-2006 21:30 Mark Hockert CorelDRAW/Corel DESIGNER VBA 0 08-06-2006 14:19 wetpuppy CurveWorks 2 05-08-2005 10:08

All times are GMT -5. The time now is 03:09.

 OberonPlace.com - Archive - Top

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com