Author Topic: Buffer area  (Read 5014 times)

0 Members and 1 Guest are viewing this topic.

DRIU

  • Guest
Buffer area
« on: December 29, 2011, 06:28:16 PM »
Hi,

I'm trying to calculate area of the buffer. I offset line in both directions, connected ends of result lines. And I have problem then I want to calculate area of intersecting buffers. Hatching don't work, you can see result.
Is there any simple solution to my problem or do I have to deal with intersetwith function?

DEVITG

  • Bull Frog
  • Posts: 479
Re: Buffer area
« Reply #1 on: December 29, 2011, 06:44:40 PM »
You can get the are by the (street1  wide) times (street2 wide)
Please upload it as a 2008 or less DWG
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Buffer area
« Reply #2 on: December 29, 2011, 07:08:04 PM »
You can get the are by the (street1  wide) times (street2 wide)
Please upload it as a 2008 or less DWG

not quite
You'll may need to take the angular relationship between the 'streets' into account.
... depends if the area is a true rectangle or just a parallelogram
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

DRIU

  • Guest
Re: Buffer area
« Reply #3 on: December 30, 2011, 01:30:25 AM »
I added a real life example of buffer area I want to calculate.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Buffer area
« Reply #4 on: December 30, 2011, 01:41:03 AM »

If it was me :
draw a closed polyline with the vertexes at the intersections bounding the area you are concerned with.
Query the polyline to determine it's area.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Buffer area
« Reply #5 on: December 30, 2011, 08:56:14 AM »
That looks like wall center lines with the offset wall lines cleaned up.
The exception is the dead end center line which would be flat and not rounded.
Just an observation.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

DEVITG

  • Bull Frog
  • Posts: 479
Re: Buffer area
« Reply #6 on: December 31, 2011, 04:04:32 PM »
Hi DRIU.

I use the AREA command , Object option , pick on the Hatch , and get it


Command: area

Specify first corner point or [Object/Add/Subtract]: o

Select objects:
Area = 2417.06, Perimeter = 487.90

It will be kept at the AREA system variable, until you take other AREA 


Command: (getvar "area")
2417.06



Location @ Córdoba Argentina Using ACAD 2019  at Window 10

DRIU

  • Guest
Re: Buffer area
« Reply #7 on: January 01, 2012, 12:52:31 PM »
I use the AREA command , Object option , pick on the Hatch , and get it

Thanks, but as it not hatching overlapping space, area is not correct.

DEVITG

  • Bull Frog
  • Posts: 479
Re: Buffer area
« Reply #8 on: January 01, 2012, 07:06:03 PM »
If I sum the area of the 2 polylines , as posted by Kerry , it give me the same area I take from the AREA comand Obj Hatch


Command: area

Specify first corner point or [Object/Add/Subtract]: o

Select objects: I pick on the small blue polyline
Area = 110.26, Perimeter = 39.91

Command:
AREA
Specify first corner point or [Object/Add/Subtract]: o

Select objects:  the big polyline
Area = 2306.80, Perimeter = 448.00

Command:
AREA
Specify first corner point or [Object/Add/Subtract]: o

Select objects: the hatch
Area = 2417.06, Perimeter = 487.90

As it can be see , the sum of the 2 polys area is equal to the hacht area

Please clear me.
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

m4rdy

  • Newt
  • Posts: 62
Re: Buffer area
« Reply #9 on: January 01, 2012, 11:37:05 PM »
Hi,

And I have problem then I want to calculate area of intersecting buffers. Hatching don't work, you can see result.


I dont know if this can help you, and i forgot the original author.
Assume if boundaries are lwpolyline.
Code: [Select]
(defun c:minters (/ *acad* *acdoc* ss space clst rlst reg hatch)
  (vl-load-com)
  (setvar "cmdecho" 0)
  (or *acad* (setq *acad* (vlax-get-acad-object)))
  (or *acdoc* (setq *acdoc* (vla-get-activedocument *acad*)))
  (if (ssget '((0 . "CIRCLE,LWPOLYLINE")))
    (progn (vlax-for c (setq ss (vla-get-activeselectionset *acdoc*))
             (setq clst (cons c clst))
           )
           (vla-delete ss)
           (setq space (if (= 1 (getvar 'cvport))
                         (vla-get-paperspace *acdoc*)
                         (vla-get-modelspace *acdoc*)
                       )
           )
           (setq rlst (vlax-invoke space 'addregion clst))
           (setq reg  (car rlst)
                 rlst (cdr rlst)
           )
           (while rlst
             (vla-boolean reg acintersection (car rlst))
             (setq rlst (cdr rlst))
           )
           (if (< 0.0 (vla-get-area reg))
             (progn (setq hatch (vla-addhatch space achatchpatterntypepredefined "ANSI31" :vlax-false 0)
                    )
                    (vlax-invoke hatch 'appendouterloop (list reg))
                    (vlax-put-property hatch 'patternscale 100.)
                    (vlax-put-property hatch 'color acred)
                    (vla-evaluate hatch)
                    (command "Explode" (vlax-vla-object->ename reg))
                    ;;(vla-delete reg)
                    (setvar "PEDITACCEPT" 1)
                    (command "_.PEDIT"
                             "_M"
                             "P"
                             ""
                             "_J"
                             0.0
                             "w"
                             10.
                             ""
                    )
    (command "_.CHPROP"  "L"  ""  "C"  6  "");_=>>substitute with function area
                    )
             )
           )
    )
  )
  (princ)
)

m4rdy
Autocad 2007, Windows XP

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Buffer area
« Reply #10 on: January 01, 2012, 11:44:30 PM »

The thing that sidetracks most problem solving is definition of terms.

What is a buffer area. ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

DRIU

  • Guest
Re: Buffer area
« Reply #11 on: January 03, 2012, 10:21:21 PM »
Thank you m4rdy for code, I had no knowledge about regions and about union. That's what I was looking for.

Code: [Select]
(vla-boolean _o1 acUnion _o2)