Message 1 of 4
AutoCAD 2000 - Area of user selected polyline

Not applicable
08-20-2000
03:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm running into trouble with a apparently simple task of selecting a
polyline and returning it's area.
Can someone show me some working code for this task ?
I started with the following code (courtesy of Randall Rath)
'Build the selection set
Dim objBlkRef As AcadBlockReference ' Line 1
Dim objGen As Object
Dim varPnt As Variant
Dim intCnt As Integer
Dim varAtts As Variant
Dim strPrompt As String
Dim Tags() As Variant
Dim Text() As String
strPrompt = "Select a block with attributes: "
ThisDrawing.Utility.GetEntity objGen, varPnt, strPrompt
If TypeOf objGen Is AcadBlockReference Then ' Line 11
Set objBlkRef = objGen
I tried various options in lieu of AcadBlockReference from lines 1 and 11.
eg LWPOLYLINE, AcDb2dPolyline.
However, this does not seem to enable me to find the selected polyline to
get its 'area' property.
--
Regards
Laurie Comerford
CADApps
I'm running into trouble with a apparently simple task of selecting a
polyline and returning it's area.
Can someone show me some working code for this task ?
I started with the following code (courtesy of Randall Rath)
'Build the selection set
Dim objBlkRef As AcadBlockReference ' Line 1
Dim objGen As Object
Dim varPnt As Variant
Dim intCnt As Integer
Dim varAtts As Variant
Dim strPrompt As String
Dim Tags() As Variant
Dim Text() As String
strPrompt = "Select a block with attributes: "
ThisDrawing.Utility.GetEntity objGen, varPnt, strPrompt
If TypeOf objGen Is AcadBlockReference Then ' Line 11
Set objBlkRef = objGen
I tried various options in lieu of AcadBlockReference from lines 1 and 11.
eg LWPOLYLINE, AcDb2dPolyline.
However, this does not seem to enable me to find the selected polyline to
get its 'area' property.
--
Regards
Laurie Comerford
CADApps