+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Forum Newbie
    Using
    AutoCAD 2004
    Join Date
    Feb 2009
    Posts
    1

    Question Draw point along polyline, given length

    Registered forum members do not see this ad.

    friends:
    How can we Draw a point along selected polyline, given length from beginning of this polyline using lisp or visual basic?
    Thank you

  2. #2
    Junior Member
    Using
    AutoCAD 2004
    Join Date
    Nov 2008
    Posts
    20

    Default

    To draw a point along selected polyline you can use Divide command or Measure command or use the Auto Lips to combine the steps to a new Lisp routine.
    To give the length of polyline you can refer this following file:
    Hope this helps
    Cheer!!
    Attached Files

  3. #3
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,709
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  4. #4
    Forum Deity
    Using
    Civil 3D 2008
    Join Date
    Sep 2006
    Location
    Pittsburgh, PA, USA
    Posts
    3,581

    Default

    you could try this
    Code:
    ;places point at specified station along a polyline, measured from start LPS 2008
    
    (defun c:pop ()
    (vl-load-com)
    (setq oldosnap (getvar "osmode"))
    (setvar "osmode" 0)
    (command "ucs" "w")
    (setvar "pdmode" 3); if your pdmode is already set to what you want, remove or comment this line
    (setq ob (entsel "Select curve: "))
    (setq p2 (getreal "\n Specify Distance : "))
    (setq obj (vlax-ename->vla-object (car ob)))
    (setq pt1 (vlax-curve-getPointAtDist Obj p2))
    (command "Point" pt1)
    (command "ucs" "p")
    (setvar "osmode" oldosnap)
    (princ)
    )

  5. #5
    Forum Newbie
    Using
    AutoCAD 2006
    Join Date
    Sep 2012
    Location
    iran
    Posts
    5

    Default

    calculate the Length off a polyline from begin till a point

    I want to know the length of a line from the begin till the point where
    I click or where the line cross a other line.
    I can get the line and i can find where the intersection points are
    with VBA but I can NOT find a function that calculate the the exact
    length from begin to the intersection.
    Can anyone help me to find the good way.

    thank u all,

  6. #6
    Junior Member
    Computer Details
    careca's Computer Details
    Operating System:
    Win7 64
    Discipline
    Landscape
    careca's Discipline Details
    Occupation
    Urban Planner
    Discipline
    Landscape
    Using
    AutoCAD 2011
    Join Date
    Aug 2012
    Location
    Tokyo, Japan
    Posts
    13

    Default

    Registered forum members do not see this ad.

    Try using a combination of these:

    Start Point: (vlax-curve-getstartpoint Obj)
    End Point: (vlax-curve-getendpoint Onj)
    Distance at Point: (vlax-curve-getDistAtPoint Obj pt)
    Intersection: (vlax-invoke Obj 'IntersectWith Obj2 acExtendNone)

    And then subtract distance between your start point and distance at your intersection point/click point.

Similar Threads

  1. Length of Polyline
    By Peter31712 in forum AutoLISP, Visual LISP & DCL
    Replies: 37
    Last Post: 9th Jun 2011, 04:41 pm
  2. How to extend arc in accurate length from end point
    By rengised in forum AutoCAD Beginners' Area
    Replies: 4
    Last Post: 13th Oct 2008, 08:12 am
  3. draw a line using VBA with an angle and a length?
    By wbluem88 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 12th Aug 2008, 06:07 pm
  4. Polyline Length
    By Solomon Levin in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 5th Jan 2008, 02:50 pm
  5. length of a polyline
    By andyboy in forum AutoCAD Drawing Management & Output
    Replies: 6
    Last Post: 19th May 2006, 04:04 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