Jump to content
Sign in to follow this  
yotelcZ`

To find Area in Between.

Recommended Posts

yotelcZ`

Hello Everyone.

I want to find the area of  the following section as such.

I have developed a macro using Excel.

It works only as the first condition.

For some conditions shown on AutoCAD attached  it doesn't work, that is it gives the wrong Area.

Also I have shown a shaded area that it must not include.

Please help to solve the solution.

I have also included pictures of conditions. In case the AutoCAD won't work.

Thanks.

 

Here is the Macro containing Excel file.

 

 

Book2.xlsxdrawing.dwg

Capture1.JPG

Capture2.JPG

Share this post


Link to post
Share on other sites
BIGAL

Have you looked at using Bpoly this will make a pline of the shape and can get area, you can apply a scaling factor by making it a block then change X & Y scale explode and get area. Much less code as area is a property of a pline.

 

Edited by BIGAL

Share this post


Link to post
Share on other sites
yotelcZ`

Okay.

I want some how to click the following in-order using VBA.

As shown in picture I have attached.

 

Capture.JPG

Edited by yotelcZ`

Share this post


Link to post
Share on other sites
BIGAL

There is some comments about BPOLY not being a vba command so try ThisDrawing.SendCommand "Bpoly" & vbCr

 

also ThisDrawing.SendCommand "-Boundary" & vbCr & pt vbCr  "NOT TESTED"

 

Lisp version (command "-boundary" pt "")

Edited by BIGAL
  • Like 1

Share this post


Link to post
Share on other sites
yotelcZ`

Okay how do I extract the boundary Area created??

... here is my plan...

 

1st .... select the boundary entity

2nd... identify the boundary as a polyline... but 

3rd... find the area.

with the following vba outline 

        

'get entity...


Dim polEnt As AcadPolyline
Dim polWnt As AcadLWPolyline

Dim ent As AcadEntity


With ThisDrawing.Utility
    .GetEntity ent, varPick, vbr & "pick the Object"
End With

If TypeOf ent Is AcadPolyline Then
    Set polEnt = ent
    x = polEnt.Area
ElseIf TypeOf ent Is AcadLWPolyline Then
    Set polWnt = ent
    x = polWnt.Area

End If
End Sub
 

 

 

Share this post


Link to post
Share on other sites
BIGAL

What is X ? 

Maybe

With 
ThisDrawing.Utility.GetEntity ent, varPick, vbr & "pick the Object"
End With

 

Share this post


Link to post
Share on other sites
yotelcZ`

X is a variable I create to assign for the Area.

It could be declared to be defined as a Double, it works without it.

 

Thanks.

Share this post


Link to post
Share on other sites
Kalsefar
On 11/6/2020 at 4:03 PM, yotelcZ` said:

Hello Everyone.

I want to find the area of  the following section as such.

I have developed a macro using Excel.

It works only as the first condition.

For some conditions shown on AutoCAD attached  it doesn't work, that is it gives the wrong Area.

Also I have shown a shaded area that it must not include.

Please help to solve the solution.

I have also included pictures of conditions. In case the AutoCAD won't work.

Thanks.

 

Here is the Macro containing Excel file.

 

 

Book2.xlsx 35.44 kB · 2 downloads drawing.dwg 50.41 kB · 0 downloads

Capture1.JPG

 

 

 

The attached excel file doesn't showing the code, By the way I had programed an Excel file can help with your issue.

Find the attached link: http://www.mediafire.com/file/wvwftdsgbfjz1jy/IMPORT_DATA_FROM_AutoCAD.xlsm/file

 

 

Share this post


Link to post
Share on other sites
yotelcZ`

sorry

Book2.xlsm

Edited by yotelcZ`

Share this post


Link to post
Share on other sites
yotelcZ`

but your code has password

It's okay.

Use mine.

If you find it helpful.

Edited by yotelcZ`

Share this post


Link to post
Share on other sites
yotelcZ`

It's okay.

Use mine.

if you find it helpful.

Edited by yotelcZ`

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...