mhmnibras Posted September 7, 2014 Share Posted September 7, 2014 "(defun c:xy() (command "setvar" "dimzin" 0) (setq ucsname (getstring "\nPlease enter the current ucs name: ")) (command "ucs" "restore" ucsname) (setq e (entsel "\nPlease choose an object: ")) (setq pt1 (getpoint "\nplease locate point for Y:")) (setq dy1 (cadr pt1)) (setq pt2 (getpoint "\nplease locate point for X:")) (setq dy2 (cadr pt2)) (setq e (entget (car e))) (foreach f e (if (= (car f) 10) (progn (setq g (list (cadr f) (caddr f))) (setq g (trans g 0 1)) (setq x (car g)) (setq xabs (sqrt (* x x))) (setq y (cadr g)) (setq yabs (sqrt (* y y))) (setq pty (list (- x 0.03) (+ dy1 0.015))) (setq ch (rtos yabs 2 3)) (command "text" pty 90 ch) (setq ptx (list (- x 0.03) (+ dy2 0.04))) (setq ch (rtos xabs 2 3)) (command "text" ptx 90 ch) (command "line" g (list x dy1) "") ) ) ) )" in this code no need getpoint i need to add a fix coordinate from the ucs point for x axis and y axis plz help me any one... Quote Link to comment Share on other sites More sharing options...
asos2000 Posted September 7, 2014 Share Posted September 7, 2014 Code posting guidelines Quote Link to comment Share on other sites More sharing options...
MSasu Posted September 8, 2014 Share Posted September 8, 2014 To retrive the value of Y coordinates instead of points, just replace this piece of code: ... (setq pt1 (getpoint "\nplease locate point for Y:")) (setq dy1 (cadr pt1)) (setq pt2 (getpoint "\nplease locate point for X:")) (setq dy2 (cadr pt2)) ... with this: ... (if (or (not (setq e (entsel "\nPlease choose an object: "))) (not (setq dy1 (getreal "\nFirst Y coordinate:"))) (not (setq dy2 (getreal "\nSecond Y coordinate:")))) (exit) ) ... Quote Link to comment Share on other sites More sharing options...
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.