+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Forum Newbie
    Discipline
    Surveying
    Using
    AutoCAD 2016
    Join Date
    Apr 2018
    Posts
    2

    Default Deviation arrow LISP

    Registered forum members do not see this ad.

    Hello,
    I'm new to the forum,
    I would like to ask you for help. I need a program / application (LISP) which will insert a deviation dart and a distance from a point to a straight line. More specifically, I would like to mark the point from the measurement and the designed line to indicate its deviation from the project. I tried to write something myself but it is too complicated for me.
    The arrow should show the direction in which the execution deviates from the design and it is best if its length can be determined separately depending on the drawing.
    In the picture I show what I mean.
    Thank you in advance for all your help
    Regards
    Attached Images

  2. #2
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,709

    Default

    94 People have looked at this and like me do not quite understand what you want. Comparing design point to as built is common but your image gives no clues.
    A man who never made mistakes never made anything

  3. #3
    Forum Newbie
    Discipline
    Surveying
    Using
    AutoCAD 2016
    Join Date
    Apr 2018
    Posts
    2

    Smile Explanation

    I am sorry, maybe I did not precisely express my thought. I have a geodetic survey point and I would like to show its deviation from the projected line. that's why I'd like to use the arrow.
    I have a program which, after selecting a measurement point and a point on a straight line inserts an arrow, the problem is when the point is close to a straight line then the arrow is very small, I would like the program to insert a fixed length arrow (defined earlier, for example 0.2 unit) and additionally give the distance from the point to straight line (mm) in the form of text in the drawing.
    Attached Images
    Attached Files

  4. #4
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    749

    Default

    another
    Code:
    
    ;with minimum size 
    (defun _arrow ( pt p1 h / d sz)
      (setq sz (distance pt p1))
      (vla-put-ArrowheadSize
        (vlax-ename->vla-object
          (entmakex (list '(0 . "LEADER")
                          '(100 . "AcDbEntity")
                          '(100 . "AcDbLeader")
                          '(73 . 3)
                          '(8 . "ARROW")
                          (cons 10 p1)
                          (cons 10 (polar p1 (angle p1 pt) (setq sz (cond ((< sz h ) h) (sz)))))
                          )
                    )
          )
        (/ sz  3.0 )
        )
      )
    (vl-load-com)

    Code:
    (defun c:test ( / p1 p2 )
    (and
    (setq p1 (getpoint "\nSpecify point 1: "))
    (setq p2 (getpoint p1 "\nSpecify point 2: "))
    
    (_arrow p1 p2 3.0) ; minimum size = 3.0 
    )
    (princ)
    )
    Last edited by hanhphuc; 24th Apr 2018 at 01:38 pm. Reason: minimum size
    _$ ( apply 'equal "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" )
    ; error: too many arguments

  5. #5
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,709

    Default

    It may be usefull to use closestpointto battery just ran out, later. Charged up, when I started I knew it needs two answers a big and small so draws arrow inside or labels as a outside arrow for very small.

    Code:
    (vl-load-com)
    ; code by BIGAL
    (defun c:test ( / pt1 pt2  diff x1 x2 y1 y2 xdiff ydiff obj)
    (setq obj (vlax-ename->vla-object (car (entsel "\nPick line pline or arc etc"))))
    (setq pt1 (getpoint "pick point"))
    (setq pt2 (vlax-curve-getclosestpointto obj pt1))
    (setq  ang (angle pt1 pt2))
    (setq diff (distance pt1 pt2))
    (setq x1 (car pt1) y1 (cadr pt1))
    (setq x2 (car pt2) y2 (cadr pt2))
    (setq xdiff (- x1 x2))
    (setq ydiff (- y1 y2))
    
    (alert (strcat "Length is " (rtos diff 2 2) "\nX difference is " (rtos xdiff 2 2) "\nY difference is " (rtos ydiff 2 2)))
    (if ( > diff 50)
    (progn
    (command  "dimaligned" pt2 pt1  pt1)
    (setq obj (vlax-ename->vla-object (entlast)))
    (vla-put-arrowhead1block obj "none")
    )
    (progn
    (setq pt2 (polar pt1 ang 65))
    (command  "dimaligned" pt2 pt1  pt1)
    (setq obj (vlax-ename->vla-object (entlast)))
    (vla-put-arrowhead1block obj "none")
    (vla-put-TextOverride obj (rtos diff 2 2 ))
    )
    )
    (princ)
    )
    
    (c:test)
    Last edited by BIGAL; 26th Apr 2018 at 08:51 am.
    A man who never made mistakes never made anything

  6. #6
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    749

    Default

    Quote Originally Posted by BIGAL View Post
    when I started I knew it needs two answers a big and small so draws arrow inside or labels as a outside arrow for very small.
    initially i was thinking same dimalign suppress one arrow but the problem if arrow size bigger than the deviations. IMO maybe OP needs picking 2 points

    vlax-curve-xxx is nice idea, but not sure OP considers in distance in 2D or 3D ?

    a bit similar old thread
    _$ ( apply 'equal "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" )
    ; error: too many arguments

  7. #7
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,709

    Default

    hanhphuc your right as I mentioned there are two situations one being a very small distance then arrow needs to be an outside like a radial answer. I just picked the easy one, version 2 would have 2 options. I will do tomorrow you know ask tomorrow when "tomorrow" .
    A man who never made mistakes never made anything

  8. #8
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,709

    Default

    Hey it was tomorrow ! updated code for small distances.
    A man who never made mistakes never made anything

  9. #9
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    749

    Default

    Quote Originally Posted by BIGAL View Post
    Hey it was tomorrow ! updated code for small distances.
    it was yesterday
    does OP know your update?
    _$ ( apply 'equal "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" )
    ; error: too many arguments

  10. #10
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,709

    Default

    Registered forum members do not see this ad.

    Hey mat02 it’s your turn to play now ! Hanhphuc and I have had our turn.
    A man who never made mistakes never made anything

Similar Threads

  1. Borehole Deviation 3D drawing with Coordinates
    By BIJI SAMUEL in forum AutoCAD 3D Modelling & Rendering
    Replies: 9
    Last Post: 20th Jan 2018, 12:42 pm
  2. Deviation Autolisp command
    By johnm1011 in forum AutoLISP, Visual LISP & DCL
    Replies: 23
    Last Post: 19th Nov 2014, 08:16 pm
  3. Lisp to draw an arrow
    By Minh Heaven in forum AutoLISP, Visual LISP & DCL
    Replies: 21
    Last Post: 10th Dec 2011, 03:43 am
  4. Lisp for arrow
    By vnanhvu in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 10th Jun 2011, 06:31 am
  5. Chordal Tolerance/Triangular Deviation
    By BSouders in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 7th Feb 2007, 05:08 pm

Tags for this Thread

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