+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Senior Member harrison-matt's Avatar
    Computer Details
    harrison-matt's Computer Details
    Operating System:
    Windows 7
    Computer:
    Acer Aspire TimelineX
    CPU:
    Intel i3
    RAM:
    4GB
    Monitor:
    Dual
    Using
    MEP 2012
    Join Date
    Jan 2010
    Location
    NOVA/DC
    Posts
    108

    Default Something is wrong with my polar function

    Registered forum members do not see this ad.

    All,

    I am having some issues with my polar function:

    Code:
    (setq pre_ang 0)
    (setq ang (/ (* 3 pi) 2))
    (setq int '(46.8854 43.1495 0.0))
    (setq apt_int '(52.8854 49.1495 0.0))
    (setq width 6)
    (setq ptLst
    	(mapcar
    	   '(lambda(x)(trans x 0 1))
    		(list
    		  (setq eli int)
    		  (setq el1 (polar eli (+ pi pre_ang) (/ width 3.)))
    		  (setq el2 (polar el1 (+ (/ pi 2) pre_ang) width))
    		  (setq el3 (polar eli ang (/ width 3.)))
    		  (setq el4 (polar el3 (+ (/ pi 2) ang) width))
    		  (setq ela apt_int)
    		 )
    	 )
     )
    (mapcar '(lambda (x)(command "point" x)) ptlst)
    el1 and el3 are not going in correctly...
    Code:
    _$
    (polar '(46.8854 43.1495 0.0) 3.14159 2.0) ;entered in console [el1]
    (44.8854 43.1495 0.0) ; return
    Any thoughts why this is not working for me?

    Kind Regards,

    Matt
    Last edited by harrison-matt; 16th Apr 2011 at 02:48 pm. Reason: Was missing the pre_ang and ang values. I added a point function. I added my evaluation.

  2. #2
    Senior Member harrison-matt's Avatar
    Computer Details
    harrison-matt's Computer Details
    Operating System:
    Windows 7
    Computer:
    Acer Aspire TimelineX
    CPU:
    Intel i3
    RAM:
    4GB
    Monitor:
    Dual
    Using
    MEP 2012
    Join Date
    Jan 2010
    Location
    NOVA/DC
    Posts
    108

    Default

    Code:
    (setq ptLst (mapcar
                   '(lambda(x)(trans x 0 1))
                      (list
                         int
                         (polar int (+ pi pre_ang) (/ width 3.))
                         (polar apt_int (+ pi pre_ang) (+ (/ width 3) width))
                         apt_int
                         (polar int ang (/ width 3.))
                         (polar apt_int ang (+ (/ width 3) width))
                         apt_int )))
     (mapcar '(lambda (x)(command "point" x)) ptlst))
    I simplified my code.... Still is not working as it should...

  3. #3
    Senior Member harrison-matt's Avatar
    Computer Details
    harrison-matt's Computer Details
    Operating System:
    Windows 7
    Computer:
    Acer Aspire TimelineX
    CPU:
    Intel i3
    RAM:
    4GB
    Monitor:
    Dual
    Using
    MEP 2012
    Join Date
    Jan 2010
    Location
    NOVA/DC
    Posts
    108

    Default

    Well... it works when i draw a polyline, but not when i am using points to show them.... any thoughts why?

  4. #4
    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,710

    Default

    Consider OSnap perhaps - change:

    Code:
    (mapcar '(lambda (x)(command "point" x)) ptlst))
    to:

    Code:
    (mapcar '(lambda (x)(command "_.point" "_non" x)) ptlst))
    Lee Mac Programming

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

    Just another Swamper

  5. #5
    Super Member David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    1,925

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by harrison-matt View Post
    Well... it works when i draw a polyline, but not when i am using points to show them.... any thoughts why?
    Points are alway WCS.
    R12 (Dos) - A2K

Similar Threads

  1. Polar Tracking not snapping to polar angles
    By dayandow4 in forum AutoCAD General
    Replies: 6
    Last Post: 4th Nov 2010, 08:56 am
  2. Wrong unit or wrong scale?
    By annie26789 in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 10
    Last Post: 2nd Sep 2010, 07:07 pm
  3. Keeping track of variables function to function day to day
    By Hudson in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 27th Aug 2009, 06:13 pm
  4. polar coordinates
    By giorgos1985 in forum AutoCAD Drawing Management & Output
    Replies: 6
    Last Post: 11th Dec 2007, 12:56 pm
  5. Polar Tracking
    By EvilRufusKay in forum AutoCAD Drawing Management & Output
    Replies: 4
    Last Post: 3rd Nov 2005, 05:29 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