+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Forum Newbie
    Using
    AutoCAD 2004
    Join Date
    Feb 2008
    Location
    Brittany - France
    Posts
    8

    Default VBA : find the lowest point in a selectionset

    Registered forum members do not see this ad.

    Hello again,

    In way to define the insertion point when creating a block with a selectionset (see my previous here) I try to find the lower left point of the box containing all the entities in my selectionset.

    I think I found something in ACAD VBA help, a function to do this but I can't find it again.

    Thank you

    John

  2. #2
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 7 Pro x64
    Motherboard:
    Intel DZ77RE-75K
    CPU:
    i7-3770K 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro 2000
    Primary Storage:
    125GB SSD
    Secondary Storage:
    500GB SATA
    Monitor:
    ASUS 27" / ASUS 24"
    Discipline
    Civil
    Using
    Civil 3D 2013
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    3,633

    Default

    Look at the GetBoundingBox Method.

  3. #3
    Forum Newbie
    Using
    AutoCAD 2004
    Join Date
    Feb 2008
    Location
    Brittany - France
    Posts
    8

    Default

    Registered forum members do not see this ad.

    Yes, of course ! I knew something existed !

    Thanks,

    John

    PS: here is my function :

    Code:
    'Look for the lower left point of all the entities in a selectionset :
    Function pntInsert(sset As AcadSelectionSet) As Variant
    Dim acadobj As AcadObject
    Dim minExt As Variant
    Dim maxExt As Variant
    Dim test As Boolean
    Dim pbas As Variant
    
    test = False
    For Each acadobj In sset
        acadobj.GetBoundingBox minExt, maxExt
        If test = False Then
            pbas = minExt
            test = True
        End If
        If minExt(0) < pbas(0) Then pbas(0) = minExt(0) 'x mini
        If minExt(1) < pbas(1) Then pbas(1) = minExt(1) 'y mini
    Next acadobj
    pntInsert = pbas
    End Function

Similar Threads

  1. MOVING THE BASE POINT/ INSERTION POINT
    By nwmjdp in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 13th May 2012, 06:44 am
  2. VBA, blocks and selectionset
    By John the frog in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 3rd Feb 2008, 10:15 am
  3. point to point instead of matrix method??
    By avantgarde in forum AutoCAD Beginners' Area
    Replies: 8
    Last Post: 22nd Oct 2007, 05:59 pm
  4. find the midpoint between two point features thru lisp
    By vivekgrs in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 4th Aug 2006, 01:47 pm
  5. where to find
    By kesten3 in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 30th Jul 2006, 02:42 pm

Bookmarks

Posting Permissions

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