Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What i mistake ?

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
jaimuthu
305 Views, 8 Replies

What i mistake ?

(defun c:PIEL ()

(setq pt1 (getpoint "\nPick the first point: "))
(setq pt2 (getpoint pt1 "\nPick the second point: "))
(setq pt3 (getpoint pt2 "\nPick the third point (90 degrees): "))


(setq an (* (/ 180 pi) (angle pt2 pt3)))


(command "_.PLINE" pt1 pt2 "")


(command "_.PLINE" pt2 pt3 "")


(command "_.INSERT" "JAI" pt2 1.0 1.0 0)

(setq obj1(entlast))



(princ (strcat "\nRotation angle: " (rtos an 2 2)))
)

(princ)

8 REPLIES 8
Message 2 of 9
ВeekeeCZ
in reply to: jaimuthu

The question is, which rotation do you want to use? There are two options:

 

eekeeCZ_0-1727982290340.png

 

Message 3 of 9
jaimuthu
in reply to: ВeekeeCZ

i want  i pick p1 p2 p3  block object insert and angle is p2 p3  its work only one direction its an angle is 0 but other wise its insert but angle its opposite direction dont want dynamic action  its just i test for block 

Message 4 of 9
ec-cad
in reply to: jaimuthu

Tried simple change, didn't work, removed the 'code'

 

 

 

ECCAD

Message 5 of 9
ВeekeeCZ
in reply to: jaimuthu

you need use this line

(command "_.INSERT" "JAI" pt2 1.0 1.0 (+ an 90))

 

Message 6 of 9
ec-cad
in reply to: ec-cad

No,

That's just not right. Works for all but pt2 / pt3 going right to left ?

 

 

Message 7 of 9
ec-cad
in reply to: jaimuthu

Looks like I'll have to check the direction of both plines.

The are 16 combinations of which way they are applied.

But in any case, the elbow needs to be at 0 or 180 it looks like.

I'll try a little later, lunch is ready.

 

ECCAD

 

Message 8 of 9
ec-cad
in reply to: jaimuthu

OK, I got it working.

Attached is the Lisp and the sample drawing, with notes.

Seems that there were only 8 combinations of those pline connections,

since pt3 can only be 'perp' to pt2, 0, 90, 180 or 270.

Anyway, have fun with it.

 

Cheers

 

ECCAD

 

Message 9 of 9
jaimuthu
in reply to: ec-cad

Thank For Your Reply its work Good its possible Any degree ?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report