Results 1 to 7 of 7

Thread: Getangle returning coordinates rather than the angle between two points

  1. #1
    Active Member
    Join Date
    2004-02
    Posts
    60
    Login to Give a bone
    0

    Default Getangle returning coordinates rather than the angle between two points

    I thought this following expression would work but it is returning the coordinates for the second point rather than the angle between the two points


    Code:
    (setq #pt1 (getpoint))
    (setq #pt2 (getpoint))
    (setq #angle (getangle #pt1 #pt2)
    [ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]

    Does anyone know where I am missing the point (pardon the pun) here?

    Thanks,
    Jason Self
    Last edited by Opie; 2006-10-13 at 05:00 PM. Reason: [CODE] tags added, see Moderator Action

  2. #2
    All AUGI, all the time
    Join Date
    2015-12
    Location
    Central Oregon
    Posts
    591
    Login to Give a bone
    0

    Default Re: Getangle returning coordinates rather than the angle between two points

    Code:
    (setq #angle (angle #pt1 #pt2)
    (getangle) is for obtaining an angle from the user

  3. #3
    Active Member
    Join Date
    2004-02
    Posts
    60
    Login to Give a bone
    0

    Default Re: Getangle returning coordinates rather than the angle between two points

    Great, Thanks

  4. #4
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Getangle returning coordinates rather than the angle between two points

    You might try:
    (setq #pt1 (getpoint))
    (setq #pt2 (getpoint))
    (command "_line" #pt1 #pt2 "");don't know if you want a line but here it is
    (print (getvar "lastangle"))

    What are you trying to do with it?


    Chris

  5. #5
    I could stop if I wanted to
    Join Date
    2015-08
    Posts
    263
    Login to Give a bone
    0

    Default Re: Getangle returning coordinates rather than the angle between two points

    Quote Originally Posted by JSelf.65472
    I thought this following expression would work but it is returning the coordinates for the second point rather than the angle between the two points

    Code:
    (setq #pt1 (getpoint))
    (setq #pt2 (getpoint))
    (setq #angle (getangle #pt1 #pt2)
    [ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]

    Does anyone know where I am missing the point (pardon the pun) here?
    Angle function returns the angle between two points in radians.
    Code:
    (setq #angle (angle #pt1 #pt2))

  6. #6
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: Getangle returning coordinates rather than the angle between two points

    Try This,


    (setq lstPoint2 (getcorner (setq lstPoint1 (getpoint))))

  7. #7
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    487
    Login to Give a bone
    0

    Default Re: Getangle returning coordinates rather than the angle between two points

    You try using the cal function I not at work so i do not has access to AutoCAD but it some ting like
    Code:
     
    (set  #angle (cal "angle ( pt1 pt2)")
    pt1 and pt2 are point save to lisp variables pt1 pt2

    check AutoCAD help for the cal command the cal function work the same as the cal command

Similar Threads

  1. xyz coordinates of points
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2012-08-20, 10:30 PM
  2. Angle between two points
    By lalit_jangid in forum AutoLISP
    Replies: 34
    Last Post: 2011-09-15, 08:19 PM
  3. Outputting points as coordinates
    By a.ingerson in forum AutoCAD General
    Replies: 2
    Last Post: 2010-07-30, 04:04 PM
  4. Points had differing Z coordinates.
    By garry_james in forum AutoCAD General
    Replies: 3
    Last Post: 2009-10-02, 10:20 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
  •