barristann Posted November 7, 2023 Posted November 7, 2023 (edited) Hi all. I'm not sure why the below will not work. It says "Pick Point: Point or option keyword required." (setq P (getpoint "Pick Point: \n")) ;; pick point (setq El_mm (strcat "105100")) ;; New Elevation (setq P_fixed (strcat "(list " (rtos (car p) 2 6) " " (rtos (cadr p) 2 6) " " El_mm ")")) ;; Keep x & y the same, but Modify z to New Elevation (command "-insert" "C:\\Myblock\\RBlock.dwg" P_fixed "1" "1" "0") ;;; insert block at this Modified Point Edited November 7, 2023 by barristann Quote
Steven P Posted November 7, 2023 Posted November 7, 2023 Try this: The values for x, y scales and rotation should be a number, not a string (Number: 1 or string: "1") The point should be a list and not a string. - Replaced your El_mm line to keep it as a number (worth doing a check if this value comes from another LISP that it is a number) - 2 different options to calculate the point, P_fixed, the second half of the mapacar line is a good example how to set elevation to 0 (mapcar '* '(1 1 0) P)) - Insert as described above (defun c:test ( / ) (setq P (getpoint "Pick Point: \n")) ;; pick point (setq El_mm 105100) ;; New Elevation (setq P_fixed (mapcar '+ (list 0 0 El_mm) (mapcar '* '(1 1 0) P))) ;;Point at elevation ;;or (setq P_fixed (list (car p) (cadr pt) EL_mm)) ;;Point at elevation (command "-insert" "C:\\Myblock\\RBlock.dwg" P_fixed 1 1 0) ) 3 Quote
barristann Posted November 7, 2023 Author Posted November 7, 2023 Perfect. It works. Thank you Steven 1 Quote
mhupp Posted November 7, 2023 Posted November 7, 2023 if your want to use the point with visual lisp instead of command in Autocad you need to wrap the xyz with vlax-3D-point function. (setq P_fixed (vlax-3D-point (list (car p) (cadr p) EL_mm))) 2 Quote
barristann Posted November 7, 2023 Author Posted November 7, 2023 I'll be sure to make a note of this. Thank you mhupp. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.