Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: How to find BLOCK area

  1. #1
    Member
    Join Date
    2009-07
    Posts
    11
    Login to Give a bone
    0

    Default How to find BLOCK area

    So I have searched everywhere and after failing to find an answer again and again this is my last hope.
    I am trying to find area covered by a blockrefrence on the drawing.My purpose and goal is to use the area to dermine the placement of multiple blocks withing the same drawing without any block overlaps.The block refrence consits of several text attributes etc.
    I have tried to use area command(only works on polylines, not for blocks), tried to use insertion point of the block.......I know there is a way to do this......just can't seem to find it....any help woould be greatly appretiated

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,409
    Login to Give a bone
    0

    Default Re: How to find BLOCK area

    Welcome to AUGI. Kee hal ha.

    Have you tried the the IntersectWith method?
    C:> ED WORKING....


    LinkedIn

  3. #3
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: How to find BLOCK area

    Does the block reference have bounding objects such as a polyline or is it just attribute references?

    Check out the GetBoundingBox method.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  4. #4
    Member
    Join Date
    2009-07
    Posts
    11
    Login to Give a bone
    0

    Thumbs up Re: How to find BLOCK area

    Thanks a lot for the help guys. The GetBoundingBox works perfectly. For those who Do not know what the function is,it basically finds the min xy co-ordinates and the max xy co-ordinates of a blockreference .This fucntion works with not just a block made of polyline/circle but also with attribute definitions to the block reference. I guess the autocad function 'ZOOMEXTENTS' uses this function to do its thing.

    Here's my simple code incase someone was interested.

    Sub experiment()

    Dim blockobj As AcadBlockReference
    Dim LL As Variant
    Dim UR As Variant

    For Each blockobj In ThisDrawing.ModelSpace
    blockobj.GetBoundingBox LL, UR
    End Sub

  5. #5
    Member
    Join Date
    2017-07
    Posts
    4
    Login to Give a bone
    0

    Default Re: How to find BLOCK area

    How to calculate the area of block by using macros?

  6. #6
    Active Member
    Join Date
    2012-11
    Location
    Italy
    Posts
    65
    Login to Give a bone
    0

    Default Re: How to find BLOCK area

    Quote Originally Posted by aritradey27753501 View Post
    How to calculate the area of block by using macros?
    if by "area" of a block you mean its boundingbox area and assuming you're in a 2D environment, then you could simply go:

    Code:
    Sub experiment()
    
    Dim blockobj As AcadBlockReference
    Dim LL As Variant
    Dim UR As Variant
    Dim area as double
    
    For Each blockobj In ThisDrawing.ModelSpace
    blockobj.GetBoundingBox LL, UR
    area = (UR(0)-LL(0))*(UR(1)-LL(1))
    msgbox "'Area' of current block is: " & area
    End Sub

  7. #7
    Member
    Join Date
    2017-07
    Posts
    4
    Login to Give a bone
    0

    Default Re: How to find BLOCK area

    Hi can we calculate the area of block by giving layer as input by using macro?

  8. #8
    Active Member
    Join Date
    2012-11
    Location
    Italy
    Posts
    65
    Login to Give a bone
    0

    Default Re: How to find BLOCK area

    was my answer helpful?
    if not, please tell why and give details about your actual goal

  9. #9
    Member
    Join Date
    2017-07
    Posts
    4
    Login to Give a bone
    0

    Default Re: How to find BLOCK area

    The previous program was helpful. i needed a step ahead to get area of block by taking input as layer? plz help

  10. #10
    Active Member
    Join Date
    2012-11
    Location
    Italy
    Posts
    65
    Login to Give a bone
    0

    Default Re: How to find BLOCK area

    too little info for me. you may want to add some more details about your goal along with some examples

Page 1 of 2 12 LastLast

Similar Threads

  1. Find a block in a drawing
    By pangell in forum AutoCAD General
    Replies: 8
    Last Post: 2016-08-07, 05:43 AM
  2. Find Block by Attribute
    By timharris677625 in forum Dot Net API
    Replies: 3
    Last Post: 2014-11-29, 07:20 AM
  3. FIND AND REPLACE BLOCK.
    By aijazahmed in forum AutoLISP
    Replies: 11
    Last Post: 2013-08-05, 04:14 PM
  4. 2013: Can't find user block in block list while creating a multi-leader style
    By rsturgeon502669 in forum AutoCAD Annotation
    Replies: 1
    Last Post: 2013-07-08, 07:05 AM
  5. Where to find area info in Oracle Spatial
    By aaronch in forum AutoCAD Map 3D - General
    Replies: 0
    Last Post: 2005-06-10, 05:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •