Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Polyine with multiplier

  1. #1
    Member
    Join Date
    2011-10
    Posts
    40
    Login to Give a bone
    0

    Default Polyine with multiplier

    hi all,

    i want lisp programe to Creat simply polyline. for suppose i want to Create polyline length of 3.5. but it should be drawn 35. it should ask for the multiplier number from which it should be multiplied and drawn.

    i will specify 3.5.
    type your Multiplier =10

    it should drawn 35. and this code should execute withing pline command.

    (the above one is just example. dont say that "you can type 35". multiplier can be any number. e.g 32.5.). I just tried to write lisp but all is just useless. kindly help me or guide on this.

    this is my code

    Code:
    (defun c:xx()
    (setq a (getreal "Enter multiplier Number:..."))
    (setq b (getreal "Enter length of link:..."))
    (command "pline" (getpoint) (* a b ) "")
    )

  2. #2
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Polyine with multiplier

    Try this :

    Code:
    (defun c:test ( / pt a ptl )
      (setq pt (getpoint "\nStart Point : "))
      (setq ptl (cons pt ptl))
      (while (not (null pt))
        (setq pt (getpoint "\nPoint - ENTER for END : "))
        (setq a (getreal "\nInput multiplier for segment : "))
        (setq pt (mapcar '+ pt (mapcar '* (mapcar '- pt (car ptl)) a)))
        (setq ptl (cons pt ptl))
      )
      (setq ptl (reverse ptl))
      (command "_.pline")
      (foreach pt ptl
        (command pt)
      )
      (command "")
    (princ)
    )
    M.R.

  3. #3
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Polyine with multiplier

    Sorry, I've made mistake :

    Code:
    (defun c:test ( / pt a ptl )
      (setq pt (getpoint "\nStart Point : "))
      (setq ptl (cons pt ptl))
      (while (not (null pt))
        (setq pt (getpoint "\nPoint - ENTER for END : "))
        (setq a (getreal "\nInput multiplier for segment : "))
        (setq pt (mapcar '+ pt (mapcar '* (mapcar '- pt (car ptl)) (list a a a))))
        (setq ptl (cons pt ptl))
      )
      (setq ptl (reverse ptl))
      (command "_.pline")
      (foreach pt ptl
        (command pt)
      )
      (command "")
    (princ)
    )
    Regards,
    M.R.

  4. #4
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Polyine with multiplier

    One more thing... :

    Code:
    (defun c:test ( / pt a ptl )
      (setq pt (getpoint "\nStart Point : "))
      (setq ptl (cons pt ptl))
      (while (not (null pt))
        (setq pt (getpoint pt "\nPoint - ENTER for END : "))
        (setq a (getreal "\nInput multiplier for segment : "))
        (setq pt (mapcar '+ pt (mapcar '* (mapcar '- pt (car ptl)) (list a a a))))
        (setq ptl (cons pt ptl))
      )
      (setq ptl (reverse ptl))
      (command "_.pline")
      (foreach pt ptl
        (command pt)
      )
      (command "")
    (princ)
    )
    Regards,
    M.R.

  5. #5
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Polyine with multiplier

    What is this, I can't modify posts???

    Code:
    (defun c:test ( / pt a ptl )
      (setq pt (getpoint "\nStart Point : "))
      (setq ptl (cons pt ptl))
      (while (not (null pt))
        (setq pt (getpoint pt "\nPoint - ENTER for END : "))
        (setq a (getreal "\nInput multiplier for segment : "))
        (setq pt (mapcar '+ pt (mapcar '* (mapcar '- pt (car ptl)) (list a a a))))
        (setq ptl (cons pt ptl))
        (grdraw (car ptl) (cadr ptl) -1)
      )
      (setq ptl (reverse ptl))
      (command "_.pline")
      (foreach pt ptl
        (command pt)
      )
      (command "")
    (princ)
    )
    Regards,
    M.R.
    Last edited by marko_ribar; 2011-10-11 at 06:27 AM. Reason: Finally I modified it...

  6. #6
    Member
    Join Date
    2011-10
    Posts
    40
    Login to Give a bone
    0

    Default Re: Polyine with multiplier

    Nothing is working. I am using AutoCAD Map 2004. Anyways Thanks for Your Reply










    Quote Originally Posted by marko_ribar View Post
    Try this :

    Code:
    (defun c:test ( / pt a ptl )
      (setq pt (getpoint "\nStart Point : "))
      (setq ptl (cons pt ptl))
      (while (not (null pt))
        (setq pt (getpoint "\nPoint - ENTER for END : "))
        (setq a (getreal "\nInput multiplier for segment : "))
        (setq pt (mapcar '+ pt (mapcar '* (mapcar '- pt (car ptl)) a)))
        (setq ptl (cons pt ptl))
      )
      (setq ptl (reverse ptl))
      (command "_.pline")
      (foreach pt ptl
        (command pt)
      )
      (command "")
    (princ)
    )
    M.R.

  7. #7
    Member
    Join Date
    2011-10
    Posts
    40
    Login to Give a bone
    0

    Default Re: Polyine with multiplier

    hello,

    this code is drawn pline in graphic screen(Virtuallly). After regen it gets vanish.



    Quote Originally Posted by marko_ribar View Post
    What is this, I can't modify posts???

    Code:
    (defun c:test ( / pt a ptl )
      (setq pt (getpoint "\nStart Point : "))
      (setq ptl (cons pt ptl))
      (while (not (null pt))
        (setq pt (getpoint pt "\nPoint - ENTER for END : "))
        (setq a (getreal "\nInput multiplier for segment : "))
        (setq pt (mapcar '+ pt (mapcar '* (mapcar '- pt (car ptl)) (list a a a))))
        (setq ptl (cons pt ptl))
        (grdraw (car ptl) (cadr ptl) -1)
      )
      (setq ptl (reverse ptl))
      (command "_.pline")
      (foreach pt ptl
        (command pt)
      )
      (command "")
    (princ)
    )
    Regards,
    M.R.

  8. #8
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Polyine with multiplier

    FINALLY - remove nil from ptl, and it should work :

    Code:
    (defun c:test ( / pt a ptl )
      (setq pt (getpoint "\nStart Point : "))
      (setq ptl (cons pt ptl))
      (while (not (null pt))
        (setq pt (getpoint pt "\nPoint - ENTER for END : "))
        (setq a (getreal "\nInput multiplier for segment : "))
        (setq pt (mapcar '+ pt (mapcar '* (mapcar '- pt (car ptl)) (list a a a))))
        (setq ptl (cons pt ptl))
        (grdraw (car ptl) (cadr ptl) -1)
      )
      (setq ptl (reverse ptl))
      (vl-remove nil ptl)
      (command "_.pline")
      (foreach pt ptl
        (command pt)
      )
      (command "")
    (princ)
    )
    Regards,
    M.R.

  9. #9
    Member
    Join Date
    2011-10
    Posts
    40
    Login to Give a bone
    0

    Default Re: Polyine with multiplier

    still the same problem !


    Quote Originally Posted by marko_ribar View Post
    FINALLY - remove nil from ptl, and it should work :

    Code:
    (defun c:test ( / pt a ptl )
      (setq pt (getpoint "\nStart Point : "))
      (setq ptl (cons pt ptl))
      (while (not (null pt))
        (setq pt (getpoint pt "\nPoint - ENTER for END : "))
        (setq a (getreal "\nInput multiplier for segment : "))
        (setq pt (mapcar '+ pt (mapcar '* (mapcar '- pt (car ptl)) (list a a a))))
        (setq ptl (cons pt ptl))
        (grdraw (car ptl) (cadr ptl) -1)
      )
      (setq ptl (reverse ptl))
      (vl-remove nil ptl)
      (command "_.pline")
      (foreach pt ptl
        (command pt)
      )
      (command "")
    (princ)
    )
    Regards,
    M.R.

  10. #10
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Polyine with multiplier

    HI, nothing until I sit in front of my PC with CAD :

    Code:
    (defun c:test ( / pt a k m ptl )
      (setq pt (getpoint "\nStart Point : "))
      (setq a 1.0)
      (setq ptl (cons pt ptl))
      (while (not (or (null a) (null pt)))
        (setq pt (getpoint pt "\nPoint - ENTER for END : "))
        (redraw)
        (if (not (null pt))
          (progn
          (grdraw pt (car ptl) 1)
          (princ "\nCurrent length is : ")(princ (distance pt (car ptl)))
          (setq a (getreal "\nInput multiplier for segment - ENTER for END : "))
            (if (not (null a))
              (progn
              (setq pt (mapcar '+ (car ptl) (mapcar '* (mapcar '- pt (car ptl)) (list a a 0.0))))
              (setq ptl (cons pt ptl))
              )
            )
          )
        )
        (redraw)
        (setq k -1)
        (repeat (- (length ptl) 1)
          (setq k (1+ k))
          (setq m (1+ k))
          (grdraw (nth k ptl) (nth m ptl) -1)
        )
      )
      (setq ptl (reverse ptl))
      (command "_.pline")
      (foreach pt ptl
        (command pt)
      )
      (command "")
      (redraw)
    (princ)
    )
    Hope now everything is OK...
    I just test it and it went fine with my CAD...

    Regards,
    M.R.
    Last edited by marko_ribar; 2011-10-11 at 10:52 AM.

Page 1 of 2 12 LastLast

Similar Threads

  1. 2014: Multiplier Roll Out Command
    By sunny_the_watts500836 in forum 3ds Max - General
    Replies: 1
    Last Post: 2014-02-25, 08:56 PM
  2. PSLTSCALE set individually for each line and polyine
    By Wish List System in forum AutoCAD Wish List
    Replies: 8
    Last Post: 2012-09-03, 07:39 PM
  3. Distance Multiplier problem
    By Aeris Leonna in forum Dynamic Blocks - Technical
    Replies: 2
    Last Post: 2008-07-14, 01:47 AM
  4. Replies: 7
    Last Post: 2007-09-05, 03:41 AM
  5. Apply Fillet to 3D Polyine
    By jgh in forum AutoCAD 3D (2006 or below)
    Replies: 52
    Last Post: 2005-10-12, 03:14 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
  •