+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Senior Member teknomatika's Avatar
    Using
    AutoCAD 2009
    Join Date
    Sep 2010
    Location
    Portugal
    Posts
    247

    Default Question from beginner

    Registered forum members do not see this ad.

    What is failing to not work properly?

    Code:
    ;;writing point with z value
    (defun c:wpz()
    (setvar "PDMODE" 3)
    (setq pt (getpoint "\nPoint:"))
    (setq zv (getdist "\nZ Value:"))
    (setq x (car pt))
    (setq y (cadr pt))
    (command "point" x y zv)
    (princ)
    )

  2. #2
    Senior Member teknomatika's Avatar
    Using
    AutoCAD 2009
    Join Date
    Sep 2010
    Location
    Portugal
    Posts
    247

    Default

    maybe so?

    Code:
    ;;writing point with z value
    (defun c:wpz()
    (setvar "PDMODE" 3)
    (setq pt (getpoint "\nPoint:"))
    (setq zv (getdist "\nZ Value:"))
    (setq x (car pt))
    (setq y (cadr pt))
    (setq cord (list x y zv))
    (command "point" cord)
    (princ)
    )

  3. #3
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    4,008

    Default

    The issue is the way you tried to build the coordinates list:
    Code:
    (defun c:wpz()
     (setvar "PDMODE" 3)
     (setq pt (getpoint "\nPoint:"))
     (setq zv (getdist "\nZ Value:"))
     (setq x (car pt))
     (setq y (cadr pt))
     (command "point" (list x y zv))
     (princ)
    )
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  4. #4
    Senior Member teknomatika's Avatar
    Using
    AutoCAD 2009
    Join Date
    Sep 2010
    Location
    Portugal
    Posts
    247

    Default

    Quote Originally Posted by MSasu View Post
    The issue is the way you tried to build the coordinates list:
    Code:
    (defun c:wpz()
     (setvar "PDMODE" 3)
     (setq pt (getpoint "\nPoint:"))
     (setq zv (getdist "\nZ Value:"))
     (setq x (car pt))
     (setq y (cadr pt))
     (command "point" (list x y zv))
     (princ)
    )
    Tanks, Mircea.

    However, how do I set routine by the size of the point style. For example, to determine their visibility in absolute units?

  5. #5
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    4,008

    Default

    Please check the PDSIZE system variable - will need to input a positive value for absolute units (the negative one means percentage of viewport size).
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  6. #6
    Senior Member teknomatika's Avatar
    Using
    AutoCAD 2009
    Join Date
    Sep 2010
    Location
    Portugal
    Posts
    247

    Default

    Quote Originally Posted by MSasu View Post
    Please check the PDSIZE system variable - will need to input a positive value for absolute units (the negative one means percentage of viewport size).
    Tanks, Mircea.
    Resolved.

  7. #7
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,901

    Default

    Not sure I would use getdist

    Code:
     (setq zv (getdist "\nZ Value:"))
     (setq zv (getreal "\nZ Value:"))
    or
     (setq zv (getdist pt "\nZ Value:"))
    A man who never made mistakes never made anything

  8. #8
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    4,008

    Default

    First, I was also tempted to suggest to constrain indication of that distance from insertion point, but later thought that, since OP doesn't gave info about his scenario, then is possible that he/she will pick the said distance in a different part of the drawing.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  9. #9
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,901

    Default

    Registered forum members do not see this ad.

    A lot of people use GETDIST thinking its as the name implies get a distance when asking for the user to actually enter a value via the keyboard. Its real purpose is to get a distance using mouse style screen input.
    A man who never made mistakes never made anything

Similar Threads

  1. Major beginner! Simple question :)
    By circles in forum AutoCAD Beginners' Area
    Replies: 5
    Last Post: 30th Jul 2012, 04:30 am
  2. Xref Beginner question
    By bezy9530 in forum AutoCAD Beginners' Area
    Replies: 7
    Last Post: 28th Dec 2010, 05:47 pm
  3. beginner question
    By Lt Dan's legs in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 12th Jul 2010, 03:51 pm
  4. Beginner Question
    By Mezalaja in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 1st Jul 2010, 07:26 am
  5. Beginner question
    By Lt Dan's legs in forum AutoLISP, Visual LISP & DCL
    Replies: 28
    Last Post: 17th Jun 2010, 07:18 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