Jump to content

Add a fixed point


mhmnibras

Recommended Posts

"(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...

Link to comment
Share on other sites

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)
)
...

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...