Displacing one anchor of a line by numerical value input.

Displacing one anchor of a line by numerical value input.

Anonymous
Not applicable
1,495 Views
13 Replies
Message 1 of 14

Displacing one anchor of a line by numerical value input.

Anonymous
Not applicable

Hello & Help !

 

Case : 

I have a vertical line. I want to displace the bottom anchor of it 3Cm left/right without changing the position of the top anchor. I want to do this by inputting a numerical horizontal  left/right displacement value in the dynamic input boxes. I do not want to displace with an input for an angle value because i often do not know what the resulting angle will be.

 

So i click the bottom anchor, move the cursor left/right and enter a numeric value, say 3 Cm. I do this with "Ortho" mode ON to preserve displacement of the anchor along (0º / Horizontal displacement of anchor only). Note in the screen shot marked with red, this is exactly what i want to do, displace horizontally right 0.03Cm right with the anchor moving along a 0º angle.

 

What i end up getting is the whole line being lengthened or shortened in other cases along the same angle axis it originally was rather than bottom anchor being displaced horizontally as i was attempting to do. So if it was a vertical line it extends or shortens vertically, if it was at a 45º angle for instance it extend or shortens along the 45º angle as well.

 

I face this nuisance countless times daily and my work around is to either fine tune it manually which is often inaccurate and takes much time that i could be otherwise working on my design.

 

I know the answer is out there, so help me guys please.

Thanks to everyone who chips in with their knowledge here,

Cheer ! Heart

0 Likes
Accepted solutions (1)
1,496 Views
13 Replies
Replies (13)
Message 2 of 14

j.palmeL29YX
Mentor
Mentor

Try this:

 

https://autode.sk/2HKV0Oq

 

cadder

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 3 of 14

Kent1Cooper
Consultant
Consultant

Note that the box whose contents are white on a dark blue background ["highlighted"] is the one into which typed input will go, and the property of the object that will change accordingly.  Press TAB to cycle between the boxes.  When the box that's circled in red in your second image is thus highlighted, then  type in the distance you want to move that end.

 

Alternatively, try turning off Dynamic Input [F12].

Kent Cooper, AIA
0 Likes
Message 4 of 14

j.palmeL29YX
Mentor
Mentor

If you wish more comfort (I'm sure you will do), some lines LISP code will be necessary.

Attached a screencast how it can work.

https://autode.sk/2HSqlLd

 

Below my first very rough code (quick & dirty). Its only a draft and works only in the WCS. If you wish a more stable code feel free to modyfy it (I don't know your knowledge about LISP). if you are not familiar with this, I'd suggest you ask in the LISP forum. Someone will surely help.

 

cadder

 

And here my draft:

(defun c:test ( / )
  (setq elem (entsel "\nPick line: "))
  (setq offset (getreal "\nHorizontal offset: "))
  (setq PP (cadr elem))    
  (setq edat (entget (car elem)))
  (setq Pstart (cdr (assoc 10 edat)))
  (setq Pend (cdr (assoc 11 edat)))
  (setq l (distance Pstart Pend))
  (If (< (distance PP Pstart) (distance PP Pend))
    (move_10)
    (move_11))
  (princ)
)

(defun move_10 ( / )
  (setq Xn (+ (car Pstart) offset))
  (setq w1 (asin (/ offset l)))
  (setq Yn (+ (cadr Pstart) (- l (* l (cos w1)))))  
  (setq Pstart_new (list Xn Yn (caddr Pstart)))
  (setq edat(subst(cons 10 Pstart_new)(assoc 10 edat)edat))
  (entmod edat)
  (princ)
)
(defun move_11 ( / )
  (setq Xn (+ (car Pend) offset))
  (setq w1 (asin (/ offset l)))
  (setq Yn (+ (cadr Pend) (- l (* l (cos w1)))))  
  (setq Pend_new (list Xn Yn (caddr Pend)))
  (setq edat(subst(cons 11 Pend_new)(assoc 11 edat)edat))
  (entmod edat)
  (princ)
)
(princ)

 

(defun asin (zahl /)
  (if (equal (* zahl zahl) 1.0 1e-15)
    (/ PI 2)
    (atan (/ zahl (sqrt (- 1.0 (* zahl zahl)))))
  )
)

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 5 of 14

j.palmeL29YX
Mentor
Mentor

I'm not sure if I understood you right. Do you really want to move the endpoint in a horizontal direction and the lengthen of the line is allowed to change? Then its simple: Turn off the dynamic input, turn on the OrthoMode, pick the endpoint, move it a little in the whished direction (left or right) an type the distance in the command line.

 

cadder

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 6 of 14

Kent1Cooper
Consultant
Consultant

@j.palmeL29YX wrote:

.... Turn off the dynamic input....


That was my suggestion as the alternative in Message 3.  It all depends on whether you want Dynamic Input on generally.  Some people just turn it off for most purposes, and may turn it on once in a while; some do the opposite.  If you like having it on most of the time, the method described first in Message 3 is probably the way to go, because you don't then have to turn it back on after you've done whatever you're after.  It takes a little bit of getting used to, especially for long-time users [like me] to whom Dynamic Input is a new feature they're not accustomed to, but it works well once you get the hang of it and get used to its limitations.

Kent Cooper, AIA
0 Likes
Message 7 of 14

j.palmeL29YX
Mentor
Mentor

@Kent1Cooperschrieb:


... the method described first in Message 3 is probably the way to go,


I don't get it to work, to move (stretch) an endpoint of a line a given horizontal displacement to the left/right with help the Dynamic input. I'm obviously missing something (i.e. a board in front of my head). Can you show it in a screencast please?

 

THX

cadder

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 8 of 14

Kent1Cooper
Consultant
Consultant

Right now I'm at a location without screencast capability.  But you can handle it:

 

With no command running [not in Stretch, for example], select the Line.

Pick on the grip at the end you want to relocate.

Move the cursor in the direction you want to take it.

Press TAB repeatedly, and watch the highlighting cycle around among the possible places you can type things into.

When the one you circled in red is the highlighted one, type in your distance [and Enter].

Kent Cooper, AIA
0 Likes
Message 9 of 14

Anonymous
Not applicable
Hey j.palmel,
Thank you for ypur attention and time you took to reply.

Your suggested reply is similar to my current work around that i foind inconvenient and was hoping to find a better solution.

Non the less much appreciated and your answer may be of help to another cadder in the future, who knows !
0 Likes
Message 10 of 14

Anonymous
Not applicable
Hey kent,
Thank you for your attention and time you took to reply.

As you noticed i am not inputting in the box i highlighted. The reason is that this box (Ortho input at an angle of 180) is not available when i cycle through the input boxes by pressing tab.

It is only visable when i first enter the input mode and is even then greyed out and not open to value inputs. Any suggestions to this ?
0 Likes
Message 11 of 14

j.palmeL29YX
Mentor
Mentor
Accepted solution

@Anonymousschrieb:

 The reason is that this box (Ortho input at an angle of 180) is not available when i cycle through the input boxes by pressing tab.

Now I found it:
- Pick the endpoint and move a little away (ORTHO ON).
- In one of the highlighted fields type the whished displacement. No matter in which of the both.
- Now type the "<" key
- end with ENTER

This is one keystroke more than you wanted, but so you get the horizontal displacement.
https://autode.sk/2KA7oyu

But: Is this really what you want? This way the lengthen of the line will change. I thougth you want the lengthen of the line should stay constand value, don't you.

 

 

cadder

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 12 of 14

Anonymous
Not applicable
Hey J.palmel,

Thank you for your attention and time you took to reply. Every time is much apprechiated. Much love.

You did find it ! That spot on and provided my missing key to resolve what i was trying to do. Simple as it was it escaped me, i was using the two angle boxes that appeard without inputting (<) to prompt a different one.

I am yes not concerned by the final measure of the angle rather the displacement of the end-point horizontally for this case.

I unfortunatly will not be able to make use of ypur provided code as i am not at all versed in code or LISP (whatever that is).

I am gald to have solved this and very grateful for your effort.

Will remember you in thanks daily while cadding now (:
0 Likes
Message 13 of 14

j.palmeL29YX
Mentor
Mentor

... and with this dsettings (see pic) you get the hor. displacement immediately.

 

cadder

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 14 of 14

j.palmeL29YX
Mentor
Mentor

@Anonymousschrieb:

I unfortunatly will not be able to make use of ypur provided code as i am not at all versed in code or LISP (whatever that is).


This code (yes, it is LISP) doesn't help you anyway, because it rotates the line about the upper endpoint in such an angle that the lower endpoint gets a given horizontal displacement, but without changing its lengthen.

I'm glad that I could help you.

 

Have a nice day

cadder

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes