Jump to content

How to get the point in the command line?


yxl030

Recommended Posts

Problem 1: 

I want to put some text,use "text" and "move" ( so that i can see what is being inserted.),then draw a line from the point I put to somewhere else.

How to get the point in the command line?

(defun c:test()
  (command "_.text" "0,0" 2 0 "ABC")
  (command "_.move" "_l" "" "0,0" pause)    ; How to get this point I click ? Suppose it's Pt1
  (command "_.line" Pt1 pause)
  )

 

Problem 2: 

Is there any way not to display this line when moving ?

 1630373360.png.e51946f35f6f5cf8a18cb78900b46b02.png

Link to comment
Share on other sites

to the first question is:

(setq pt1 (getpoint "\nPick the point: "))

And how you call the point is your decision, you can call it p1, x or whatever.

 

The second one I don't have a clue, but maybe someone else can answer it.

Link to comment
Share on other sites

2 hours ago, Isaac26a said:

to the first question is:


(setq pt1 (getpoint "\nPick the point: "))

And how you call the point is your decision, you can call it p1, x or whatever.

 

The second one I don't have a clue, but maybe someone else can answer it.

(command "_.move" "_l" "" "0,0" pt1)    ;
Thanks for your reply .But in that case  I can't see what's I inserting directly,

Link to comment
Share on other sites

Try this after your move command so you can see your text as you move it about

 

(setq pt1 (cdr (assoc 10 (entget(entlast)) )))

 

pt1 is the text coordinates.

 

 

I've not seen how to hide that dashed line as you move things, is it a big problem or something that would be nice? If you can hide it,  I guess it will be a system variable to change, type setvar and then ? to see a list of them, might be in there but I don't know

  • Like 1
Link to comment
Share on other sites

Or maybe this is what you're trying to do:

(command "_.move" "_l" "" "0,0" (setq pt1 (getpoint "\nPick the point: ")))

Although I don't know why you want to have the point set in a variable

Link to comment
Share on other sites

5 minutes ago, Isaac26a said:

Or maybe this is what you're trying to do:


(command "_.move" "_l" "" "0,0" (setq pt1 (getpoint "\nPick the point: ")))

Although I don't know why you want to have the point set in a variable

 

 

the next line down, pt1 is used as the start point of a line

Link to comment
Share on other sites

17 hours ago, Steven P said:

Try this after your move command so you can see your text as you move it about

 


(setq pt1 (cdr (assoc 10 (entget(entlast)) )))

 

pt1 is the text coordinates.

 

 

I've not seen how to hide that dashed line as you move things, is it a big problem or something that would be nice? If you can hide it,  I guess it will be a system variable to change, type setvar and then ? to see a list of them, might be in there but I don't know

Thank you ,Steven P !  It works very well.
I don't want it to display , just to make it look good. And I found out that this  is no longer available.

Link to comment
Share on other sites

7 hours ago, Isaac26a said:

Or maybe this is what you're trying to do:


(command "_.move" "_l" "" "0,0" (setq pt1 (getpoint "\nPick the point: ")))

Although I don't know why you want to have the point set in a variable

Thank you ,Isaac26a. But it works like 
(setq pt1 (getpoint "\nPick the point: "))
(command "_.move" "_l" "" "0,0" pause)

I cann't see what is being inserted directly.

Link to comment
Share on other sites

Eldon, Thank you for telling me what it‘s called. 

Otherwise I wouldn't know that the problem couldn't be solved.


https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/How-to-disable-or-change-the-color-of-the-rubber-band-in-AutoCAD.html

the link is too old.

Edited by yxl030
  • Like 1
Link to comment
Share on other sites

12 hours ago, yxl030 said:

Eldon, Thank you for telling me what it‘s called. 

Otherwise I wouldn't know that the problem couldn't be solved.


https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/How-to-disable-or-change-the-color-of-the-rubber-band-in-AutoCAD.html

 

 

Congratulations on finding that article. However it is dated 2015, and my research lead me to believe that from version 2018 and onwards, it was possible. So perhaps you should update!!

  • Like 1
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...