+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
  1. #1
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    347

    Default Getting points locations at devided distance

    Registered forum members do not see this ad.

    Suppose that I have a room and I want to divide it into specific points.
    My codes are running well up to the crossing points. I mean How can I support
    the X and Y for the divided points at X and Y as well ?

    Code:
    (defun c:cen (/ pt1 pt3 pt2 pt4 XLen YLen Xnum Ynum)
      (setq pt1 (getpoint"\n Specify The Left corner: ")
    	pt3 (getcorner pt1 "\n Specify the Right corner: ")
    	)
      ;; ******** the rest of rectangl points ****************
      (setq pt2 (list (car pt3)(cadr pt1))
    	pt4 (list (car pt1)(cadr pt3))
    	)
      ;; ****** Lengths of X and Y **************
      (setq XLen (distance pt1 pt2)
    	YLen (distance pt1 pt4)
    	)
      ;; ****** divide the X and Y **************
      (setq Xnum (getint "\n Specify Number of X elements: ");; for instance 5
    	Ynum (getint "\n Specify Number of Y elements: ");; for instance 4
    	)

  2. #2
    Senior Member
    Computer Details
    JohnM's Computer Details
    Operating System:
    xp pro
    Using
    AutoCAD 2006
    Join Date
    Feb 2009
    Location
    houston, texas
    Posts
    380

    Default

    Could you explain in more detail?
    Do you just want to collect the point of the intersections of the x’s and y’s?
    Use the polar function and the repeat function

  3. #3
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,798

    Default

    Can not see any problem you just need a loop within a loop

    (repeat Xnum
    (repeat ynum
    ( do your thing here)
    )
    (setq xnum (+ xnum Xlen))
    )
    Last edited by BIGAL; 12th Aug 2010 at 03:57 am. Reason: typo

  4. #4
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    347

    Default

    The crosses in RED are what I would like to get. Although these points
    are would be changed according to user input.

    Many thanks

    Michaels
    Attached Images

  5. #5
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2009
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,613

    Default

    I wrote this lisp for enforcements some moons ago
    Looks like this is exactly what you looking for
    Change to suit

    ~'J'~
    Attached Files
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  6. #6
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    347

    Default

    Quote Originally Posted by fixo View Post
    I wrote this lisp for enforcements some moons ago
    Looks like this is exactly what you looking for
    Change to suit~'J'~
    Thanks fixo,

    I have two questions about your codes ,
    - Why did you use the following since you didn't use it later in the routine ?
    - And what does it mean?
    Code:
    pc (mapcar (function (lambda (x y)(* (+ x y) 0.5)))

    It is really works fine, But I am looking forward to learing how codes are running and should be built with according to user inputs.

    Any suggestion from any one would be highly appreciated.

    Regards

  7. #7
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2009
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,613

    Default

    Sorry,
    I can't to expalin the things good because of my english level
    and by this reason I'm afraid to mix something
    Feel free to change the code to your suit

    ~'J'~
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  8. #8
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    347

    Default

    Quote Originally Posted by fixo View Post
    Sorry,
    I can't to expalin the things good because of my english level
    and by this reason I'm afraid to mix something
    Feel free to change the code to your suit
    ~'J'~
    Thank you so much for your reply.

    I do understand.

    Best Regards,

  9. #9
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    347

    Default

    Hello,

    I still worndering how to get the intersection points in the pose.

    Any idea ?

    Best regards,

  10. #10
    Senior Member
    Computer Details
    JohnM's Computer Details
    Operating System:
    xp pro
    Using
    AutoCAD 2006
    Join Date
    Feb 2009
    Location
    houston, texas
    Posts
    380

    Default

    Registered forum members do not see this ad.

    what are you not understanding?
    do you know how to use the polar and repeat functions?

Similar Threads

  1. attribute in multi locations
    By AJSmith in forum AutoCAD Drawing Management & Output
    Replies: 12
    Last Post: 3rd Dec 2009, 04:56 pm
  2. distance between points
    By salman in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 17th Jun 2009, 04:42 pm
  3. Replies: 21
    Last Post: 14th May 2009, 06:36 pm
  4. block grips in odd locations
    By Mike.Richards in forum AutoCAD Beginners' Area
    Replies: 5
    Last Post: 12th Mar 2009, 09:24 am
  5. .bak locations
    By cadfly in forum AutoCAD General
    Replies: 31
    Last Post: 5th Mar 2008, 06:10 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