Results 1 to 8 of 8

Thread: Need lisp for writing dimension with arrows

  1. #1
    Member
    Join Date
    2011-02
    Posts
    6
    Login to Give a bone
    0

    Default Need lisp for writing dimension with arrows

    I need a lisp to write X and Y dimensions along ARROWS as per the attached picture.I must be able to assigned the desired value to origin.
    Please help me.
    Attached Images Attached Images

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Need lisp for writing dimension with arrows

    A couple of ideas.

    Arrow and text sepearate also checks orientation of 2 points or a line.
    Two blocks hor and ver again checks line direction.
    A dynamic block so orientation is always up or right checks line direction same test for text.

    So the question a line or two points for selection then can do option 1 pretty easy.

    Option 1&2&3 can use a field so if line length changes text changes.

    Post a dwg so sizes can be worked out. Include arrow block.
    Last edited by BIG-AL; 2019-03-31 at 05:15 AM.

  3. #3
    Member
    Join Date
    2011-02
    Posts
    6
    Login to Give a bone
    0

    Default Re: Need lisp for writing dimension with arrows

    Thanks for your quick response.

    Am attaching the drawing
    The block arrow and ordinate dimension X AND Y values be placed automatically.similar to the dimension in the drawing.
    Attached Files Attached Files

  4. #4
    Member
    Join Date
    2011-02
    Posts
    6
    Login to Give a bone
    0

    Default Re: Need lisp for writing dimension with arrows

    Just something similar to labeling ordinate dimension but with arrows .

  5. #5
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Need lisp for writing dimension with arrows

    Try out this, but made a new block Arrow2 as this was easier than tryingto use Arrow which had a number of problems. The base point was offset from the line ? The actual block has a nested arrow head again ? Lastly the arrow is slightly off square thats sloppy drafting. I just exploded twice arrow and made block arrow2 with base point end of line. I have not added perps snapping etc so user can use 2 points or perp to etc I used transparent M2P for label point. A while could be added to repeat based on pt1. I would also align the arrows vertically something I noticed in the dwg as well.

    Code:
    ; draw an arrow and text as label for 2 points
    ; By Alan H April 2019
    
    (defun ahartxt ( / oldsnap oldlay oldangdir oldaunits pt1 pt2 pt3 ang dist)
    (setq oldsnap (getvar 'osmode))
    (setq oldlay (getvar 'clayer))
    (setq oldangdir (getvar 'angdir))
    (setq oldaunits (getvar 'aunits))
    (setvar 'angdir 0)
    (setvar 'aunits 3)
    (setq pt1 (getpoint "pick point 1 "))
    (setq pt2 (getpoint "pick point 2 "))
    (setq dist (distance pt1 pt2 ))
    (setq ang (angle pt1 pt2))
    (setq pt3 (getpoint "pick point for arrow"))
    (setq oldsnap (getvar 'osmode))
    (setvar 'clayer "ordinate text")
    (setvar 'osmode 0)
    (command "-insert" "arrow2" pt3 1 1 ang )
    (setq pt3 (polar pt3 (/ pi 4.0) 0.35))
    (command "text"  "J" "bl"  pt3 0.25 0 (rtos dist 2 3))
    (setvar 'osmode oldsnap)
    (setvar 'clayer oldlay)
    (setvar 'angdir oldangdir)
    (setvar 'aunits oldaunits)
    (princ)
    )
    (ahartxt)

  6. #6
    I could stop if I wanted to CadDog's Avatar
    Join Date
    2005-06
    Location
    So Ca
    Posts
    439
    Login to Give a bone
    0

    Default Re: Need lisp for writing dimension with arrows

    Have you looked in Dimension Style Manager, there you can have it anyway you like. _dimstyle
    Attached Images Attached Images

  7. #7
    Member
    Join Date
    2011-02
    Posts
    6
    Login to Give a bone
    0

    Default Re: Need lisp for writing dimension with arrows

    NO i NEED SOMETHING LIKE THIS CODE , BUT COMBINED INTO ONE LISP.

    See, SOME ONE COULD COMBINE THIS TO MAKE AS A LISP.

    tHERE ARE TWO CODES ARROW FOR X and ARROW FOR Y.
    Attached Files Attached Files

  8. #8
    Member
    Join Date
    2011-02
    Posts
    6
    Login to Give a bone
    0

    Default Re: Need lisp for writing dimension with arrows

    Quote Originally Posted by Syedanwar70 View Post
    NO i NEED SOMETHING LIKE THIS CODE , BUT COMBINED INTO ONE LISP.

    See, SOME ONE COULD COMBINE THIS TO MAKE AS A LISP.

    THERE ARE TWO CODES ARROW FOR X and ARROW FOR Y.


    RESOLVED AS PER ATTACHMENT
    Attached Files Attached Files

Similar Threads

  1. Writing Lisp files
    By davidcgiles230997 in forum AutoCAD Customization
    Replies: 0
    Last Post: 2011-03-22, 11:44 PM
  2. Inverting Dimension Arrows
    By spyrc in forum AutoCAD LT - General
    Replies: 2
    Last Post: 2010-03-16, 04:47 PM
  3. You know you've been writing lisp too long when...
    By pauljordan in forum AutoLISP
    Replies: 5
    Last Post: 2009-05-20, 11:13 PM
  4. Dimension arrows not showing
    By Railrose in forum AutoCAD General
    Replies: 11
    Last Post: 2008-10-15, 03:18 PM
  5. New to writing lisp
    By jmoore284 in forum AutoLISP
    Replies: 15
    Last Post: 2008-05-14, 10:49 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
  •