Shape Transformation

Shape Transformation

saitoib
Advocate Advocate
717 Views
5 Replies
Message 1 of 6

Shape Transformation

saitoib
Advocate
Advocate

Hello all!

I have a triangle shape with a polyline.
command PL 0,0 100,0 100,100 0,0
If I want to transform this triangle to the calculated coordinates in Lisp, what kind of program should I write?

For example
Point 1 (0 0 0) to (-1 -1 0)
Point 2 (100 0 0) to (100 -1 0)

Thank you.

Saitoib
0 Likes
Accepted solutions (1)
718 Views
5 Replies
Replies (5)
Message 2 of 6

hak_vz
Advisor
Advisor

In other words, you want to realign and scale triangle edge. Use command ALIGN

Miljenko Hatlak

EESignature

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.
0 Likes
Message 3 of 6

Kent1Cooper
Consultant
Consultant

First of all, I would strongly suggest that you draw it this way, instead, so that it will be actually closed as AutoCAD means the term, and you won't have coincident vertices that can cause trouble:

 

command PL 0,0 100,0 100,100 _close

 

It sounds to me as though, in that very specific situation, the following would transform those two points without changing the third point [if done immediately after drawing it]:

 

(command "_.scale" (entlast) "" '(100 100) 1.01)

 

[If not immediately after drawing it, substitute a variable or an object selection or something in place of the (entlast).]

 

Is that the result you are looking for?  If SCALE is not appropriate to other kinds of transformation, more detail about the possibilities would be needed.  Very likely a solution could involve calculating new values for, and replacing, the 'COORDINATES VLA property.

Kent Cooper, AIA
0 Likes
Message 4 of 6

saitoib
Advocate
Advocate

Thank you for your valuable advice.
What I want to do is to select one side of a triangle, tell it to be inside or outside, and stretch it by the number I entered.
AutoCAD's STRETCH command changes the angle of the triangle, but I want to stretch it without changing this angle.
Thank you for your help.

Saitoib
0 Likes
Message 5 of 6

Kent1Cooper
Consultant
Consultant
Accepted solution

This sounds like a job for OffPoly1.lsp and its OP1 command, >here<.

Kent Cooper, AIA
0 Likes
Message 6 of 6

saitoib
Advocate
Advocate

oh!
That's exactly what I wanted to do.
Thank you very much.

 

Saitoib
0 Likes