Move entity to sloping UCS along world UCS's Z-Axis

Move entity to sloping UCS along world UCS's Z-Axis

kpennell
Collaborator Collaborator
501 Views
3 Replies
Message 1 of 4

Move entity to sloping UCS along world UCS's Z-Axis

kpennell
Collaborator
Collaborator

For now I only need this to work for a UCS where the X-Axis is sloping, as in the Y-Axis is plumb to world UCS.  I need a selected set of entities to move based on a point, projected to the current sloping UCS, but perfectly vertical.  Where would I start?

 

I would imagine, I would have to get the slope of the current UCS relative to the world UCS.  The only way I would know how to do that would be to create a line in the current sloping UCS, get in the world UCS, get the extended data of the line, delete it.  Now I got my slope.

 

I have the delta Z from picking my base point.  My Y point will be the same because it's only sloping in one direction, the x-axis is sloping.  I need to use trig to get my x value.

 

Does anyone think I'm not on the right path?

 

 

0 Likes
502 Views
3 Replies
Replies (3)
Message 2 of 4

SEANT61
Advisor
Advisor

A drawing file, or an image, may help clarify the situation.  Though, it does certainly sounds like trig will be involved. 


************************************************************
May your cursor always snap to the location intended.
0 Likes
Message 3 of 4

Kent1Cooper
Consultant
Consultant

(setq

  conv (trans '(1 0 0) 1 0 T); conversion of 1,0,0 from current CS to WCS as displacement
  angrad (atan (/ (caddr conv) (car conv))); angle in radians
  angdeg (* (/ ang pi) 180); angle in degrees

); setq

 

[By the way, it's not the "world UCS" -- it's the "World CS" or WCS.  The U in UCS is, after all, for User, meaning something specified by the User different from the World Coordinate System.]

Kent Cooper, AIA
0 Likes
Message 4 of 4

Kent1Cooper
Consultant
Consultant

@Kent1Cooper wrote:

(setq

  conv (trans '(1 0 0) 1 0 T); conversion of 1,0,0 from current CS to WCS as displacement
  angrad (atan (/ (caddr conv) (car conv))); angle in radians
  angdeg (* (/ ang pi) 180); angle in degrees

); setq


Sorry [I was in a rush to get out the door] -- that should be:

....

  angdeg (* (/ angrad pi) 180); angle in degrees

....

 

[And in case it needs clarification, that gives the angle of the sloped X axis of the current UCS relative to the World X axis.]

Kent Cooper, AIA
0 Likes