+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Full Member
    Using
    AutoCAD 2007
    Join Date
    Apr 2008
    Location
    Kherson, Ukraine
    Posts
    25

    Default Getting 2 selected points in VBA

    Registered forum members do not see this ad.

    Hi all.

    Complete newbie here. Just had a Autocad 2007 issue dropped on my desk and don't know where to start. (I am a DOT-NET - VBA programmer) Its a small VBA front end that takes some input vars, allows the user to to select 2 points in the drawing and runs a calculation and then inserts a object to a calculated position. I am aware of the 'ThisDrawing' reference and see all the properties and methods.

    So one step at a time. How do you retrieve the selected points in VBA?

    or am I missing the big picture here.

    Thanks.
    Steve

  2. #2
    Super Member
    Using
    Architecture 2009
    Join Date
    Apr 2008
    Location
    London, (sunny UK)
    Posts
    686

    Default

    Dim p1 as Variant
    Dim p2 as Variant

    p1 = ThisDrawing.Utility.GetPoint(, vbCr & "Select Point 1: ")
    p2 = ThisDrawing.Utility.GetPoint(, vbCr & "Select Point 2: ")


    Hope this helps.

    EDIT: Can a mod please move this to the correct section of the forum. Thanks.
    Last edited by LCE; 30th Apr 2008 at 12:16 pm.

  3. #3
    Super Moderator Cad64's Avatar
    Computer Details
    Cad64's Computer Details
    Operating System:
    Windows 7 Profesional x64
    Computer:
    XI Computers
    Motherboard:
    Asus P8Z77-V Pro
    CPU:
    Intel Core I7 3770K 4.1 Ghz Quad Core 3rd Gen
    RAM:
    24GB DDR3 @ 1333MHz
    Graphics:
    Nvidia GeForce GTX 570 1280MB GDDR5
    Primary Storage:
    SATAII 500GB 7200 RPM
    Secondary Storage:
    Western Digital My Book Studio Edition II - 2TB capacity
    Monitor:
    HPf2105 21" LCD Widescreen & Cintiq 21ux
    Discipline
    Multi-disciplinary
    Cad64's Discipline Details
    Occupation
    Landscape Architect
    Discipline
    Multi-disciplinary
    Using
    3ds Max 2011
    Join Date
    Feb 2006
    Location
    Southern California
    Posts
    9,073

    Default

    This thread has been moved to the "Autolisp, VBA & Customization" section.
    Personal Website: ( Updated 03/21/2014 ) ---> http://www.rdeweese.com/

    "Work Smart, Not Hard"

  4. #4
    Full Member
    Using
    AutoCAD 2007
    Join Date
    Apr 2008
    Location
    Kherson, Ukraine
    Posts
    25

    Default

    Thx LCE - that worked perfect. Had to hide then show the form but no worries. More questions to follow!

    Cad64, I will keep follow up questions to the section.

    Thx again all!

  5. #5
    Super Member
    Using
    Architecture 2009
    Join Date
    Apr 2008
    Location
    London, (sunny UK)
    Posts
    686

    Default

    Registered forum members do not see this ad.

    Sorry jake, totally forgot about the hide.
    Glad it helped.

Similar Threads

  1. Selected lines not appearing on screen as being selected.
    By mrjangles in forum AutoCAD Drawing Management & Output
    Replies: 7
    Last Post: 17th Feb 2009, 05:42 pm
  2. Get objects selected/VBA
    By Joro-- in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 1st Feb 2008, 04:03 pm
  3. Selected text fill
    By givrdad in forum AutoCAD General
    Replies: 1
    Last Post: 8th Feb 2006, 11:23 pm
  4. Finding X,Y or Z direction from two selected points?
    By Slickrick2000 in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 12th Jan 2006, 01:37 am
  5. only one object is selected
    By kanyakumari_t in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 22nd Nov 2005, 08:55 am

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